Description Usage Arguments References Examples
View source: R/todo/survReport.R View source: R/survReport.r
Generate a Survival Report with Kaplan-Meier Estimates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
formula |
a formula with survival ( |
data |
data.frame |
subset |
optional subsetting criteria |
na.action |
function for handling |
study |
character string identifying the study; used in multi-study reports or where distinct patient strata are analyzed separately. Used to fetch the study-specific metadata stored by |
ylab |
character. Passed to |
what |
|
conf |
character. See |
cause |
character vector or list. If a vector, every |
head |
character string. Specifies initial text in the figure caption, otherwise a default is used. |
tail |
optional character string. Specifies final text in the figure caption, e.g., what might have been put in a footnote in an ordinary text page. This appears just before any needles. |
h |
numeric. Height of plots in pixels. |
w |
numeric. Width of plots in pixels. |
mylim |
numeric 2-vector. Used to force expansion of computed y-axis limits. See |
aehaz |
logical. Set to |
times |
numeric vector. If specified, prints cumulative incidence probabilities at those times on the plots. |
opts |
list. A list specifying arguments to |
... |
ignored |
Boers M (2004): Null bar and null zone are better than the error bar to compare group means in graphs. J Clin Epi 57:712-715.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # See tests directory test.Rnw for a live example
## Not run:
set.seed(1)
n <- 400
dat <- data.frame(t1=runif(n, 2, 5), t2=runif(n, 2, 5),
e1=rbinom(n, 1, .5), e2=rbinom(n, 1, .5),
treat=sample(c('a','b'), n, TRUE))
dat <- upData(dat,
labels=c(t1='Time to operation',
t2='Time to rehospitalization',
e1='Operation', e2='Hospitalization',
treat='Treatment')
units=c(t1='year', t2='year'))
survReport(Surv(t1, e1) + Surv(t2, e2) ~ treat, data=dat)
dat <- upData(dat, labels=c(t1='Follow-up Time', t2='Time'),
cause=factor(sample(c('death','MI','censor'), n, TRUE),
c('censor', 'MI', 'death')))
survReport(Surv(t1, cause) ~ treat, cause='death', data=dat)
survReport(Surv(t1, cause) + Surv(t2, cause) ~ treat,
cause=list(c('death', 'MI'), 'death'), data=dat)
# Two plots for t1, one plot for t2
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.