Learn R Programming

mets (version 1.2)

lifetable.matrix: Life table

Description

Create simple life table

Usage

# S3 method for matrix
lifetable(x, strata = list(), breaks = c(),
   confint = FALSE, ...)

# S3 method for formula lifetable(x, data=parent.frame(), breaks = c(), confint = FALSE, ...)

Arguments

x
time formula (Surv) or matrix/data.frame with columns time,status or entry,exit,status
strata
Strata
breaks
Time intervals
confint
If TRUE 95% confidence limits are calculated
...
Additional arguments to lower level functions
data
data.frame

Examples

Run this code
library(timereg)
data(TRACE)

d <- with(TRACE,lifetable(Surv(time,status==9)~sex+vf,breaks=c(0,0.2,0.5,8.5)))
summary(glm(events ~ offset(log(atrisk))+factor(int.end)*vf + sex*vf,
            data=d,poisson))

Run the code above in your browser using DataLab