Hi all,
I have a question about conducting a 3-way ANOVA in stata with one repeated measures variable and two between subjects variables.
Set up is as follows:
- People are randomly assigned to one of two prime conditions (labelled 'SB' and 'PR')
- People in both groups complete two implicit association tasks labelled 'consistent' and 'inconsistent', one after the other (counterbalanced).
- My main outcome of interest is the difference between the two tasks - people are supposed to do worse (score lower) on the 'inconsistent' task. This difference is supposed to be greater for people in the PR prime condition.
The initial analysis is straightforward - a two-way mixed ANOVA will tell me whether there's a main effect of 'task' and whether there's an interaction between 'task' and 'prime'. I ran this in Stata using xtmixed after converting the data to long format (tasks nested within subjects):
xtmixed score task##prime || subject :
contrast task##prime
My problem arises when I need to account for a failure of randomisation. It happens that I have more people with degrees in one prime condition than the other, so I need to adjust for the effect of degree (binary). The way I'm doing it at the moment is just to do:
xtmixed score task##prime##degree || subject :
contrast task##prime##degree
Is this correct?
One further query - if instead of a binary variable (var) as the covariate, I have a continuous variable. Would the following be OK?
xtmixed score task##prime##c.var || subject :
contrast task##prime
Appreciate any light you guys could shed!
Cheers,
Rob
I have a question about conducting a 3-way ANOVA in stata with one repeated measures variable and two between subjects variables.
Set up is as follows:
- People are randomly assigned to one of two prime conditions (labelled 'SB' and 'PR')
- People in both groups complete two implicit association tasks labelled 'consistent' and 'inconsistent', one after the other (counterbalanced).
- My main outcome of interest is the difference between the two tasks - people are supposed to do worse (score lower) on the 'inconsistent' task. This difference is supposed to be greater for people in the PR prime condition.
The initial analysis is straightforward - a two-way mixed ANOVA will tell me whether there's a main effect of 'task' and whether there's an interaction between 'task' and 'prime'. I ran this in Stata using xtmixed after converting the data to long format (tasks nested within subjects):
xtmixed score task##prime || subject :
contrast task##prime
My problem arises when I need to account for a failure of randomisation. It happens that I have more people with degrees in one prime condition than the other, so I need to adjust for the effect of degree (binary). The way I'm doing it at the moment is just to do:
xtmixed score task##prime##degree || subject :
contrast task##prime##degree
Is this correct?
One further query - if instead of a binary variable (var) as the covariate, I have a continuous variable. Would the following be OK?
xtmixed score task##prime##c.var || subject :
contrast task##prime
Appreciate any light you guys could shed!
Cheers,
Rob
Comment