Dear Listers,
I am running survival analysis using flexible parametric models in -stpm2-.
I have missing data in one of my covariates. As part of my sensitivity analyses, I am imputing this missing information using multiple imputation. I would like to produce survival plots based on my imputed results and I have found examples online showing this could be achieved using -mi predictnl- just after sptm2. However, this is not straightforward once I run it in on my data so I thought I tried on the original sample data (melanoma.dta).
I use the following code:
replace stage = . if stage==0
mi set flong
mi register regular subsite agegrp sex
mi register imputed stage
mi impute chained (mlogit) stage = i.subsite sex i.agegrp , add(10)
mi stset surv_mm, fail(status==1 2) id(id) scale(12)
mi stset surv_mm, failure(status=1,2) scale(12) id(id) exit(time 120.5)
mi estimate, dots cmdok sav(mi_stpm2,replace): ///
stpm2 ib1.stage i.agegrp, df(5) bhaz(rate) scale(hazard) nolog eform
mi predictnl survimp2 = predict(survival at(agegrp 2)) using mi_stpm2
On this sample data and my data, I get the following error message:
variable _rcs1 not found
xb(xb) invalid
predict(survival at(agegrp 2)) invalid
_rcs1 is part of the survival analysis output so I am not sure what could be going wrong. I tried updating my stato ado files (update all) but this has not resolved the issue. Any suggestion would be greatly appreciated.
I am running survival analysis using flexible parametric models in -stpm2-.
I have missing data in one of my covariates. As part of my sensitivity analyses, I am imputing this missing information using multiple imputation. I would like to produce survival plots based on my imputed results and I have found examples online showing this could be achieved using -mi predictnl- just after sptm2. However, this is not straightforward once I run it in on my data so I thought I tried on the original sample data (melanoma.dta).
I use the following code:
replace stage = . if stage==0
mi set flong
mi register regular subsite agegrp sex
mi register imputed stage
mi impute chained (mlogit) stage = i.subsite sex i.agegrp , add(10)
mi stset surv_mm, fail(status==1 2) id(id) scale(12)
mi stset surv_mm, failure(status=1,2) scale(12) id(id) exit(time 120.5)
mi estimate, dots cmdok sav(mi_stpm2,replace): ///
stpm2 ib1.stage i.agegrp, df(5) bhaz(rate) scale(hazard) nolog eform
mi predictnl survimp2 = predict(survival at(agegrp 2)) using mi_stpm2
On this sample data and my data, I get the following error message:
variable _rcs1 not found
xb(xb) invalid
predict(survival at(agegrp 2)) invalid
_rcs1 is part of the survival analysis output so I am not sure what could be going wrong. I tried updating my stato ado files (update all) but this has not resolved the issue. Any suggestion would be greatly appreciated.
Comment