# NOT RUN {
data(leuk2)
# test difference of S(20) values
# S(20)=survival function at 20 weeks
bpcp2samp(leuk2$time,leuk2$status,leuk2$treatment,
20,parmtype="difference")
# test ratio of S(20) in two treatment groups,
bpcp2samp(leuk2$time,leuk2$status,leuk2$treatment,
20,parmtype="ratio")
# change the order of the group variable to get the other ratio
bpcp2samp(leuk2$time,leuk2$status,leuk2$treatment,20,
parmtype="ratio",changeGroupOrder=TRUE)
# estimate treatment effect= 1 - F(20,trt)/F(20,plac),
# where F(20)=1-S(20) = Pr(T <=20) is the
# cumulative distribution function
# Test whether treatment effect is greater than 30 pct
bpcp2samp(leuk2$time,leuk2$status,leuk2$treatment,20,
parmtype="one.minus.cdfratio",nullparm=0.30,
alternative="greater",
changeGroupOrder=FALSE)
# }
Run the code above in your browser using DataLab