Re: [R] Rsquared for anova

From: Peter Ehlers <ehlers_at_ucalgary.ca>
Date: Sat, 16 Apr 2011 00:37:49 -0700

On 2011-04-15 14:36, Dorien Herremans wrote:
> Hi,
>
> Thank you for your suggestion.
>
> I am stil quite new to the syntax of R. I tried in a few ways but all
> produced errors:

You might find working through "An Introduction to R" enlightening. It's certain to be a more efficient method than a guess-and-hope approach to modeling syntax.

>
>> fit<- lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length,
> data=expdata))

Why do you have the extra parentheses? They cause lm() to think that _everything_ inside the inner parens is the 'formula' argument to lm(), including the ", data=..." part.

> Error: unexpected ',' in "fit<-
> lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length,"
>> fit<- lm(tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length)
> Error in eval(expr, envir, enclos) : object 'tos' not found

Well, now you've left off the 'data=' argument and R can't find 'tos'. Isn't the message pretty clear?

>> summary.lm(tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length)
> Error in if (p == 0) { : argument is of length zero
>
> Thanks for any additional insight...

Are you seriously contemplating up to 10-way interactions? I hope that you have a great deal of data and much patience as you attempt to interpret those interactions.

Peter Ehlers

>
> Dorien
>
> On 15 April 2011 18:07, Dieter Menne<dieter.menne_at_menne-biomed.de> wrote:
>
>>
>> dorien wrote:
>>>
>>> I calculate an anova test in the following way:
>>>
>>> ... aov example
>>>
>>> I want to check the fit of the model with Rsquared
>>>
>>
>> Try summary(lm(...)) instead.
>>
>> Dieter
>>
>>
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/Rsquared-for-anova-tp3452399p3452434.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 16 Apr 2011 - 07:40:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 16 Apr 2011 - 08:00:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive