lifetab: Create cohort life table

Description Usage Arguments Value Author(s) Examples

Description

Create cohort life table.

Usage

1
lifetab(tis, ninit, nlost, nevent)

Arguments

tis

a vector of end points of time intervals, whose length is 1 greater than nlost and nevent.

ninit

the number of subjects initially entering the study.

nlost

a vector of the number of individuals lost follow or withdrawn alive for whatever reason.

nevent

a vector of the number of individuals who experienced the event

Value

A data.frame with the following columns:

nsubs

the number of subject entering the intervals who have not experienced the event.

nlost

the number of individuals lost follow or withdrawn alive for whatever reason.

nrisk

the estimated number of individuals at risk of experiencing the event.

nevent

the number of individuals who experienced the event.

surv

the estimated survival function at the start of the intervals.

pdf

the estimated probability density function at the midpoint of the intervals.

hazard

the estimated hazard rate at the midpoint of the intervals.

se.surv

the estimated standard deviation of survival at the beginning of the intervals.

se.pdf

the estimated standard deviation of the prbability density function at the midpoint of the intervals.

se.hazard

the estimated standard deviation of the hazard function at the midpoint of the intervals

The row.names are the intervals.

Author(s)

Jun Yan jyan@stat.uconn.edu

Examples

1
2
3
4
5
6
tis <- c(0, 2, 3, 5, 7, 11, 17, 25, 37, 53, NA)
nsubs <- c(927, 848, 774, 649, 565, 449, 296, 186, 112, 27)
nlost <- c(2, 3, 6, 9, 7, 5, 3, rep(0, 3))
nevent <- c(77, 71, 119, 75, 109, 148, 107, 74, 85, 27)

lifetab(tis, nsubs[1], nlost, nevent)

Example output

      nsubs nlost nrisk nevent       surv         pdf     hazard     se.surv
0-2     927     2 926.0     77 1.00000000 0.041576674 0.04338028 0.000000000
2-3     848     3 846.5     71 0.91684665 0.076900310 0.08754624 0.009073665
3-5     774     6 771.0    119 0.83994634 0.064820762 0.08362614 0.012058378
5-7     649     9 644.5     75 0.71030482 0.041328830 0.06177924 0.014947215
7-11    565     7 561.5    109 0.62764716 0.030460169 0.05374753 0.015966927
11-17   449     5 446.5    148 0.50580648 0.027943023 0.06621924 0.016592925
17-25   296     3 294.5    107 0.33814834 0.015357331 0.05549793 0.015812197
25-37   186     0 186.0     74 0.21528969 0.007137741 0.04138702 0.013826142
37-53   112     0 112.0     85 0.12963680 0.006149067 0.07643885 0.011358269
53-NA    27     0  27.0     27 0.03125173          NA         NA 0.005911869
            se.pdf   se.hazard
0-2   0.0045368324 0.004938988
2-3   0.0087683603 0.010379868
3-5   0.0055430063 0.007639143
5-7   0.0045695123 0.007120026
7-11  0.0027313326 0.005118250
11-17 0.0020898086 0.005334699
17-25 0.0013852970 0.005231318
25-37 0.0007903745 0.004660447
37-53 0.0006304732 0.006560105
53-NA           NA          NA

KMsurv documentation built on May 2, 2019, 7:25 a.m.

Related to lifetab in KMsurv...