Announcement

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

  • Mixed Models - considering time in the interaction term (timepoint##intervention) as continuous or dummy

    Dear Statlisters,

    I am analysing the data from an medical intervention in a pilot study with 29 individuals, randomized to either the intervention or a placebo. The outcome is a continuous variable, measured at 10 fixed timepoints (week 0, 1, 2,... after the intervention.

    I am fitting a linear mixed model. My question is about how to consider the variable week in the interaction term.

    As can be seen below, the number of repeated measurements generates a high number of estimates in the model when week is considered as a dummy variable and I am afraid that this approach may result in overfitting.

    I will greatly appreciate your comments!
    Thanks,

    Sergio


    xtmixed outcome c.week##arm || idnum:, covariance(independent) vce(robust)


    Mixed-effects regression Number of obs = 361
    Group variable: idnum Number of groups = 29

    Obs per group:
    min = 11
    avg = 12.4
    max = 13

    Wald chi2(3) = 15.07
    Log pseudolikelihood = -3014.5848 Prob > chi2 = 0.0018

    (Std. Err. adjusted for 29 clusters in idnum)
    ------------------------------------------------------------------------------
    | Robust
    value_silva | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    week | -9.9303 4.179773 -2.38 0.018 -18.1225 -1.738095
    |
    arm |
    Active | 502.3695 679.1563 0.74 0.459 -828.7524 1833.492
    |
    arm#c.week |
    Active | 11.94946 6.549304 1.82 0.068 -.886942 24.78586
    |
    _cons | 1201.08 484.666 2.48 0.013 251.1525 2151.008
    ------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    | Robust
    Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
    -----------------------------+------------------------------------------------
    idnum: Identity |
    sd(_cons) | 1707.455 225.7852 1317.622 2212.625
    -----------------------------+------------------------------------------------
    sd(Residual) | 876.6354 156.7543 617.4654 1244.587
    ------------------------------------------------------------------------------




    xtmixed outcome i.week##arm || idnum:, covariance(independent) vce(robust)

    Mixed-effects regression Number of obs = 361
    Group variable: idnum Number of groups = 29

    Obs per group:
    min = 11
    avg = 12.4
    max = 13

    Wald chi2(25) = 124.89
    Log pseudolikelihood = -3004.45 Prob > chi2 = 0.0000

    (Std. Err. adjusted for 29 clusters in idnum)
    ------------------------------------------------------------------------------
    | Robust
    value_silva | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    week |
    1 | -204.7705 125.2085 -1.64 0.102 -450.1747 40.63374
    2 | -21.77049 156.2981 -0.14 0.889 -328.1091 284.5681
    3 | -85.19371 122.2238 -0.70 0.486 -324.748 154.3606
    4 | -119.5825 163.8736 -0.73 0.466 -440.7688 201.6039
    5 | -1.628696 111.2908 -0.01 0.988 -219.7547 216.4973
    6 | -60.57049 116.7885 -0.52 0.604 -289.4718 168.3308
    7 | 332.8962 185.9883 1.79 0.073 -31.63423 697.4266
    8 | 165.4295 202.5864 0.82 0.414 -231.6326 562.4916
    12 | -228.4372 269.5621 -0.85 0.397 -756.7692 299.8949
    24 | -262.621 358.5675 -0.73 0.464 -965.4004 440.1585
    36 | -240.7705 94.83199 -2.54 0.011 -426.6378 -54.90321
    48 | -545.0372 248.9063 -2.19 0.029 -1032.885 -57.1897
    |
    arm |
    Active | 1117.039 850.5723 1.31 0.189 -550.0517 2784.13
    |
    week#arm |
    1#Active | -768.0441 421.7324 -1.82 0.069 -1594.624 58.53621
    2#Active | -942.6155 425.8868 -2.21 0.027 -1777.338 -107.8927
    3#Active | -568.9066 329.6387 -1.73 0.084 -1214.987 77.17337
    4#Active | -414.9682 329.9024 -1.26 0.208 -1061.565 231.6286
    5#Active | -711.9809 382.4246 -1.86 0.063 -1461.519 37.55749
    6#Active | -416.387 413.0244 -1.01 0.313 -1225.9 393.1259
    7#Active | -796.9311 462.9949 -1.72 0.085 -1704.384 110.5223
    8#Active | -705.8155 409.7805 -1.72 0.085 -1508.971 97.33948
    12#Active | -374.8987 393.1176 -0.95 0.340 -1145.395 395.5977
    24#Active | 16.37778 613.205 0.03 0.979 -1185.482 1218.238
    36#Active | -298.3298 311.3191 -0.96 0.338 -908.5041 311.8445
    48#Active | -80.51099 514.2789 -0.16 0.876 -1088.479 927.4572
    |
    _cons | 1177.704 495.5321 2.38 0.017 206.4788 2148.929
    ------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    | Robust
    Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
    -----------------------------+------------------------------------------------
    idnum: Identity |
    sd(_cons) | 1707.3 226.2045 1316.837 2213.542
    -----------------------------+------------------------------------------------
    sd(Residual) | 850.3314 144.6721 609.2115 1186.884
    ------------------------------------------------------------------------------

    . testparm week##arm //P=0.0000






  • #2
    Sergio:
    as per Example #1 under -mixed- (-xtmixed- refers to older Stata releases), I would consider -week- as continuous.
    Moreover, instead of investigating interactions between -week- and study -arm- (that, as far as I can see, do not support presence of evidence) you could search for turning points via -c.week##c.week-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Sergio:
      as per Example #1 under -mixed- (-xtmixed- refers to older Stata releases), I would consider -week- as continuous.
      Moreover, instead of investigating interactions between -week- and study -arm- (that, as far as I can see, do not support presence of evidence) you could search for turning points via -c.week##c.week-.
      Thank you Carlo!
      Could you please ellaborate a little bit more about that? Do you mean that the interaction term c.week##c.week should allow to identify whether there are critical changes in the mean trajectories?

      mixed unifrac_u c.week##c.week if arm==1|| idnum:, covariance(independent) vce(robust)
      Note: single-variable random-effects specification in idnum equation; covariance structure set to identity

      Performing EM optimization:

      Performing gradient-based optimization:

      Iteration 0: log pseudolikelihood = 434.27929
      Iteration 1: log pseudolikelihood = 434.27929

      Computing standard errors:

      Mixed-effects regression Number of obs = 175
      Group variable: idnum Number of groups = 14

      Obs per group:
      min = 11
      avg = 12.5
      max = 13

      Wald chi2(2) = 5.00
      Log pseudolikelihood = 434.27929 Prob > chi2 = 0.0819

      (Std. Err. adjusted for 14 clusters in idnum)
      -------------------------------------------------------------------------------
      | Robust
      unifrac_u | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      week | -.0002654 .0004735 -0.56 0.575 -.0011933 .0006626
      |
      c.week#c.week | .0000107 .0000101 1.06 0.289 -9.07e-06 .0000304
      |
      _cons | .3805915 .0058206 65.39 0.000 .3691833 .3919998
      -------------------------------------------------------------------------------

      ------------------------------------------------------------------------------
      | Robust
      Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
      -----------------------------+------------------------------------------------
      idnum: Identity |
      sd(_cons) | .0170806 .0032752 .0117297 .0248725
      -----------------------------+------------------------------------------------
      sd(Residual) | .0183264 .0025464 .0139574 .024063
      ------------------------------------------------------------------------------

      Comment


      • #4
        Sergio:
        not quite.
        The goal was to investigate if there were maximum/minimum points (which express a non-linear relationship between -week- and the regressand).
        As far as I can see, this is not the case with your data.
        That said, I would try something simpler and see what the results look like:
        Code:
        mixed outcome c.week i.arm || idnum:, covariance(independent) vce(robust)
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Sergio:
          not quite.
          The goal was to investigate if there were maximum/minimum points (which express a non-linear relationship between -week- and the regressand).
          As far as I can see, this is not the case with your data.
          That said, I would try something simpler and see what the results look like:
          Code:
          mixed outcome c.week i.arm || idnum:, covariance(independent) vce(robust)
          Thank you Carlo!

          Comment

          Working...
          X