age_abridge_force: force a (count) vector to abridged ages

View source: R/utilsAge.R

age_abridge_forceR Documentation

force a (count) vector to abridged ages

Description

This is a robustness utility, in place to avoid annoying hang-ups in LTAbr(). If data are given in non-standard ages, they are forced to standard abridged ages on the fly. Really this should happen prior to calling lt_abridged()

Usage

age_abridge_force(Value, Age)

Arguments

Value

numeric vector, presumably counts in grouped ages

Age

integer vector, lower bounds of age groups

Details

This should be able to group up and group down as needed. graduate_mono() is used below the hood. pclm() or graduate_uniform() out to be flexible enough to do the same.

See Also

graduate_mono_closeout, lt_abridged

Examples

V1        <- pop1m_ind
Age       <- c(0,1,3,seq(5,100,5))
AgeInt    <- c(1,2,2,rep(5,19),1)
Value     <- tapply(V1,rep(Age,times=AgeInt), sum)

is_abridged(Age)
age_abridge_force(Value, Age)

timriffe/DemoTools documentation built on Oct. 14, 2024, 12:53 p.m.