yrs_calc_avg: Calculate license buying - years by age

Description Usage Arguments See Also Examples

View source: R/model-YrsAnnual.R

Description

Attempting here to replicate the approach used for the OK lifetime license study for characterizing particiation over a sportsperson's lifetime. Takes the average number of years (by cohort) that sportspersons held a license, conditional on having held a license in at least one of the selected years.

Usage

1
2
3
yrs_calc_avg(history, ..., yrs = NULL, ages = 16:64,
  age_cohort = function(x) {     cut(x, c(-Inf, 15, 19, 24, 29, 34, 39,
  44, 49, 54, 59, 64, Inf)) })

Arguments

history

license history table with cust_id, year, age_year

...

optional grouping variables

yrs

set of years that will be averaged. If NULL, uses the most recent 5 years

ages

ages to include, based on first year to be averaged

age_cohort

function to estimate age_cohort based on history$birth_year in the first year to be averaged

See Also

Other functions to estimate annual license buying: yrs_avidity, yrs_calc, yrs_fit, yrs_lifetime, yrs_plot, yrs_predict_avg, yrs_predict, yrs_result, yrs_zero

Examples

1
2

southwick-associates/lifetime documentation built on Feb. 24, 2020, 9:33 a.m.