Learn R Programming

ggRandomForests (version 1.1.2)

gg_survival.ggRandomForests: Nonparametric survival estimates.

Description

Nonparametric survival estimates.

Usage

gg_survival.ggRandomForests(interval, censor, strat = NULL, data,
  type = c("kaplan", "nelson"), ...)

Arguments

interval
name of the interval variable in the training dataset.
censor
name of the censoring variable in the training dataset.
strat
stratifying variable in the training dataset, defaults to NULL
data
name of the training data.frame
type
one of ("kaplan","nelson"), defaults to kaplan-meier
...
extra arguments passed to kaplan or nelson functions.

Value

  • A gg_survival object created using the non-parametric kaplan-meier or nelson-aalon estimators.

Details

gg_survival is a wrapper function for generating nonparametric survival estimates using either nelson-aalen or kaplan-meier estimates.

See Also

kaplan nelson plot.gg_survival

Examples

Run this code
data(pbc, package="randomForestSRC")
pbc$time <- pbc$days/364.25

# This is the same as kaplan
gg_dta <- gg_survival(interval="time", censor="status",
                     data=pbc)

plot(gg_dta, error="none")
plot(gg_dta)

# Stratified on treatment variable.
gg_dta <- gg_survival(interval="time", censor="status",
                     data=pbc, strat="treatment")

plot(gg_dta, error="none")
plot(gg_dta)

# ...with smaller confidence limits.
gg_dta <- gg_survival(interval="time", censor="status",
                     data=pbc, strat="treatment", conf.int=.68)

plot(gg_dta, error="lines")

Run the code above in your browser using DataLab