I am trying to run an ANCOVA with defined error terms. Thus I have to use AOV and not lm. my response variable is proportion of mice paw prints on track plates. These plates were placed on plots that had vegetation and fruit manipulated to two levels each (present or absent), and were sampled monthly for 14 months (repeated measures). The fully crossed factor design was also blocked. My sample size is just 3 and I cannot run the full model because I would ran out of degrees of freedom. I measured raccoon activity on these plots as a covariate. So I am running the following model. summary(model<-(aov(mice~veget*fruit*time+(time*block)+(time*block*veget)+(time*block*fruit)+coon+Error(block/plot, data = track)))) here is a sample of the data plot veget fruit time block coon mice p1 Vremoved Fintact 1 b1 8.605276544 26.67179738 p2 Vintact Fintact 1 b1 16.64929378 45 p3 Vremoved Fremoved 1 b1 22.12023855 26.67179738 p4 Vintact Fremoved 1 b1 16.64929378 41.57117579 p5 Vintact Fremoved 1 b2 30.73522506 38.09196076 p6 Vremoved Fintact 1 b2 22.12023855 26.67179738 p7 Vintact Fintact 1 b2 8.605276544 8.605276544 p8 Vremoved Fremoved 1 b2 8.605276544 8.605276544 p9 Vintact Fintact 1 b3 8.605276544 16.64929378 p10 Vintact Fremoved 1 b3 16.64929378 8.605276544 p11 Vremoved Fintact 1 b3 8.605276544 30.73522506 p12 Vremoved Fremoved 1 b3 8.605276544 16.64929378 p1 Vremoved Fintact 2 b1 22.12023855 41.57117579 p2 Vintact Fintact 2 b1 8.605276544 48.42882421 My question is. Is there a more simple way to run this mess using lm or not? -- View this message in context: http://www.nabble.com/ANCOVA-with-defined-error-terms-tp25055311p25055311.html Sent from the R help mailing list archive at Nabble.com.
track.aov <- aov(mice ~ coon + block*veget*fruit*time - block:veget:fruit:time + Error(block/plot), data = track) anova(track.aov) I think this is what you are looking for. This model in words says, What is the effect of the four-way crossing after adjusting for the covariate coon? We don't have enough degrees of freedom for the full crossing, so remove the four-way interaction. anova() gives the sequential sums of squares of (multi-degree of freedom) effects. Be sure that the five variables (block, veget, fruit, time, plot) are factors. I am assuming time is a factor here.
Apparently Analagous Threads
- simple plot in ggplot2, wrong error bars
- wroung groupedData despite reading Bates and Pinheiro 3 times
- What is my replication unit? Lmer for binary longitudinal data with blocks and two treaments.
- GroupedData for three way randomized block. LME
- using subset command in glm and glm coefficients output