Factorial Repeated Measures ANOVA

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Factorial Repeated Measures ANOVA

Hi all,

I'm racking my brains trying to do a Factorial Repeated Measures ANOVA; something that I was able to do easily on SPSS (the new lab I've moved to uses SAS). I found a similar discussion to this on these treads, but it was never really concluded.

I have three IVs, one is an independent group with two levels ("teen" and "adult") while the other two are repeated measures IVs with two levels each (Time: "0 Months" and "12 Months"; Task: "Task A" and "Task B".) So just to be clear, each of my participants belonged to one of two groups, but all participants completed task A and task B at 0 Months and 12 Months.

I've found in the SAS documentation (and on other websites) how to conduct an ANOVA where one variable is a repeated measures one while the other variables are independent groups; it seems to be possible to do it in PROC GLM or PROC MIXED. However, I cannot see how to alter this syntax so as to incorporate an additional repeated measures variables; and to look at the interaction between the two repeated measures variables, i.e. I'd like to be able to say whether the difference between performance on task A and B is different at each time point.

If I was just using one repeated measures variable (e.g. Time), I'd use the following code:

PROC GLM DATA=MyData;
  CLASS Age_Group;
  MODEL Time1-Time2 = Age_Group;
  REPEATED Time 2;
RUN;

...but I can't see how to alter this to include another repeated measures IV. Is it the case that PROC GLM can only handle one Repeated Measures variable at a time and that I need to turn to PROC MIXED to do this?

Hope the above makes sense!

Fearghal


Accepted Solutions
Solution
‎04-09-2014 03:26 PM
Respected Advisor
Posts: 2,655

Re: Factorial Repeated Measures ANOVA

Yes, you need to move to PROC MIXED.  See the part of the documentation under the REPEATED statement for Kronecker products in the type= option.  With two times and two tasks, your code would look something like;

proc mixed data=yourdata;

class time task age_group subjid;

model response_variable=time|task|age_group;

repeated task age / type = UN@UN  subject=subjid;

lsmeans time|task|age_group/diff cl;

run;

Be sure that yourdata is in 'long' form, with one record having a unique combination of values of time, task, age_group and subjid for each observation of response_variable.

Steve Denham

View solution in original post


All Replies
Solution
‎04-09-2014 03:26 PM
Respected Advisor
Posts: 2,655

Re: Factorial Repeated Measures ANOVA

Yes, you need to move to PROC MIXED.  See the part of the documentation under the REPEATED statement for Kronecker products in the type= option.  With two times and two tasks, your code would look something like;

proc mixed data=yourdata;

class time task age_group subjid;

model response_variable=time|task|age_group;

repeated task age / type = UN@UN  subject=subjid;

lsmeans time|task|age_group/diff cl;

run;

Be sure that yourdata is in 'long' form, with one record having a unique combination of values of time, task, age_group and subjid for each observation of response_variable.

Steve Denham

Occasional Contributor
Posts: 14

Re: Factorial Repeated Measures ANOVA

Posted in reply to SteveDenham

Thanks so much for the help. That all makes sense.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 655 views
  • 0 likes
  • 2 in conversation