# [R] Rsquared for anova

Peter Ehlers ehlers at ucalgary.ca
Sat Apr 16 09:37:49 CEST 2011

```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)

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
>>>
>>
>>
>> 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