Introduction to Stata 8
Introduction to Stata 8
Introduction to Stata 8
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
13. Survival analysis and related issues<br />
st [ST] manual<br />
The st family of commands includes a number of facilities, described in the Survival<br />
Analysis manual [ST]. Here I describe the stset and stsplit commands and give a few<br />
examples. The data is cancer1.dta, a modification of the cancer.dta sample data<br />
accompanying <strong>Stata</strong>.<br />
The observation starts at randomization (agein), the data set includes these variables:<br />
. summvl // summvl is a summarize displaying variable labels.<br />
// Get it by: findit summvl<br />
Variable Obs Mean Std.Dev Min Max Label<br />
------------------------------------------------------------------------<br />
lbnr 48 24.5 14 1 48 Patient ID<br />
drug 48 1.875 .841099 1 3 Drug type (1=placebo)<br />
drug01 48 .583333 .498224 0 1 Drug: placebo or active<br />
agein 48 56.398 5.6763 47.0955 67.8746 Age at randomization<br />
ageout 48 57.6896 5.45418 49.0122 68.8737 Age at death or cens.<br />
risktime 48 1.29167 .854691 .083333 3.25 Years <strong>to</strong> death or cens.<br />
died 48 .645833 .483321 0 1 1 if patient died<br />
stset [ST] stset<br />
stset declares the data in memory <strong>to</strong> be survival time (st) data. I create two versions: In<br />
st.cancer1.dta time simply is risktime, age not taken in<strong>to</strong> consideration. In<br />
st.cancer2.dta time at risk is defined by age at entry (agein) and exit (ageout)<br />
enabling <strong>to</strong> study and control for the effect of age.<br />
Simple analysis – age not included<br />
stset data with risktime as the time-of-exit variable:<br />
. // c:\dokumenter\proj1\gen.st.cancer1.do<br />
. use c:\dokumenter\proj1\cancer1.dta , clear<br />
.<br />
stset risktime , failure(died==1) id(lbnr)<br />
id: lbnr<br />
failure event: died == 1<br />
obs. time interval: (risktime[_n-1], risktime]<br />
exit on or before: failure<br />
-------------------------------------------------------------------------<br />
48 <strong>to</strong>tal obs.<br />
0 exclusions<br />
-------------------------------------------------------------------------<br />
48 obs. remaining, representing<br />
48 subjects<br />
31 failures in single failure-per-subject data<br />
62 <strong>to</strong>tal analysis time at risk, at risk from t = 0<br />
earliest observed entry t = 0<br />
last observed exit t = 3.25<br />
34