Announcement

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

  • Comparing groups at timepoints after using MI and mixed

    Hello,
    I am currently looking at a scale (PDI) measured every third month over a year (baseline, 3-, 6-, 9- and 12 months followup).
    I have two groups where the first group received treatment between baseline and 3-month followup, and the second received treatment between 3-month followup and 6 month followup.
    The research question is whether there is a difference between the groups depending on when they were treated.

    The scale has both item-level missingness (only few) as well as subject-level missingness ( dropout, many). If one or more individual items are not measured, the total score cannot be directly calculated. I was asked to multiple impute the missings on item-level when they are item-level missing, and use linear mixed models to handle the subject wise missings.
    This I did, imputing all items missing in wide format, but only calculating the total score (using mi passive) in those cases where not all items were missing from the beginning.



    After this first step I transformed the data to long format, and did a mixed linear model. Here is my code, I have simplified and deleted the names of items so that it is easier to read.

    Code:
    mi set flong
    mi misstable summarize
    
    mi register imputed /*all missing variables*/
     
    
    mi impute chained (pmm, knn(5)) /*all missing items*/
     = /*nonmissing items and auxiliiary variables*/, add(20) rseed(30042019)
    
    mi passive: gen PDI_base=/*sum of variables*/ if PDI_base_m!=0
    mi passive: gen  PDI1= /*sum of variables*/ if PDI_md3_m!=0
    mi passive: gen  PDI2=/*sum of variables*/ if PDI_md6_m!=0
    mi passive: gen  PDI3=/*sum of variables*/ if PDI_md9_m!=0
    mi passive: gen PDI4= /*sum of variables*/ if PDI_md12_m!=0
    
    mi reshape long PDI, i(id) j(timepoint)
    
    /*Longitudinal on imputed datasets, PDI*/
    mi estimate: mixed PDI i.timepoint##i.Gruppe PDI_base||id:timepoint, covariance(unstructured) vce(robust)
    Output (of the regression only):
    PHP Code:
    Multiple-imputation estimates                   Imputations       =         20
    Mixed
    -effects regression                        Number of obs     =        228

    Group variable
    id                              Number of groups  =         76
                                                    Obs per group
    :
                                                                  
    min =          1
                                                                  avg 
    =        3.0
                                                                  max 
    =          4
                                                    Average RVI       
    =     0.0000
                                                    Largest FMI       
    =     0.0000
    DF adjustment
    :   Large sample                   DF:     min       =   1.11e+60
                                                            avg       
    =   6.89e+62
                                                            max       
    =          .
    Model F test:       Equal FMI                   F(   82.7e+64)  =       9.83
    Within VCE type
    :       Robust                   Prob F          =     0.0000

                                             
    (Within VCE adjusted for 76 clusters in id)
    ------------------------------------------------------------------------------------
                   
    PDI |      Coef.   StdErr.      t    P>|t|     [95ConfInterval]
    -------------------+----------------------------------------------------------------
             
    timepoint |
              
    6-month  |   .4600555   1.824221     0.25   0.801    -3.115351    4.035462
              9
    -month  |   .6995459   1.648965     0.42   0.671    -2.532367    3.931459
             12
    -month  |   -.683934   1.659344    -0.41   0.680    -3.936188     2.56832
                       
    |
                
    Gruppe |
             
    Gruppe B  |    10.6341   3.043612     3.49   0.000     4.668732    16.59947
                       
    |
      
    timepoint#Gruppe |
     
    6-month#Gruppe B  |  -7.730362   2.433259    -3.18   0.001    -12.49946   -2.961261
     
    9-month#Gruppe B  |  -6.499903    2.72415    -2.39   0.017    -11.83914   -1.160666
    12-month#Gruppe B  |  -3.960838    2.62529    -1.51   0.131    -9.106312    1.184636
                       
    |
              
    PDI_base |   .7692552   .1270858     6.05   0.000     .5201715    1.018339
                 _cons 
    |  -6.166558   4.649119    -1.33   0.185    -15.27866    2.945548
    ------------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
      
    Random-effects Parameters  |   Estimate   StdErr.     [95ConfInterval]
    -----------------------------+------------------------------------------------
    idUnstructured             |
                    
    sd(timepo~t) |   1.732742   .8726095      .6457561    4.649426
                       sd
    (_cons) |   11.30863   1.440699       8.80985    14.51616
            corr
    (timepo~t,_cons) |   .0651884   .4009863     -.6193758    .6934409
    -----------------------------+------------------------------------------------
                    
    sd(Residual) |   5.736988   .6589014      4.580598    7.185313
    ------------------------------------------------------------------------------ 
    1) Does this approach seem reasonable?
    2) How do I find out whether the total score in group A and B differ at timepoint 6, 9 and 12? I would use lincom in a normal setting, but MI doesn't support this. I have also considered margins, but am unsure how to interpret the output.

    Thanks a lot in advance.
    -Anna
    Last edited by Anna Mejldal; 05 Jun 2019, 04:06. Reason: simplified code
Working...
X