View source: R/generateAgesAtDeath.r
generateAgesAtDeath | R Documentation |
This function generates ages at death depending on a mortality table. If n=1, the function will return the median survival age. All mortality rates are multiplied by the mortality factor so a value of 1 has no effect. adj.years is added to the calculated ages at death. This is a simple way to add or subtract years to the lifespans of individuals. The age will not be reduced below the current age.
generateAgesAtDeath(
curAge,
gender,
n = 1,
mort.factor = 1,
adj.years = 0,
randomize.order = TRUE
)
curAge |
Current age of individual. Assumes just turned this age. |
gender |
'Male' or 'Female' |
n |
Number of ages to generate |
mort.factor |
A value multiplied by each mortality value. Higher than 1 shortens lifespan |
adj.years |
adjustment in years to age of death. |
randomize.order |
Randomize the order if TRUE, else sorted in ascending order |
Vector of ages at death
## Not run: generateAgesAtDeath(51, "Male", 10, 1.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.