age_to_time: Convert an age-based table to a cycle-based table

Description Usage Arguments Details Value Examples

View source: R/survival_operations.R

Description

Convert an age-based table to a cycle-based table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
age_to_time(x, age_init, cycle_length)

## S3 method for class 'surv_table'
age_to_time(x, age_init, cycle_length)

## S3 method for class 'surv_object'
age_to_time(x, age_init, cycle_length)

## S3 method for class 'surv_pooled'
age_to_time(x, age_init, cycle_length)

Arguments

x

a survival object

age_init

initial age the table will be applied to

cycle_length

length of cycles

Details

This is used to convert a mortality table for use as a survival curve in terms of cycles of the model. Typically, age_surv will have been constructed using define_surv_table() or define_wtd_surv_table().

Value

a table with time renormalized to be in terms of cycles, with time 0 corresponding to age age_init

Examples

1
2
3
 df <- data.frame(time = c(50, 51, 55, 60), survival = c(1, 0.9, 0.7, 0.5))
 st <- define_surv_table(df, by_age = TRUE)
 age_to_time(st, age_init = 50, cycle_length = 1)

MattWiener/heemodFits documentation built on May 19, 2019, 8:21 a.m.