CalcProductLimitEst uses non-parametric methods to calculate the product limit estimator and confidence intervals.
CalcProductLimitEst(ageLast, ageFirst = NULL, departType,
calcCIs = FALSE, nboot = 1000, alpha = 0.05)CalcProductLimitEst returns an object of class “paramDemoPLE” with consists of a data frame and, if indicated by the user, the confidence interval of the PLE. The data frame includes the following numerical columns:
ages when individuals died
product limit estimator
If indicated with argument calcCIs, the lower \(\alpha / 2\) confidence bound
If indicated with argument calcCIs, the upper \(1 - \alpha / 2\) confidence bound
Numerical vector with the ages at last detection (i.e., death and censoring) (see details)
Numerical vector of ages at first detection (i.e., truncation). If NULL then all values are set to 0 (see details).
Character string vector for the type of departure (i.e., last detection), with values “D” for death and “C” for censoring (see details).
Logical indicating whether confidence intervals should be calculated
Number of bootstrap iterations
Alpha level. Default is 0.05 for 95% CIs
Fernando Colchero fernando_colchero@eva.mpg.de
1) Data structure:
The function allows to calculate product limit estimator (Wann et al. 1987) for data that includes the following types of records:
Uncensored: individuals with known ages at death;
right-censored: individuals last seen alive;
left-truncated: individuals born before the start of the study and are truncated at the age of entry.
The data required are the ages at last detection (i.e., uncensored or right-censored) passed through argument “ageLast”, the type of departure via argument “departType”, which takes two values, namely “D” for death, and “C” for censored (i.e., right-censored).
In addition, if there is left-truncation, it takes the ages at entry to the study by means of argument “ageFirst”. If all the individuals were born during the study, the value of “ageFirst” can be left as NULL, which will make them all equal to 0.
CalcLifeTable to calculate life tables.
# Simulate age at death data from Gompertz model:
ages <- SampleRandAge(n = 100, theta = c(b0 = -5, b1 = 0.1))
# Calculate life table:
lt <- CalcLifeTable(ageLast = ages, departType = rep("D", 100))
Run the code above in your browser using DataLab