# NOT RUN {
# }
# NOT RUN {
library(rpart)
data(stagec)
# The Log-Rank Analysis using survdiff
lrsurvdiff <- survdiff(Surv(pgtime,pgstat)~grade>2,data=stagec)
print(lrsurvdiff)
# The Log-Rank Analysis: permutations of the null Chi distribution
lrp <- EmpiricalSurvDiff(stagec$pgtime,stagec$pgstat,stagec$grade>2,
type="Chi",plots=TRUE,samples=10000,
main="Chi Null Distribution")
print(list(unlist(c(lrp$LR,lrp$pvalue))))
# The Log-Rank Analysis: permutations of the null SLR distribution
lrp <- EmpiricalSurvDiff(stagec$pgtime,stagec$pgstat,stagec$grade>2,
type="SLR",plots=TRUE,samples=10000,
main="SLR Null Distribution")
print(list(unlist(c(lrp$LR,lrp$pvalue))))
# The Log-Rank Analysis: Bootstraping the SLR distribution
lrp <- EmpiricalSurvDiff(stagec$pgtime,stagec$pgstat,stagec$grade>2,
computeDist=TRUE,plots=TRUE,samples=100000,
main="SLR Null and SLR bootrapped")
print(list(unlist(c(lrp$LR,lrp$pvalue))))
# }
Run the code above in your browser using DataLab