Learn R Programming

relsurv (version 1.0)

transrate: Reorganize Data into a Ratetable Object

Description

The function assists in reorganizing certain types of data into a ratetable object.

Usage

transrate(men,women,yearlim,int.length=1)

Arguments

men
a matrix containing the yearly (conditional) probabilities of one year survival for men. Rows represent age (increasing 1 year per line,starting with 0), the columns represent cohort years (the limits are in yearlim, the increase is in
women
a matrix containing the yearly (conditional) probabilities of one year survival for women.
yearlim
the first and last cohort year given in the tables.
int.length
the length of intervals in which cohort years are given.

Value

  • An object of class ratetable.

Details

This function only applies for ratetables that are organized by age, sex and year.

See Also

ratetable.

Examples

Run this code
men <- cbind(exp(-365*exp(-14.5+.08*(0:100))),exp(-365*exp(-14.7+.085*(0:100))))
women <- cbind(exp(-365*exp(-15.5+.085*(0:100))),exp(-365*exp(-15.7+.09*(0:100))))
table <- transrate(men,women,yearlim=c(1980,1990),int.length=10)

Run the code above in your browser using DataLab