build a description table for survival estimates
descrSurvEstimate(
S,
strata,
stratorder,
survname = "survival time",
evaltimes = c(3, 5),
evaltimeunits = "years",
digits = 2,
includeNAs = TRUE,
includeNonNAs = TRUE,
missingName = "missing",
nonNAsName = "N",
stratheader = TRUE,
pval = FALSE,
pvals_formatting = TRUE,
pvals_digits = 2,
pvals_signiflev = 0.05,
hr = FALSE
)a character matrix
survival objects from Surv
a list of vectors containing strata. If the vectors are ordered factors the columns will be used in the given order.
(list of) character vector for the order of the reported columns. Overrides any order of strata
the name of the survival time, e.g. 'DFS'
numeric vector. for which times to calculate the survival estimate
the unit of the survival times (years, months, ...)
round to
boolean. Include number of NAs in the output?
Logical; if TRUE, include a column reporting the number of non-missing (non-NA) observations in the output table. Default is TRUE.
character. name of the rows with missing numbers. Defaults to "missing".
Character string; the name to use as the column heading for the number of non-missing (non-NA) values. Default is "N".
boolean. print the stratheader? Turn off for inclusion into a bigger table
boolean. if TRUE, the p value from a cox model is printed in a separate column
boolean. If FALSE report numbers, else report formatted strings (via prettyPvalue)
integer. Number of digits for p value formatting. Ignored when pvals_formatting==FALSE. Defaults to 2
double. The significance level for bold p value formatting. Ignored when pvals_formatting==FALSE. Defaults to 0.05
boolean. if TRUE, the hazard ratio (with confidence interval) is printed as well. (only has an effect if pval==TRUE)
Andreas Leha
calculate the survival estimates at the specified times and return a nicely formatted table
if (require("survival")) {
S <- Surv(aml$time, aml$status)
descrSurvEstimate(S,
evaltimes=c(19, 24),
evaltimeunits="months")
}
Run the code above in your browser using DataLab