Announcement

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

  • Running linear mixed model on timepoints 0 to week 24. Is there a way to find the average between week 0 to 12 and week 12 to 24?

    Hi all,

    My variable is in repeated measures from baseline to week 24, so I chose a linear mixed model.
    However, my peers are requesting to find the average change between baseline to week 12, and week 12 to week 24 separately.
    Do I need to split up the data or is there a way to extract the estimates after running the linear mixed model?

  • #2
    You do not show your code for the mixed model, and the solution requires that it have been properly done with factor-variable notation. But on the assumption that your -mixed- command looked like this:
    Code:
    mixed outcome_variable i.week perhaps_other_variables || id_variable:
    I also don't know what the week number for baseline was. I'll assume here it was 1. Then you can do:
    [code]
    margins, at(week = (1 12)) pwcompare
    margins, at(week = (12 24)) pwcompare
    [/code

    Comment


    • #3
      Hi Clyde Schechter ,

      Apologies for not pasting the code:
      Code:
      mixed bodywt i.t i.Intervention bodywt_baseline, || SubjectID:, covariance(identity) vce(robust) stddeviations
      My data is in long format given that it is in repeated measures.
      't' stands for timepoints of 1 to 6 (week 3,6,9,12,18,24) while t0 is the baseline.
      This code adjusted for baseline of bodyweight measure.
      We wanted to see the change between the intervention group vs the controls.
      Hence, it was requested besides this main code, we could try extracting the average change per group at 2 time blocks: baseline to week 12 and also week 12 to week 24.
      Would that be possible?

      Comment


      • #4
        Well, your model is probably not appropriate to the question you are asking. It is structured so that the change from week i to week j will be the same in both groups, no matter what i and j are. To get a meaningful contrast between the groups on the amount of change at given time periods you need an interaction between t and Intervention.

        Code:
        mixed bodywt i.t##i.Intervention bodywt_baseline || SubjectID:, covariance(identity) vce(robust) stddeviations
        margins Intervention, at(t = (0 4)) pwcompare(effects)
        margins Intervention, at(t = (4 6)) pwcompare(effects)
        Note: the -margins, pwcompare- output will include a number of comparisons that you aren't asking for, as it will contrast all combinations of Intervention and t. Just ignore them and focus on the ones that you asked about.

        Comment


        • #5
          Thank you Clyde Schechter ! Being curious, what type of model will be suitable for such cases?
          Also, would this be another option whereby I were to split my data up into baseline to week 12, and week 12 to week 24 and run the mixed model separately without adjusting for baseline variable?

          Comment


          • #6
            what type of model will be suitable for such cases?
            Well, the key thing is that you need the treatment X time interaction. The -mixed- command I showed in #4 is one way to do it, though probably not the way I would do it.

            In general, I do not like including the baseline value as a covariate. I usually prefer to just have the baseline as one of the observations in the data set, so that the baseline body weight is just one value in each person's data for the body weight variable, not a separate variable. Now, if the baseline body weight was obtained in a different way from the subsequent ones, then having it as a separate variable is preferable. That might arise, for example, if the baseline body weight was self reported or taken from pre-existing records, but the subsequent weights were made on a standard scale under standard conditions during the study follow-up period. But if the baseline body weight was ascertained the same way as the others, I prefer not to make it a separate variable. The reason for that is that when there's just one body weight variable, the coefficients of the interaction terms in the regression output are the estimates of the treatment effects at each time. By contrast, when you include the baseline value as a covariate, the coefficients get shrunk by a factor equal to the intraclass correlation of the outcome variable and are not a direct estimate of treatment effects.

            would this be another option whereby I were to split my data up into baseline to week 12, and week 12 to week 24 and run the mixed model separately without adjusting for baseline variable?
            Well, as per the preceding paragraph, if the baseline weight was obtained using the same methodology as the subsequent weights, I would not include the baseline weight as a covariate. But I also would not split the data at 12 weeks. I would use all of the data from baseline through end of study, and then do the comparisons post hoc along the lines I showed in #4. Splitting the data is not really a good idea: you are cutting the sample size roughly in half, and you are losing -mixed-'s ability to let the data at one time period influence the estimates for coefficients at other time periods. This is sometimes called "borrowing from strength" and is one reason that these mixed effects models are less prone to providing exaggerated results. If you split the data, you reduce that benefit.

            Comment


            • #7
              Thank you Clyde Schechter for the advice! I tried the approach of including the baseline as one of the observations followed by reshaping and running the model (this way):
              Code:
               
               mixed bodywt i.t##i.Intervention || SubjectID:, covariance(identity) vce(robust) stddeviations
              Managed to extract out the estimates at timepoint(0 12) and timepoint(12 24) successfully.

              Comment

              Working...
              X