Question 3

For this question, we will use survival analysis, i.e. Log-rank test. We want to test if the Drug 6-MP is effective in term of survival. We cannot perform one sided tests, but we can see if the curves are different.

\(H_0: \text{There is no difference between the survival curves.}\) \(H_1: \text{There is a difference between the survival curves}\)

if (!require("survival")) {
  install.packages("survival", repos="http://cran.rstudio.com/") 
  library("survival")
}
## Loading required package: survival
time =c(6,6,6,6,7,9,10,10,11,13,16,17,19,20,22,23,25,32,32,34,35,
        1,1,2,2,3,4,4,5,5,8,8,8,8,11,11,12,12,15,17,22,23)
event=c(1,1,1,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
group=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
sur=data.frame(time=time, event=event, group=group)
survdiff(Surv(time, event) ~ group,data=sur, rho = 0)
## Call:
## survdiff(formula = Surv(time, event) ~ group, data = sur, rho = 0)
## 
##          N Observed Expected (O-E)^2/E (O-E)^2/V
## group=0 21       21     10.7      9.77      16.8
## group=1 21        9     19.3      5.46      16.8
## 
##  Chisq= 16.8  on 1 degrees of freedom, p= 4.17e-05

We see that the results are significant, and we reject \(H_0\).