generateAgesAtDeath: Generate Ages at Death

View source: R/generateAgesAtDeath.r

generateAgesAtDeathR Documentation

Generate Ages at Death

Description

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.

Usage

generateAgesAtDeath(
  curAge,
  gender,
  n = 1,
  mort.factor = 1,
  adj.years = 0,
  randomize.order = TRUE
)

Arguments

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

Value

Vector of ages at death

Examples

 ## Not run: generateAgesAtDeath(51, "Male", 10, 1.0)


rexmacey/aasim documentation built on Oct. 29, 2024, 9:30 a.m.