Announcement

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

  • Repeated measures analysis - anova or mixed

    Hi,

    My data has 3 treatment groups each with results at 3 time points (baseline & 2 equally spaced follow-ups). I want to assess the effects of treatment group and time on the outcome. I use dataex to provide an example of my data structure below.

    I have tried a few ways of doing this & would appreciate any advice on which is better/any preferences. Initially, to get a sense of the data, I tried simple t-tests comparing the results at each timepoint between treatment groups (2 at a time), and using paired tests to compare each visit to baseline by treatment group.

    I would now like to use either a repeated measures anova or a mixed model to evaluate the effects. I use the following commands:

    Code:
    // ANOVA
    anova result group / id|group interval group#interval, repeated(interval)
    contrast interval@group, effect mcompare(bonferroni)
    anova result group##interval
    contrast group@interval, effect mcompare(bonferroni)
    Code:
    // MIXED
    mixed result group##interval || id:, var reml
    contrast group##interval
    contrast interval@group, effect mcompare(bonferroni)
    contrast group@interval, effect mcompare(bonferroni)
    Do these codes seem appropriate? & is there a preference (statistical or other) over which to use?

    Thank you for any help, Megan.



    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long(group id) float interval double result
    3  1 1   3.4
    3  1 2 1.425
    3  1 3  2.55
    2  2 1   4.3
    2  2 2 2.325
    2  2 3 1.875
    3  3 1  9.45
    3  3 2   7.4
    3  3 3 6.975
    3  4 1 5.925
    3  4 2  4.15
    3  4 3  4.25
    2  5 1  4.45
    2  5 2 2.525
    2  5 3 7.575
    2  6 1 4.175
    2  6 2   6.4
    2  6 3 6.825
    1  7 1 6.125
    1  7 2 7.075
    1  7 3   5.1
    3  8 1 4.975
    3  8 2 2.675
    3  8 3 2.625
    1  9 1   3.7
    1  9 2   7.1
    1  9 3 7.875
    2 10 1 6.675
    2 10 2  6.25
    2 10 3   5.2
    1 11 1   3.2
    1 11 2 4.125
    1 11 3 4.075
    2 12 1 5.025
    2 12 2  3.05
    2 12 3 6.325
    1 13 1   1.9
    1 13 2  4.25
    1 13 3 5.475
    1 14 1   5.2
    1 14 2 4.025
    1 14 3 7.625
    3 15 1 4.775
    3 15 2   4.9
    3 15 3  4.45
    1 16 1 2.325
    1 16 2     5
    1 16 3 6.175
    1 17 1  5.05
    end
    label values group group
    label values id id

  • #2
    Welcome to the Stata Forum / Statalist,

    Thanks for having used - dataex - as well as for having clearly stated your query.

    In such a study design, I tend to use - mixed - instead of ANOVA.

    That said, if you type - margins interval#group - followed by - marginsplot - you may probably understand what is happening.

    P.S: please keep in mind that we have to use factor notation with - mixed - before apply the above-mentioned - margins - command.
    Best regards,

    Marcos

    Comment

    Working...
    X