lifetab.Rd
Create cohort life table.
lifetab(tis, ninit, nlost, nevent)
a vector of end points of time intervals, whose length is 1 greater than nlost and nevent.
the number of subjects initially entering the study.
a vector of the number of individuals lost follow or withdrawn alive for whatever reason.
a vector of the number of individuals who experienced the event
A data.frame with the following columns:
the number of subject entering the intervals who have not experienced the event.
the number of individuals lost follow or withdrawn alive for whatever reason.
the estimated number of individuals at risk of experiencing the event.
the number of individuals who experienced the event.
the estimated survival function at the start of the intervals.
the estimated probability density function at the midpoint of the intervals.
the estimated hazard rate at the midpoint of the intervals.
the estimated standard deviation of survival at the beginning of the intervals.
the estimated standard deviation of the prbability density function at the midpoint of the intervals.
the estimated standard deviation of the hazard function at the midpoint of the intervals
The row.names are the intervals.
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)
#> 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