# load and prepare data
data(lung)
tmpd <- with(lung, data.frame(time=SurvTime,stat=1-censor,grp=Treatment))
# two weight functions are defined.
# one is constant weight; the other emphasize diverging hazards
timef1 <- function(x){1}
timef2 <- function(x){(x)}
test1 <- projection.test(tmpd,list(timef1,timef2),base="KM")
test1$chisq; test1$pvalue; test1$df.chisq
Run the code above in your browser using DataLab