Smooth population counts in 5-year age groups.

smooth_age_5_cf(Value, Age, OAG = TRUE, start_on = 0)

Arguments

Value numeric vector of counts in single, abridged, or 5-year age groups. numeric vector of ages corresponding to the lower integer bound of the counts. logical. Whether or not the top age group is open. Default TRUE. integer. Either 0 or 5. Do we constrain decades starting on the 0s or 5s?

Value

numeric vector of smoothed counts in 5-year age groups.

Details

This method does not account for ages < 10 nor for the 10 year age interval prior to the open age group. These are returned imputed with NA. Age classes must be cleanly groupable to 5-year age groups. Smoothed counts are constrained to sum to original totals in 10-year age groups.

References

Carrier NH, Farrag AM (1959). “The reduction of errors in census populations for statistically underdeveloped countries.” Population Studies, 12(3), 240--285. United States Census Bureau (2017). “Population Analysis System (PAS) Software.” https://www.census.gov/data/software/pas.html, https://www.census.gov/data/software/pas.html.

Examples

# from PASEX AGESMTH
Ages         <- seq(0, 80, by = 5)
KKNtest <- c(NA,NA,354871,278502,285508,261429,236513 ,
204233,162138,126555,90094,65988,54803,41041,NA,NA,NA)

CFmales <- smooth_age_5_cf(pop5m_pasex, Ages, TRUE)
CFtest <- c(NA,NA,346290,287083,285855,261082,237937,
202809,162973,125720,88730,67352,55187,40657,NA,NA,NA)
all(round(CFmales) - CFtest == 0, na.rm = TRUE)
#> [1] TRUEif (FALSE) {
plot(Ages, pop5m_pasex)
lines(as.integer(names(CFmales)),CFmales)
}