lifetab2 {biostat3}R Documentation

Formula wrapper for lifetab from the KMsurv package.

Description

Calculate a life table using the actuarial method using a formula and a data-frame with optional breaks.

Usage

lifetab2(formula, data, subset, breaks = NULL)
## S3 method for class 'lifetab2'
plot(x, y=NULL, ...)
## S3 method for class 'lifetab2'
lines(x, y=NULL, ...)

Arguments

formula

formula with the left-hand side being a Surv object, including a time and event indicator, and the right-hand side indicated stratification.

data

optional data.frame for the Surv object. If this is not provided, then the parent frame is used for the Surv object.

subset

optional subset statement

breaks

optional numeric vector of breaks. If this is not provided, then the unique time values from the Surv object are used together with Inf.

x

lifetab2 object

y

unused argument (part of the generic function)

...

other arguments

Details

See lifetab for details. This wrapper is meant to make life easier.

A copy of the lifetab function has been included in the biostat3 package to reduce dependencies.

Value

A data.frame as per lifetab.

Author(s)

Mark Clements for the wrapper.

Examples

## we can use unique transformed times (colon_sample)
lifetab2(Surv(floor(surv_yy),status=="Dead: cancer")~1, colon_sample)

## we can also use the breaks argument (colon)
lifetab2(Surv(surv_yy,status=="Dead: cancer")~1, colon, breaks=0:10)

[Package biostat3 version 0.1.9 Index]