I am performing a repeated measures ANOVA in R, where the experimental design is composed of a between-subjects factor (Prodotto
, three levels), the within-subjects factor is time (Tempo
, four levels&mdahs;an ordered factor) and each Product * Time
is repeated on eleven patients (idPaziente
).
The aov()
syntax would be:
myAov<-aov(valore ~ Tempo*Prodotto + Error(idPaziente/Tempo),data=mydata)
whilst the lme()
(from the nlme
package) syntax would be
myModel <- lme(valore ~ Tempo*Prodotto,data=mydata, random= ~ 1 | idPaziente/Tempo)
In Finch (2014) Multilevel Modeling with R, I find a specification of a longitudinal model that would be written as:
myModel <- lme(valore ~ Tempo*Prodotto,data=mydata, random= ~ 1 | idPaziente)
I guess the equivalent aov
version would have Error(idPaziente)
instead of Error(idPaziente/Tempo)
.
I would like to ask:
What is the correct specification for my repeated measures model, both for
aov()
andlme()
?Why are
(1 | idPaziente/Tempo)
andError(idPaziente/Tempo)
more appropriate than(1 | idPaziente)
andError(idPaziente)
?How can I perform post hoc analysis taking on the Prodotto term?