Announcement

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

  • Multiple Imputation and mi stset for Cox Regression

    Dear Stata List

    I have a good sized data set ( >6000 records) of health data. In this data set I am interested in hospital stay (LOS), of which there was missing values for. Like with all larger data sets of this type there was missing data, which I used a MICE with PMM for, code for this:

    mi set mlong

    mi register imputed LOS TBRange Depth RA SES Cause

    mi impute chained (pmm, knn(5)) LOS TBRange Depth RA SES Cause = Gender AgeRange, add(10)

    mi xeq 0 1 10: summarize LOS
    mi xeq 0 1 10: summarize TBRange
    mi xeq 0 1 10: summarize Depth
    mi xeq 0 1 10: summarize RA
    mi xeq 0 1 10: summarize SES
    mi xeq 0 1 10: summarize Cause

    This has run beautifully, and filled in the missing data within the required ranges. Now what I would like to do is look at factors which may be associated with a longer hospital stay (LOS). For this I was going to undertake a stepped cox regression. In this model LOS is my time and there is no fail as everyone fails as they are discharged from hospital. The code I have used for this is:

    mi stset LOS

    This gives me the following error: variable LOSm registered as imputed Imputed and passive variables may not be used as the basis for mi stset. r(459);

    If I extract one of the imputed sets i.e mi extract 10. I can stset the LOS for this data set and run my survival model. I have had it suggested that there may be another variable interfering, so I have been through my data set and culled anything not used in the survival model, but this has not resolved this error either. So my questions:

    Is Stata unable to use imputed variables for stset?
    Is there a straight forward way around this?

    My next option is to write a do file to loop through and extract, stset and do the cox regression for each imputation, but I don’t like the thought of having to bring it all back together in a coherent fashion after the many imputations. While I have only run the MICE over 10, I do have the intention of running this 40 times. I would values and thoughts or feedback on options.


    Kind regards
    Courtney

  • #2
    Courtney:
    you may want to see: https://www.stata.com/bookstore/surv...-introduction/, pages 172-178.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Hi Carlo

      Thank you for that, I have this text it is a great book!

      Kind regards
      Courtney

      Comment


      • #4
        Hi Courtney,

        I am having this exact same issue. I used MICE with pmm to multiply impute the time duration variable I am using for a survival analysis. After imputing the time variable I get the exact same error that you got when trying to stset my data.

        I am wondering if you found a solution to this other than running a loop over each set of imputed values? I think that is a possible solution in my case but share your aversion to pooling regression results myself after extracting each set of imputed data and conducting separate regressions. Was there something in the Intro to Survival Analysis text that might be helpful?

        Take care,
        John

        Comment

        Working...
        X