Description Usage Arguments Details Value Examples
View source: R/survival_operations.R
Convert an age-based table to a cycle-based table
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)
|
x |
a survival object |
age_init |
initial age the table will be applied to |
cycle_length |
length of cycles |
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()
.
a table with time
renormalized to be in terms of cycles,
with time 0 corresponding to age age_init
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.