Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 3 way ANOVA equivalent using xtmixed

    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

  • #2
    "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)." I don't understand this. What's a "degree"? Does it mean that you neglected to cross them over to the other within-participant condition?

    You mention that the task conditions are "counterbalanced"'; nevertheless, for such a cross-over study, you should also have factors (indicator variables) for sequence (say, sequence = 0 if the participant was assigned to consistent first and inconsistent second, and sequence = 1 if inconsistent first and consistent second) and period (first and second). You can then form interaction terms in order to help assess the magnitude of carry-over ("learning effects") as affected by, for example, pretreatment ("prime condition"). See the help file and user's manual entry for pkcross.

    Comment


    • #3
      Thanks Joseph, sorry - I should have been clearer. By 'degree', I meant 'college degree'. I.e. I have more college educated people in one prime condition than in the other. Leaving aside your comment about including a factor for task order (though thanks for that), is my procedure otherwise correct for adjusting for the effect of degree?

      Comment

      Working...
      X