# NOT RUN {
## 4 examples of CLFS estimation without stratification (and
## LFS estimation) with and without confidence intervals:
data(cml) # load example data set
cml <- cml[,c(1:7)] # select event and follow-up times and death
# (stratification factor is not included)
res <- clfs(cml) # CLFS + LFS without confidence intervals
res <- clfs(cml, com.est=FALSE) # CLFS without confidence
# intervals
# }
# NOT RUN {
res <- clfs(cml, conf.int=TRUE, no.iter=10) # CLFS + LFS with
# confidence intervals
res <- clfs(cml, com.est=FALSE, conf.int=TRUE, no.iter=10) # CLFS
# with confidence intervals
# }
# NOT RUN {
## 4 examples of CLFS estimation with stratification (and LFS
## estimation) with and without confidence intervals:
data(cml) # load example data set
cml <- cml[,c(1:7,10)] # select event and follow-up times, death,
# and the EUTOS score as a stratification parameter
res <- clfs(cml, strat=TRUE) # stratified CLFS + LFS without
# confidence intervals
res <- clfs(cml, com.est=FALSE, strat=TRUE) # stratified CLFS
# without confidence intervals
# }
# NOT RUN {
res <- clfs(cml, conf.int=TRUE, no.iter=10, strat=TRUE, pvals=TRUE)
# stratified CLFS + LFS with confidence intervals
res <- clfs(cml, com.est=FALSE, conf.int=TRUE, no.iter=10,
strat=TRUE, pvals=TRUE) # stratified CLFS with
# confidence intervals
# }
# NOT RUN {
# }
# NOT RUN {
## As the function does not allow setting plot option (e.g. line
## colour, width and type), you can create a plot using the
## following commands:
data(cml) # load example data set
cml <- cml[,c(1:7)] # select event and follow-up times and death
# (stratification factor is not included)
res <- clfs(cml, conf.int=TRUE, no.iter=10) # CLFS + LFS with
# confidence intervals
maxx <- max(res$pest.day[,1]) # maximum follow-up time in days
x=0:maxx
yrs <- floor(maxx/365) # maximum follow-up time in years
plot(0,1,pch='.',cex=0.01,xlim=c(0,maxx),ylim=c(0,1),axes=FALSE,
xlab="Years after achievement of the first remission",
ylab="Probability") # plot initialization
axis(2,at=seq(0,1,0.2)) # setting of points where tick-marks are
# to be drawn on the y-axis
axis(1,at=seq(0,((yrs+1)*365),365),labels=seq(0,(yrs+1),1))
# setting of points where tick-marks are to be drawn on the
# x-axis
lines(x,res$pest.day[,2],type="S",lty=1,lwd=1) # lower confidence
# interval for the CLFS function estimate
lines(x,res$pest.day[,3],type="S",lty=1,lwd=2) # CLFS estimate
lines(x,res$pest.day[,4],type="S",lty=1,lwd=1) # upper confidence
# interval for the CLFS function estimate
lines(x,res$pest.day[,5],type="S",lty=2,lwd=1) # lower confidence
# interval for the LFS function estimate
lines(x,res$pest.day[,6],type="S",lty=2,lwd=2) # LFS estimate
lines(x,res$pest.day[,7],type="S",lty=2,lwd=1) # upper confidence
# interval for the LFS function estimate
legend("bottomright",legend=c("CLFS","95% conf. int.","LFS",
"95% conf. int."),lwd=c(2,1,2,1),lty=c(1,1,2,2),bty="n",
cex=0.9)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab