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 |
data |
optional |
subset |
optional |
breaks |
optional numeric vector of breaks. If this is not provided, then the
unique time values from the |
x |
|
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)