Using Stata version 13.1 on Windows 7 am I am trying to draw a variety of Kaplan Meier curves.
Please see full data set graph attached

I would like to restrict analysis to outcome at 90 days. I recoded the data so that anyone with an admission length greater than 90 days had an admission of 90 days.
This graph looks more like I would expect but I don't know why it returns to 0 at 90 days. 
Following advice previously posted Following previous advice (http://www.stata.com/statalist/archi.../msg00229.html, http://www.stata.com/manuals13/g-2graphtwoway.pdf, http://www.stata.com/manuals13/ststs.pdf#ststs) and using the full dataset I have tried using -sts gen- to generate the full curve and then tried plotting the days of interest using a standard twoway graph.
I have tried the following to generate the twoway graph

Please can you advise
Claire
Code:
. stset Lengthofadmission, fail(Outcome) failure event: Outcome != 0 & Outcome < . obs. time interval: (0, Lengthofadmission] exit on or before: failure ------------------------------------------------------------------------------ 562 total observations 4 event time missing (Lengthofadmission>=.) PROBABLE ERROR 1 observation ends on or before enter() ------------------------------------------------------------------------------ 557 observations remaining, representing 486 failures in single-record/single-failure data 380066 total analysis time at risk and under observation at risk from t = 0 earliest observed entry t = 0 last observed exit t = 1227
Code:
sts graph, xtitle(Length of admission(days)) by(Group) risktable(, order(1 " Group 1" 2 "Group 2") rowtitle(, justification(left))) legend(order(1 "Group 1" 2 "Group 2"))
I would like to restrict analysis to outcome at 90 days. I recoded the data so that anyone with an admission length greater than 90 days had an admission of 90 days.
Code:
stset Lengthofadmission, fail(Outcome) failure event: Outcome != 0 & Outcome < . obs. time interval: (0, Lengthofadmission] exit on or before: failure ------------------------------------------------------------------------------ 562 total observations 4 event time missing (Lengthofadmission>=.) PROBABLE ERROR 1 observation ends on or before enter() ------------------------------------------------------------------------------ 557 observations remaining, representing 486 failures in single-record/single-failure data 42348 total analysis time at risk and under observation at risk from t = 0 earliest observed entry t = 0 last observed exit t = 90
Code:
sts graph, xtitle(Length of admission(days)) by(Group) risktable(, order(1 " Group 1" 2 "Group 2") rowtitle(, justification(left))) legend(order(1 "Group 1" 2 "Group 2"))
Following advice previously posted Following previous advice (http://www.stata.com/statalist/archi.../msg00229.html, http://www.stata.com/manuals13/g-2graphtwoway.pdf, http://www.stata.com/manuals13/ststs.pdf#ststs) and using the full dataset I have tried using -sts gen- to generate the full curve and then tried plotting the days of interest using a standard twoway graph.
I have tried the following to generate the twoway graph
Code:
sts gen surv=s
Code:
line surv _t, xscale(range(0 90))
Please can you advise
Claire
Comment