Description Usage Arguments Examples
Draw Kaplan-Meier Survival Curve For Follow-up Data
1 | drawFUSurv(model, data)
|
model |
An object of class gam |
data |
A data.frame |
1 2 3 4 5 6 7 8 9 10 | library(survival)
library(mgcv)
pbcseq$status1 <- as.numeric(pbcseq$status==2) ## deaths
pb <- tdpois(pbcseq) ## conversion
pb$tf <- factor(pb$futime) ## add factor for event time
b <- bam(z ~ tf - 1 + trt + s(sqrt(protime)) + s(platelet) + s(age) + s(bili) +
s(albumin) + s(sqrt(ast)),family=poisson,data=pb,discrete=TRUE,nthreads=2)
data=pbcseq[pbcseq$id %in% c(10,25,66),]
data=pbcseq[pbcseq$id %in% c(25),]
drawFUSurv(b,data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.