# NOT RUN {
## Two covariate groups
## K&M. Example 7.2, pg 210, table 7.2 (last column).
# }
# NOT RUN {
data("kidney", package="KMsurv")
k1 <- with(kidney,
ten(Surv(time=time, event=delta) ~ type))
COV(k1)[COV(k1) > 0]
# }
# NOT RUN {
## Four covariate groups
## K&M. Example 7.6, pg 217.
# }
# NOT RUN {
data("larynx", package="KMsurv")
l1 <- ten(Surv(time, delta) ~ stage, data=larynx)
rowSums(COV(l1), dims=2)
# }
# NOT RUN {
## example of numeric method
## Three covariate groups
## K&M. Example 7.4, pg 212.
# }
# NOT RUN {
data("bmt", package="KMsurv")
b1 <- asWide(ten(Surv(time=t2, event=d3) ~ group, data=bmt))
rowSums(b1[, COV(x=e, n=n, ncg=matrix(data=c(n_1, n_2, n_3), ncol=3))], dims=2)
# }
Run the code above in your browser using DataLab