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
Related Posts with Multiple Imputation and mi stset for Cox Regression
OLS with important omitted variable due to collinearityHi Stata Forum, I need theoretical and coding help. (I am a beginner in data analysis, so if some t…
subsample comparison analysisHi all, I am currently using the following code to compare the statistical difference for the coeffi…
Create a scatterplot using dummy variablesHi. I would like to create a scatterplot using two dummy variables, however, as you may guess, simpl…
getdata command EUROSTATDear all, Do someone have experience with the command getdata? My wish is to import data from EUROS…
logistic reg vs Hypothesis testHi All I looked on a post written way back in 2014 and someone was asking about a hyp. test they we…
Subscribe to:
Post Comments (Atom)
0 Response to Multiple Imputation and mi stset for Cox Regression
Post a Comment