Announcement

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

  • Repeated measure ANOVA

    I have a 3x2x2 repeated measure model and would like to run repeated measure ANOVA with Stata. I found the effect of the model through nesting A (electrodes: 3 levels) within B (hemi: 2 levels) within C (trial: 2 levels) (all repeated factors) and entered the condition (2 levels) as a between factor in general linear model in SPSS. I took a screen shot of what my model would look like. I would like to replicate the same model with Stata, but I keep receiving an error message. This is the code I used and the error message I got.

    Can someone please help me to get this code right? I wouldl ike to see the main effect and the interaction effect of within subjects design, which is trial, hemi, electrodes, trial*hemi, trial*electrode, hemi*electrode, trial*hemi*electrodes.

    . anova alpha electrodes| hemi| trial, repeated(electrodes hemi trial) bse(condition)
    term not in model
    r(147)

  • #2
    The error message is telling you that in order to use the variable condition as the between-subjects error term, the variable must be included in the ANOVA model, and you haven't done that.

    It's not clear why electrodes would be considered nested and not crossed with the other factors. Regardless, your repeated measures ANOVA model is missing the unit of analysis, which I presume is study participant.

    I recommend to use mixed to fit this model. The syntax would be something along the lines of (using pid for participant ID)
    Code:
    mixed alpha i.condition##i.electrodes##i.hemisphere##i.trial ||  pid: , reml dfmethod(kroger) nolrtest nolog
    If you're desperate to match SPSS's p-values, then you can use Stata's contrast command to get ANOVA contrasts after fitting the model with mixed.

    Comment

    Working...
    X