smooth_age_5_zigzag | R Documentation |
If age heaping is much worse on 0's than on 5's then even counts in 5-year age bins can preserve a sawtooth pattern. Most graduation techniques translate the zig-zag/sawtooth pattern to a wave pattern. It is not typically desired. This method redistributes counts 'from' every second 5-year age group in a specified range 'to' the adjacent age groups. How much to redistribute depends on a detection of roughness in the 5-year binned data, which follows the formulas recommended by Feeney. This method does not alter the total population count, counts in the youngest 10 ages, nor in old ages. 10-year age groups in the middle age range are not constrained.
smooth_age_5_zigzag(
Value,
Age,
OAG = TRUE,
ageMin = 40,
ageMax = max(Age) - max(Age)%%10 - 5
)
Value |
numeric vector of (presumably) counts in 5-year age groups. |
Age |
integer vector of age group lower bounds. |
OAG |
logical. Whether or not the top age group is open. Default |
ageMin |
integer. Lower age bound to adjust values. |
ageMax |
integer. Upper age bound to adjust values. |
This function calls smooth_age_5_zigzag_inner()
, but prepares data in a way consistent with other methods called by smooth_age_5()
. It is probably preferable to call zigzag()
from the top level, or else call this method from smooth_age_5()
for more control over tail imputations.
numeric vector of smoothed counts in 5-year age groups.
Feeney, G. 2013 "Removing "Zigzag" from Age Data," http://demographer.com/white-papers/2013-removing-zigzag-from-age-data/
Age <- c(0,1,seq(5,90,by=5))
# defaults
zz <- smooth_age_5_zigzag(dth5_zigzag, Age, OAG = TRUE, ageMin = 40, ageMax = 90)
## Not run:
plot(Age, dth5_zigzag)
lines(as.integer(names(zz)),zz)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.