survfit2df: Extract survival data from an object of class "survfit"

View source: R/survfit2df.R

survfit2dfR Documentation

Extract survival data from an object of class "survfit"

Description

Extract survival data from an object of class "survfit"

Usage

survfit2df(fit, labels = NULL)

Arguments

fit

An object of class "survfit"

labels

Character

Value

A data.frame

Examples

library(survival)
data(cancer,package="survival")
fit=survfit(coxph(Surv(time,status)~sex+age+strata(rx),data=colon))
survfit2df(fit)
## Not run: 
fit=coxph(Surv(time,status)~sex+age+strata(rx),data=colon)
fit=survfit(as.formula(deparse(fit$terms)),data=fit2model(fit))
survfit2df(fit)
fit=survfit(Surv(time,status)~rx+sex+age,data=colon)
survfit2df(fit)
fit=survfit(Surv(time,status)~1,data=colon)
survfit2df(fit)

## End(Not run)

autoReg documentation built on Nov. 14, 2023, 9:07 a.m.