[R] ANCOVA with defined error terms

hpdutra hpdutra at yahoo.com
Sun Aug 23 07:05:57 CEST 2009



I can actually run the code from my post.
I used the nabble for my list server
http://www.nabble.com/ANCOVA-with-defined-error-terms-td25055311.html#a25100032
I don't know which server you use, but that one is not truncated, I can copy
the code just fine and run it.
Anyway, here it is again

summary(mymodel<-(aov(mice~veget*fruit*time+(time*block)+
(time*block*veget)+(time*block*fruit)+coon+Error(block/plot, data =
track))))

I have a question. After I use your suggestion of using 
sapply(track, function(x) length(levels(x))
I get a completely wrong structure for the DF. I get just 1 DF for time,
instead of 13. 
And I cannot run your model 
ricsmodel<-aov(mice ~ coon + block*veget*fruit*time - block:veget:fruit:time
+ Error(block/plot), data = track))

Any insights are helpful. Thank you for your patience.
Humberto

Richard M. Heiberger wrote:
> 
> Your email program truncated the model.  It would not run,
> hence was not reproducible.
> The last few characters of the first line are
> 
>     +Error(block/plot,
> 
> which is syntactically impossible because there is no
> closing parenthesis before the comma.
> Try executing your email and see the difficulty.
> 
> Please resend the model statement from your source file,
> not from the R output window,
> with no more than 60 characters per line.
> 
> I am asking for the following from the trailer of all R-help email
> "and provide commented, minimal, self-contained, reproducible code."
> 
> I have the dataset now
> 
>  > dim(track)
> [1] 168   9
>  > sapply(track, class)
>       plot     veget     fruit      time     block   rawcoon      coon 
>      mice
>   "factor"  "factor"  "factor"  "factor"  "factor" "numeric" "numeric" 
> "numeric"
>    rawmice
> "numeric"
>  > sapply(track, function(x) length(levels(x)))
>     plot   veget   fruit    time   block rawcoon    coon    mice rawmice
>       12       2       2      14       3       0       0       0       0
>  >
> 
> 
> Rich
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/ANCOVA-with-defined-error-terms-tp25055311p25100395.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list