qkmplot | R Documentation |
A ggplot2 version of a Kaplan-Meier Plot
qkmplot(x, conf_int = FALSE, ...)
qkmplot_bulid_data_frame(x)
## S3 method for class 'survfit'
qkmplot_bulid_data_frame(x)
qrmst(x, tau = Inf)
## S3 method for class 'survfit'
qrmst(x, tau = Inf)
## S3 method for class 'qkmplot_data'
qrmst(x, tau = Inf)
x |
object |
conf_int |
logical if TRUE show the CI |
... |
Other arguments passed to survival::plot.survfit |
tau |
upper bound on time for restricted mean survival time estimate |
Functions to build, explicitly or implicitly, data.frames and then creating a ggplot2 KM plot.
More details and examples for graphics within qwraps2 are in the vignette(“qwraps2-graphics”, package = “qwraps2”)
a ggplot.
require(survival)
leukemia.surv <- survival::survfit(survival::Surv(time, status) ~ x, data = survival::aml)
qkmplot(leukemia.surv, conf_int = TRUE)
qkmplot_bulid_data_frame(leukemia.surv)
qrmst(leukemia.surv) # NaN for rmst.se in Nonmaintained strata as last observation is an event
qrmst(leukemia.surv, 44)
# pbc examples
pbc_fit <-
survival::survfit(
formula = survival::Surv(time, status > 0) ~ trt
, data = pbc
, subset = !is.na(trt)
)
qkmplot(pbc_fit)
qkmplot(pbc_fit, conf_int = TRUE)
qrmst(pbc_fit)
qrmst(pbc_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.