Hi,
After requesting Stata to predict cox-snell residuals of a data set with multiple-record-per-subject (a.k.a. "mutiple id", where each subject--subnational states--in the study has more than one observation; time is measured in years; hence, the unit of analysis is state-year; my covariates are time dependent) and then stsetting (in order to declare the data as survival data) on the Cox-Snell Residuals in order to plot these against the cumulative hazard function, does the option "id(varname)" have to be specified?
All examples that I have found on the web deal with single-record-per-subject data. In this case, the instructions are clear:
. stset year, failure(adoption==1) id(state)
. stcox varlist, cluster(state)
. predict cs, csnell partial
. stset cs, failure(adoption==1)
. sts generate km = s
. generate H = -ln(km)
. line H cs cs, sort ytitle("") clstyle(. refline)
In my case, do I have to add:
. partial
. id(state)
To the 2nd & 4th lines from above (in red), respectively?
Someone faced a similar situation in the past, but no solution was found back then. (see link)
Thanks a lot in advance for your support!
After requesting Stata to predict cox-snell residuals of a data set with multiple-record-per-subject (a.k.a. "mutiple id", where each subject--subnational states--in the study has more than one observation; time is measured in years; hence, the unit of analysis is state-year; my covariates are time dependent) and then stsetting (in order to declare the data as survival data) on the Cox-Snell Residuals in order to plot these against the cumulative hazard function, does the option "id(varname)" have to be specified?
All examples that I have found on the web deal with single-record-per-subject data. In this case, the instructions are clear:
. stset year, failure(adoption==1) id(state)
. stcox varlist, cluster(state)
. predict cs, csnell partial
. stset cs, failure(adoption==1)
. sts generate km = s
. generate H = -ln(km)
. line H cs cs, sort ytitle("") clstyle(. refline)
In my case, do I have to add:
. partial
. id(state)
To the 2nd & 4th lines from above (in red), respectively?
Someone faced a similar situation in the past, but no solution was found back then. (see link)
Thanks a lot in advance for your support!
Comment