Download presentation
Presentation is loading. Please wait.
Published byIra Walters Modified over 9 years ago
1
Survival Analysis in Stata First, declare your survival-time variables to Stata using stset For example, suppose your duration variable is called timevar and it ranges from 0 to 15 (where 15 marks the end of the sample) You observe failure for all durations less than 15 but when timevar = 15 the data is censored You need a variable that indicates for which durations you observe failure; call this variable failureind Failureind must take the value 1 when duration is less than 15 and 0 otherwise Given timevar and failureind, you tell stata you have duration data with the command: Stset timevar, failure(failureind)
2
The Non-Parametric Hazard Function Sts can be used to generate the non-parametric survivor function or the non-parametric hazard function To graph the hazard function, use: Sts graph, hazard To list the hazard function, use: Sts list, hazard
3
Survival Models Estimate survival models using streg Specify which distribution you want using the distribution() option You can use the exponential, Weibull, log-normal, log-logistic, Gompertz, and gamma distributions Streg x, distribution(exponential) You may need to use the nohr option to get Stata to report coefficient estimates rather than exponentiated coefficients when you are working with the exponential, Weibull, and Gompertz distributions: Streg x, distribution(exponential) nohr
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.