#The commands below assume that the lungcancer data set has been stored

# in the dataframe "lungcancer" and that the survival library has been attached

# (cf. the R commands to the lectures of week 39)

 

 

#Test the hypothesis of equal mortality for males and females using the logrank test:

survdiff(Surv(time,cens)~sex, data=lungcancer)

 

#Test the hypothesis of equal mortality for males and females using the Flemming-Harrington test with rho=1:

survdiff(Surv(time,cens)~sex, data=lungcancer,rho=1)