Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Plotting survival curves after multiple imputation

From   Robert Long <>
To   "''" <>
Subject   st: RE: Plotting survival curves after multiple imputation
Date   Wed, 20 Feb 2013 09:46:45 +0000

I have attempted to solve this using the following code, which is reproducible, but relies on the -ice- and -mim- commands

webuse drugtr, clear

* create some missing value
foreach i in 5 10 15 20 25 30 35 40 45 {
	replace age = . in `i'

mi set wide
mi register impute age

ice age studytime died drug, m(5) saving(drugtr_imp, replace)

use drugtr_imp.dta, clear

* no problem obtaining pooled estimates, and here I use the storebv option
* in an attempt to give -stcurve- what it needs
mim , storebv: stcox  age drug

* but it doesn't work:
stcurve, survival at1(drug=0) at2(drug=1)

The error is
last estimates not found

This error seems to be produced in -stcurve- which is looking for e(cmd2) to be set to "stcox", but e(cmd2) is not set at all - e(cmd) is set to "stcox". However, running stcox normally (ie without -mim- ) , e(cmd2) /is/ set to "stcox"..

Can anyone help ?

Robert Long

-----Original Message-----
From: [] On Behalf Of Robert Long
Sent: 15 February 2013 11:55
To: ''
Subject: st: Plotting survival curves after multiple imputation

Hello Statalist

This sounds like something very simple, or at least it should be something that is commonly required, but so far I haven't found an answer.

I want to use multiple imputation for missing covariate data. No problems with that.

Having obtained m different datasets, I want to run cox regressions, obtaining pooled results. No problems with that.

But I also want to plot a "pooled" survival curve for different levels of a covariate.

How do I obtain such plots ?

Robert Long

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index