What is the difference between the aov(depvar~timevar+Error(id))
and the aov(depvar~timevar+Error(id/timevar))
formula specifications? These two varian
Here's a blog post that'll help break down what each means under the "Random Effects in Classical ANOVA" section.
From the blog, here's a summary for what "dividing" in the Error
term means.
aov(Y ~ Error(A), data=d) # Lone random effect
aov(Y ~ B + Error(A/B), data=d) # A random, B fixed, B nested within A
aov(Y ~ (B*X) + Error(A/(B*X)), data=d) # B and X interact within levels of A
So from your question,
aov(depvar~timevar+Error(id/timevar))
means you have a random effect from id
but then fix timevar
with timevar
nested within id
levels versus
aov(depvar~timevar+Error(id))
which is just taking id
as the random effects with no constraint on other variables.
Source: http://conjugateprior.org/2013/01/formulae-in-r-anova/
This might prove useful as well, which is some code going over analysis of variance that has some recommendations on learning ANOVA.