Re: [R] R2 in multilevel modelling

2012-04-30 Thread Bert Gunter
As you have not provided a clue of what your models are, one can only guess. But if you mean using lots of fixed effects vs a random effect, the answer is that there is no such animal. They are two different non-nested models, and should be chosen based on subject matter considerations.

Re: [R] R2 in multilevel modelling

2012-04-30 Thread Joshua Wiley
Hi Chiara, If you just want to compare model fit, you could use a LRT between models where you do and do not estimate the variance/covariance matrix of random effects. R^2 in mixed models do not have the same nice properties they do in fixed effects models. Cheers, Josh On Mon, Apr 30, 2012

Re: [R] R2 in multilevel modelling

2012-04-30 Thread Kevin Wright
If you want to know if your model fit will your data, then looking at residual-type plots is useful, as can be plotting the model-predictions and observed data together. You might also find interesting R2 statistics for mixed models by Matthew Kramer. Beware--as others have indicated, there is

Re: [R] r2 and p value dispaly in table

2012-04-29 Thread Tal Galili
You came close. Here is how it might be done: individual - rep(c(1,1,6,8,8,9,9,9,12,12),2) day - rep(c(4,17,12,12,17,3,9,22,13,20),2) condition - rep(c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68, 0.78, 0.73, 0.71),2) test - data.frame(individual, day, condition) #ind.id - unique(test$individual)

Re: [R] r2 and p value dispaly in table

2012-04-29 Thread Kristi Glover
in the result table: I want to add two columns with the information of r2 and p value. I hope you understand my problem. thaks for allyour help. I am learning R. cheers kristi From: tal.gal...@gmail.com Date: Sun, 29 Apr 2012 12:13:08 +0300 Subject: Re: [R] r2 and p value dispaly in table To: kristi.glo

Re: [R] r2 and p value dispaly in table

2012-04-29 Thread Tal Galili
learning R. cheers kristi -- From: tal.gal...@gmail.com Date: Sun, 29 Apr 2012 12:13:08 +0300 Subject: Re: [R] r2 and p value dispaly in table To: kristi.glo...@hotmail.com CC: r-help@r-project.org You came close. Here is how it might be done: individual

Re: [R] R2 function from PLS to use a model on test data

2010-08-03 Thread Bjørn-Helge Mevik
Addi Wei addi...@gmail.com writes: Hello, I am having some trouble using a model I created from plsr (of train) to analyze each invididual R^2 of the 10 components against the test data. For example: mice1 - plsr(response ~factors, ncomp=10 data=MiceTrain) R2(mice1)##this

Re: [R] R2 function from PLS to use a model on test data

2010-07-08 Thread Addi Wei
I figured out the answer. Since I have both the predicted and actual values, I simply need to call the lm function, and summary to see R^2 which matches what MOE provided. myline.fit -lm( y~x) summary(myline.fit) -- View this message in context:

Re: [R] R2

2009-12-29 Thread Phil Spector
Nancy - Please notice that ** is not an R operator. The caret (^) is the exponentiation operator in R. - Phil On Tue, 29 Dec 2009, Nancy Adam wrote: Hi everyone, I tried to write the code of computing R2 for a regression system but I failed. This

Re: [R] R2

2009-12-29 Thread Max Kuhn
Nancy, There is a function in the caret package called defaultSummary that will compute both RMSE and R2 for you. Max On Dec 28, 2009, at 11:51 PM, Nancy Adam nancyada...@hotmail.com wrote: Hi everyone, I tried to write the code of computing R2 for a regression system but I

Re: [R] R2

2009-12-29 Thread Gabor Grothendieck
** works as exponentiation for me: 3**2 [1] 9 On Tue, Dec 29, 2009 at 6:10 AM, Phil Spector spec...@stat.berkeley.edu wrote: Nancy -   Please notice that ** is not an R operator. The caret (^) is the exponentiation operator in R.                                      - Phil On Tue, 29

Re: [R] R2

2009-12-29 Thread Uwe Ligges
Gabor Grothendieck wrote: ** works as exponentiation for me: 3**2 [1] 9 Yes, but see ?** that it is just documented in a note and has been deprecated in S since 20 years... Uwe Ligges On Tue, Dec 29, 2009 at 6:10 AM, Phil Spector spec...@stat.berkeley.edu wrote: Nancy - Please

Re: [R] R2

2009-12-29 Thread Prof Brian Ripley
On Tue, 29 Dec 2009, Phil Spector wrote: Nancy - Please notice that ** is not an R operator. The caret (^) is the exponentiation operator in R. - Phil Actually, no, 2**3 [1] 8 Indeed ^ is the preferred exponentiation operator, but ** has 'always'

Re: [R] R2

2009-12-29 Thread Nancy Adam
me what I have to change to compute R2? Many thanks, Nancy Date: Tue, 29 Dec 2009 17:28:59 + From: rip...@stats.ox.ac.uk To: spec...@stat.berkeley.edu CC: nancyada...@hotmail.com; r-help@r-project.org Subject: Re: [R] R2 On Tue, 29 Dec 2009, Phil Spector wrote: Nancy - Please

Re: [R] R2 in lm function

2009-12-14 Thread Jorge Ivan Velez
Hi Tom, Take a look at the following taken/modified from ?lm: ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group - gl(2,10,20, labels=c(Ctl,Trt)) weight - c(ctl, trt) lm.D9 - lm(weight ~ group) slm - summary(lm.D9) str(slm)

Re: [R] R2 for SAR and validation

2009-09-01 Thread Roger Bivand
Did you read the posting guide? Your posting is not comprehensible to most of the readers of this list, and you have not explained whether this has anything to do with R, or any of its contributed packages; there are no clues in included code or code snippets illustrating the problem. Your TLA is

Re: [R] r2 question

2009-07-28 Thread Kingsford Jones
Hi Sarah, From your description it sounds as though you would be best off consulting with a statistician. Without having a clear understanding of the research hypotheses, experimental units, how randomization was performed, the spatial and temporal structure of the experiment, etc, it's not

Re: [R] r2 question

2009-07-25 Thread Steve Lianoglou
Hi Sarah, On Jul 25, 2009, at 8:25 AM, Buckmaster, Sarah wrote: Hi everyone, I have a question about calculating r-squared in R. I have tried searching the archives and couldn't find what I was looking for - but apologies if there is somewhere I can find this... I carried out a

Re: [R] r2 for lm() with zero intercept

2008-12-01 Thread Berwin A Turlach
G'day Glenn, On Tue, 2 Dec 2008 12:53:44 +1100 [EMAIL PROTECTED] wrote: I'm a little confused about the R2 and adjusted R2 values reported by lm() when I try to fix an intercept. When using +0 or -1 in the formula I have found that the standard error generally increases (as I would expect)

Re: [R] r2 for lm() with zero intercept

2008-12-01 Thread Glenn.Newnham
) Cc: r-help@r-project.org Subject: Re: [R] r2 for lm() with zero intercept G'day Glenn, On Tue, 2 Dec 2008 12:53:44 +1100 [EMAIL PROTECTED] wrote: I'm a little confused about the R2 and adjusted R2 values reported by lm() when I try to fix an intercept. When using +0 or -1 in the formula I

Re: [R] r2 for lm() with zero intercept

2008-12-01 Thread Berwin A Turlach
G'day Glenn, On Tue, 2 Dec 2008 17:02:26 +1100 [EMAIL PROTECTED] wrote: Obviously the code is functioning properly then, but do you consider this the best way of computing R^2 for a zero intercept? The way R does. What else would I say. ;-) That formula compares the variance explained by