SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Tutorial: Survival Analysis in Stata



In this tutorial, we use data from the Digitalis Investigation Group (DIG). Recall that the DIG trial
was a was a randomized, double-blind, multicenter trial designed to examine the safety and
efficacy of Digoxin in treating patients with congestive heart failure. In this trial, patients were
randomized to either Digoxin or placebo. The log-rank test was used to compare overall
mortality between the two groups.

To begin, open the dig.dta data set. Before we can do any analyses, we must first tell Stata that
we are working with survival data (analogous to how we had to svyset our data and tell Stata
that we were working with survey data). You can do this using the stset command. The
command for this dataset is stset deathday, failure(death==1). This command tells Stata that
our time-to-death variable is deathday; and a value of 1 for the death variable means that
person died while any other value (in this case 0) means that person was censored. For survival
data, we need at least two variables: 1) a variable for the time to the event and 2) a variable to
indicate if the observation is censored or not.



   1. Graph the Kaplan-Meier estimates of the survival curves for each treatment group.


       .sts graph, by(trtmt)




                                                                                                    1
Kaplan-Meier survival estimates
   1.00
   0.75
   0.50
   0.25
   0.00




           0                 500               1000               1500               2000
                                           analysis time

                                       trtmt = 0            trtmt = 1



   Note: you can also list the values of the survival function using the sts list, by(trtmt)
   command.



2. In the New England of Journal paper (see handout NEJM_DIG), the authors plotted 1 –
   S(t) in Figure 1. Graph 1 – S(t) for each treatment group.

   sts graph, failure by(trtmt)




                                                                                               2
Kaplan-Meier failure estimates
   1.00
   0.75
   0.50
   0.25
   0.00




               0                500               1000             1500              2000
                                              analysis time

                                          trtmt = 0           trtmt = 1




3. Conduct a log-rank test at the 0.05 level of significance to test the hypothesis that the
   survival distribution is the same in the two treatment groups. Use the following
   command: sts test trtmt, logrank
      a. What are your null and alternative hypotheses?

               The null hypothesis is that the two groups have same distribution of survival
               times. The alternative is that they do not.

          b. What is the value of your test statistic?

               0.00

          c. What distribution does your test statistic have under the null hypothesis?

               Chi-squared distribution with 1 degree of freedom

          d.   What is your p-value?

               0.9616. Note: using all 6800 observation yields a p-value of 0.8013. This is the p-
               value the authors reported in Figure 1.

                                                                                                 3
e. What is your conclusion?

   Since our p-value is greater than 0.05, we fail to reject the null hypothesis. Thus,
   we conclude that we do not have evidence that the distribution of survival times
   is different between the Digoxin group and the placebo group.




                                                                                      4

Weitere ähnliche Inhalte

Ähnlich wie Handout week12tutorial1 survival.8622bf57af99

Tryptone task
Tryptone taskTryptone task
Tryptone taskYuwu Chen
 
Chapter 5 experimental design for sbh
Chapter 5 experimental design for sbhChapter 5 experimental design for sbh
Chapter 5 experimental design for sbhRione Drevale
 
Biostat_Chapter6_Part3.pdf Bio Statistics
Biostat_Chapter6_Part3.pdf Bio StatisticsBiostat_Chapter6_Part3.pdf Bio Statistics
Biostat_Chapter6_Part3.pdf Bio StatisticsArwaAbdelHamid1
 
Sequential experimentation in clinical trials
Sequential experimentation in clinical trialsSequential experimentation in clinical trials
Sequential experimentation in clinical trialsSpringer
 
Linear Modeling Survival Analysis Statistics Assignment Help
Linear Modeling Survival Analysis Statistics Assignment HelpLinear Modeling Survival Analysis Statistics Assignment Help
Linear Modeling Survival Analysis Statistics Assignment HelpStatistics Assignment Experts
 
MLlectureMethod.ppt
MLlectureMethod.pptMLlectureMethod.ppt
MLlectureMethod.pptbutest
 
MLlectureMethod.ppt
MLlectureMethod.pptMLlectureMethod.ppt
MLlectureMethod.pptbutest
 
Some real life data analysis on stationary and non-stationary Time Series
Some real life data analysis on stationary and non-stationary Time SeriesSome real life data analysis on stationary and non-stationary Time Series
Some real life data analysis on stationary and non-stationary Time SeriesAjay Bidyarthy
 
Introduction to t-tests (statistics)
Introduction to t-tests (statistics)Introduction to t-tests (statistics)
Introduction to t-tests (statistics)Dr Bryan Mills
 
Point Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis testsPoint Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis testsUniversity of Salerno
 
Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1) Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1) Marina Santini
 

Ähnlich wie Handout week12tutorial1 survival.8622bf57af99 (20)

Tryptone task
Tryptone taskTryptone task
Tryptone task
 
Chapter 5 experimental design for sbh
Chapter 5 experimental design for sbhChapter 5 experimental design for sbh
Chapter 5 experimental design for sbh
 
Talk 5
Talk 5Talk 5
Talk 5
 
Biostat_Chapter6_Part3.pdf Bio Statistics
Biostat_Chapter6_Part3.pdf Bio StatisticsBiostat_Chapter6_Part3.pdf Bio Statistics
Biostat_Chapter6_Part3.pdf Bio Statistics
 
International Journal of Engineering Inventions (IJEI),
International Journal of Engineering Inventions (IJEI), International Journal of Engineering Inventions (IJEI),
International Journal of Engineering Inventions (IJEI),
 
Sequential experimentation in clinical trials
Sequential experimentation in clinical trialsSequential experimentation in clinical trials
Sequential experimentation in clinical trials
 
PARAMETRIC STATISTICS .pptx
PARAMETRIC STATISTICS .pptxPARAMETRIC STATISTICS .pptx
PARAMETRIC STATISTICS .pptx
 
Statistical analysis by iswar
Statistical analysis by iswarStatistical analysis by iswar
Statistical analysis by iswar
 
Linear Modeling Survival Analysis Statistics Assignment Help
Linear Modeling Survival Analysis Statistics Assignment HelpLinear Modeling Survival Analysis Statistics Assignment Help
Linear Modeling Survival Analysis Statistics Assignment Help
 
MLlectureMethod.ppt
MLlectureMethod.pptMLlectureMethod.ppt
MLlectureMethod.ppt
 
MLlectureMethod.ppt
MLlectureMethod.pptMLlectureMethod.ppt
MLlectureMethod.ppt
 
Some real life data analysis on stationary and non-stationary Time Series
Some real life data analysis on stationary and non-stationary Time SeriesSome real life data analysis on stationary and non-stationary Time Series
Some real life data analysis on stationary and non-stationary Time Series
 
Introduction to t-tests (statistics)
Introduction to t-tests (statistics)Introduction to t-tests (statistics)
Introduction to t-tests (statistics)
 
Point Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis testsPoint Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis tests
 
9618821.ppt
9618821.ppt9618821.ppt
9618821.ppt
 
9618821.pdf
9618821.pdf9618821.pdf
9618821.pdf
 
lecture8.ppt
lecture8.pptlecture8.ppt
lecture8.ppt
 
Lecture8
Lecture8Lecture8
Lecture8
 
Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1) Lecture 8: Machine Learning in Practice (1)
Lecture 8: Machine Learning in Practice (1)
 
MT2
MT2MT2
MT2
 

Handout week12tutorial1 survival.8622bf57af99

  • 1. Tutorial: Survival Analysis in Stata In this tutorial, we use data from the Digitalis Investigation Group (DIG). Recall that the DIG trial was a was a randomized, double-blind, multicenter trial designed to examine the safety and efficacy of Digoxin in treating patients with congestive heart failure. In this trial, patients were randomized to either Digoxin or placebo. The log-rank test was used to compare overall mortality between the two groups. To begin, open the dig.dta data set. Before we can do any analyses, we must first tell Stata that we are working with survival data (analogous to how we had to svyset our data and tell Stata that we were working with survey data). You can do this using the stset command. The command for this dataset is stset deathday, failure(death==1). This command tells Stata that our time-to-death variable is deathday; and a value of 1 for the death variable means that person died while any other value (in this case 0) means that person was censored. For survival data, we need at least two variables: 1) a variable for the time to the event and 2) a variable to indicate if the observation is censored or not. 1. Graph the Kaplan-Meier estimates of the survival curves for each treatment group. .sts graph, by(trtmt) 1
  • 2. Kaplan-Meier survival estimates 1.00 0.75 0.50 0.25 0.00 0 500 1000 1500 2000 analysis time trtmt = 0 trtmt = 1 Note: you can also list the values of the survival function using the sts list, by(trtmt) command. 2. In the New England of Journal paper (see handout NEJM_DIG), the authors plotted 1 – S(t) in Figure 1. Graph 1 – S(t) for each treatment group. sts graph, failure by(trtmt) 2
  • 3. Kaplan-Meier failure estimates 1.00 0.75 0.50 0.25 0.00 0 500 1000 1500 2000 analysis time trtmt = 0 trtmt = 1 3. Conduct a log-rank test at the 0.05 level of significance to test the hypothesis that the survival distribution is the same in the two treatment groups. Use the following command: sts test trtmt, logrank a. What are your null and alternative hypotheses? The null hypothesis is that the two groups have same distribution of survival times. The alternative is that they do not. b. What is the value of your test statistic? 0.00 c. What distribution does your test statistic have under the null hypothesis? Chi-squared distribution with 1 degree of freedom d. What is your p-value? 0.9616. Note: using all 6800 observation yields a p-value of 0.8013. This is the p- value the authors reported in Figure 1. 3
  • 4. e. What is your conclusion? Since our p-value is greater than 0.05, we fail to reject the null hypothesis. Thus, we conclude that we do not have evidence that the distribution of survival times is different between the Digoxin group and the placebo group. 4