makeKMdf: Make a data frame for a Kaplan-Meier curve

Description Usage Arguments Value Examples

View source: R/makeKMdf.R

Description

Create a data frame for plotting a Kaplan-Meier curve by pulling components from survival:survfit.formula

Usage

1

Arguments

formula

A formula object, which must have a 'Surv' object as the response on the left of the '~' operator and the grouping term (often the treatment) on the right.

data

A data frame in which to interpret the variables named in the formula

Value

A data frame with columns group, time, n.risk, n.event, n.censor, surv, low, and upp

Examples

1
makeKMdf(formula = survival::Surv(stime, scens) ~ treatment, data = mice)

jbirstler/survivalFigs documentation built on Jan. 18, 2021, 6:28 p.m.