CalcProductLimitEst {paramDemo} | R Documentation |
Calculating the product limit estimator from Data.
Description
CalcProductLimitEst
uses non-parametric methods to calculate the product limit estimator and confidence intervals.
Usage
CalcProductLimitEst(ageLast, ageFirst = NULL, departType,
calcCIs = FALSE, nboot = 1000, alpha = 0.05)
Arguments
ageLast |
Numerical vector with the ages at last detection (i.e., death and censoring) (see |
ageFirst |
Numerical vector of ages at first detection (i.e., truncation). If |
departType |
Character string vector for the type of departure (i.e., last detection), with values “ |
calcCIs |
Logical indicating whether confidence intervals should be calculated |
nboot |
Number of bootstrap iterations |
alpha |
Alpha level. Default is 0.05 for 95% CIs |
Details
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.
Value
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 |
ages when individuals died |
ple |
product limit estimator |
Lower |
If indicated with argument |
Lower |
If indicated with argument |
Author(s)
Fernando Colchero fernando_colchero@eva.mpg.de
See Also
CalcLifeTable
to calculate life tables.
Examples
# 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))