Announcement

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

  • Linear Mixed Models with repeated measures design; postestimation/contrasts issues in RCT design

    For our cluster randomized controlled trial we face the issue in STATA of reporting the means and contrasts between treatment groups.
    We are analyzing 3 treatment groups at 2 timepoints (0/1).

    Because of the random effects of Cluster we opted to change from SPSS to STATA.

    This is the original SPSS syntax (without cluster-> not important);
    MIXED
    SPPB BY Random_Group time
    /CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1) SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE)
    PCONVERGE(0.000001, ABSOLUTE)
    /FIXED = time Random_Group*time | SSTYPE(3)
    /METHOD = ML
    /PRINT = SOLUTION LMATRIX
    /RANDOM INTERCEPT | SUBJECT(patid) COVTYPE(VC)
    /EMMEANS= TABLES( Random_Group*time) compare(time)
    /TEST 'change EX2 vs change control' Random_Group*time 1 -1 0 0 -1 1
    /TEST 'change EX1 vs change control' Random_Group*time 1 -1 -1 1 0 0
    /TEST 'change EX2 vs change EX1' Random_Group*time 0 0 1 -1 -1 1
    /SAVE RESID.


    As we do have a repeated measures design and have time and 3 treatment groups the syntax for STATA (time and treatment dummy*time interaction, we erased treatment as fixed effect as the effect size is not overestimated this way):
    mixed SPPB time int_trt2_time int_trt3_time || Cluster: || patid:

    We get lost in the margins function as we want to report treatment marinal means / contrasts (for trt1 trt2 trt3) and these are no fixed effects in the equation.
    As the estimated marginal means and contrast are possible in SPSS without treatment in the equation, we would like some help. The manuals do not deliver the solution.
    Ofcourse, the treatment effects can easily be obtained from the interaction beta and CI.

    -> Next step; Can anyone help us with the means / contrasts and leave us with suggestions for our syntax?


  • #2
    I wonder whether the data is really in long format, as it should, before proceeding with - mixed - command.

    By reshaping the data to the long format, the command will change a little, and - margins "with the treatment" variable will work according to what you can find in the Stata Manual.
    Best regards,

    Marcos

    Comment


    • #3
      Hi Marcos, thank you for your suggestion.
      Unfortunately we work already with the long file, so every person has two timepoints for every outcome.

      We decided to change the regular time treatment time*treatment method according to the paper of Twisk presented last year. https://doi.org/10.1016/j.conctc.2018.03.008
      In this new style Repeated Measures Mixed Models, treatment is not part of the function, only the intercepts.
      The original new syntax has only the intercepts;
      mixed SPPB time int_trt2_time int_trt3_time || Cluster: || patid:

      Afterwards I tried to add the categorical variable treatment#time;
      mixed SPPB i.time i.treatment#time || Cluster: || patid:

      Than margin with its contrasts and comparison is possible, but results in a slightly different model.

      Hopefully my question is better specified and maybe some people can make suggestions? How to adjust for only time and intercept models and what is needed for appropriate margins execution in this specific case?

      Kind regards,
      Johanna

      Comment


      • #4
        I think the best approach is following the FAQ advice and sharing data (it can be a toy example) to work on.

        That being said, in the second command, I fail to understand why not adding the "main effect" of treatment, instead of only the interaction of time and treatment plus time.

        I hope you will get further help with the so called "original new sintax", still arcane to me.
        Best regards,

        Marcos

        Comment

        Working...
        X