Hello,
I have been running some Cox regressions with stcox, and have realised that two commands for plotting the covariate-adjusted survival curve—namely, stcurve and survci—are giving very different results. Specifically, stcurve is outputting slower time to events.
I couldn't see anything in the documentation of either command that explains why they might estimate the survival curve differently. In particular, they both say that they estimate the covariate-adjusted curve using the means of covariates, which is supported by the output text when running the commands.
Can anyone provide some insight? I would like to estimate median survival times using one of these functions, but am not longer sure which one is best.
Below is an example using a Stata dataset, for which I have attached the two curves. You can clearly see that the median time is completely different (as is confirmed by looking at the outfiles).
Graph from stcurve

Graph from survci
I have been running some Cox regressions with stcox, and have realised that two commands for plotting the covariate-adjusted survival curve—namely, stcurve and survci—are giving very different results. Specifically, stcurve is outputting slower time to events.
I couldn't see anything in the documentation of either command that explains why they might estimate the survival curve differently. In particular, they both say that they estimate the covariate-adjusted curve using the means of covariates, which is supported by the output text when running the commands.
Can anyone provide some insight? I would like to estimate median survival times using one of these functions, but am not longer sure which one is best.
Below is an example using a Stata dataset, for which I have attached the two curves. You can clearly see that the median time is completely different (as is confirmed by looking at the outfiles).
Code:
. use https://www.stata-press.com/data/r18/drugtr (Patient survival in drug trial) . stset studytime, failure(died) Survival-time data settings Failure event: died!=0 & died<. Observed time interval: (0, studytime] Exit on or before: failure -------------------------------------------------------------------------- 48 total observations 0 exclusions -------------------------------------------------------------------------- 48 observations remaining, representing 31 failures in single-record/single-failure data 744 total analysis time at risk and under observation At risk from t = 0 Earliest observed entry t = 0 Last observed exit t = 39 . stcox drug age Failure _d: died Analysis time _t: studytime Iteration 0: Log likelihood = -99.911448 Iteration 1: Log likelihood = -83.551879 Iteration 2: Log likelihood = -83.324009 Iteration 3: Log likelihood = -83.323546 Refining estimates: Iteration 0: Log likelihood = -83.323546 Cox regression with Breslow method for ties No. of subjects = 48 Number of obs = 48 No. of failures = 31 Time at risk = 744 LR chi2(2) = 33.18 Log likelihood = -83.323546 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ _t | Haz. ratio Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- drug | .1048772 .0477017 -4.96 0.000 .0430057 .2557622 age | 1.120325 .0417711 3.05 0.002 1.041375 1.20526 ------------------------------------------------------------------------------ . stcurve, survival outfile(test_drug) note: function evaluated at overall means of covariates. . survci, outfile(test_drug_survci) (drug=0.00; age=55.88)
Graph from survci
Comment