5

For a two-way repeated measures design, we can specify the model using aov in the following fashion:

aov(dv ~ iv1 + iv2 + Error(subject/(iv1*iv2)), data=dataset)

Take the sample data from personality-project.org (see code below), the error term for this particular model is Error(Subject/(Task*Valence)).

datafilename="http://personality-project.org/r/datasets/R.appendix4.data"
data.ex4=read.table(datafilename,header=T)   #read the data into a table
data.ex4                                      #show the data
aov.ex4=aov(Recall~(Task*Valence)+Error(Subject/(Task*Valence)),data.ex4 )

What if I specify the error term instead as Error(Subject). What kind of design is this?

From what I recall, whether you include a factor - e.g., whether Task and Valence are included - in the error term depends on whether a factor is a "within-subjects" factor. If, say, this particular recall study also included "sex" as a predictor, then we would not include it in the error term because it is a between-subjects factor. But I am not sure what it means when we don't include any of the predictors in the error term. Is it basically an intercept-only model much like the one below specified using lmer?

lmer(Recall~Task*Valence + (1|Subject), data=data.ex4)
amoeba
  • 93,463
  • 28
  • 275
  • 317
Alex
  • 437
  • 1
  • 5
  • 15
  • 2
    The answer to your question is basically Yes. Your Q is related to https://stats.stackexchange.com/questions/286280 and https://stats.stackexchange.com/questions/60108 - I asked the first one, and am running a bounty on the second one. There are more related questions here too. I hope a comprehensive answer will appear in one of these threads. – amoeba Jun 22 '17 at 13:50

0 Answers0