1 / 3

Survival Analysis in Stata

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)

olinda
Download Presentation

Survival Analysis in Stata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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

More Related