I am currently using version 15.1 of STATA.
I have some straightforward survival time data, (time in years, censor (1=failed, 0=censored) , group of interest). example as follows:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double pfsyrs byte pfscensor str17 first_deftx_type 4.802739726027397 1 "RT" 3.147945205479452 0 "Surgery" 0 0 "RT" 1.704109589041096 0 "RT" 4.5698630136986305 0 "RT" 3.734246575342466 0 "Surgery" 3.2246575342465755 0 "Surgery" 7.043835616438356 0 "Surgery" 4.816438356164384 0 "Surgery" 1.189041095890411 0 "Surgery" .6958904109589041 0 "Surgery" -.273972602739726 0 "RT" .15616438356164383 0 "RT" 2.1890410958904107 0 "RT" .11232876712328767 1 "Surgery" .4986301369863014 1 "RT" -.052054794520547946 0 "RT" 11.734246575342466 0 "RT" 0 1 "Surgery" 11.542465753424658 0 "RT" 12.126027397260273 0 "RT" 4.594520547945206 0 "RT" 1.6383561643835616 0 "RT" .3863013698630137 1 "Surgery" 0 1 "RT" .8493150684931506 1 "RT" 1.6821917808219178 1 "RT" 7.682191780821918 0 "RT" .8712328767123287 0 "RT" 1.4712328767123288 0 "Surgery" 1.515068493150685 0 "Surgery" 1.1863013698630136 0 "Surgery" 4.183561643835616 1 "RT" 10.35068493150685 0 "RT" 2.6082191780821917 1 "RT" .6520547945205479 0 "Surgery" 3.4547945205479453 0 "RT" .1178082191780822 1 "Surgery" .8246575342465754 1 "Surgery" 3.0027397260273974 0 "Surgery" .7068493150684931 0 "Surgery" 2.802739726027397 0 "Surgery" 4.561643835616438 1 "RT" 8.24931506849315 0 "RT" -.4 0 "RT" .23835616438356164 0 "RT" -.03287671232876712 0 "RT" 2.8054794520547945 0 "RT" 1.5068493150684932 0 "RT" 5.175342465753425 0 "Surgery" 1.9205479452054794 0 "Surgery" end
Code:
. stset pfsyrs, failure(pfscensor) scale(1) failure event: pfscensor != 0 & pfscensor < . obs. time interval: (0, pfsyrs] exit on or before: failure ------------------------------------------------------------------------------ 4,929 total observations 568 observations end on or before enter() ------------------------------------------------------------------------------ 4,361 observations remaining, representing 1,012 failures in single-record/single-failure data 15,887.025 total analysis time at risk and under observation at risk from t = 0 earliest observed entry t = 0 last observed exit t = 89.83836 . sts list, by(first_deftx_type) failure at(5 10) failure _d: pfscensor analysis time _t: pfsyrs Beg. Failure Std. Time Total Fail Function Error [95% Conf. Int.] ------------------------------------------------------------------------------- RT 5 442 51 0.0686 0.0097 0.0520 0.0903 10 147 28 0.1511 0.0180 0.1194 0.1902 Surgery 5 800 95 0.0577 0.0061 0.0468 0.0711 10 235 45 0.1550 0.0155 0.1272 0.1883 ------------------------------------------------------------------------------- Note: Failure function is calculated over full data and evaluated at indicated times; it is not calculated from aggregates shown at left.
However, what I would like to do is actually just save the value of the 5-year failure function for any particular group (in this case, for the "RT" group it is equal to 0.0686) as a local scalar so that I can use this discrete value in a program. Does anyone know how to save a failure function value from a discrete specified time (like 5 years) for a KM estimate in a local scalar?
Many Thanks,
Jonathan Tward
0 Response to How to save a Kaplan-Meier survival point estimate to a local macro?
Post a Comment