smooth_age_5_feeney: Feeney'S formula on 9 years to correct for heaping on...

View source: R/smooth_age_5.R

smooth_age_5_feeneyR Documentation

Feeney'S formula on 9 years to correct for heaping on multiples of 5.

Description

Fenney's technique for correcting age distributions for heaping on multiples of five.

Usage

smooth_age_5_feeney(Value, Age, maxit = 200, OAG = FALSE)

Arguments

Value

numeric. A vector of demographic counts in single age groups.

Age

numeric or character. A vector with ages in single years.

maxit

integer. Maximum number of iterations.

OAG

logical. Is the final age group open? Default FALSE.

Details

Value can be given in single or 5-year age groups.

Value

a vector of adjusted counts in 5-year age groups

References

\insertRef

feeney1979DemoTools

Examples

# data from feeney1979, Table 1, page 12: Population of Indonesia, 22 provinces,
# by single year of age: Census of 24 September 1971.
 Pop        <- c(2337,3873,3882,3952,4056,3685,3687,3683,3611,3175,
         3457,2379,3023,2375,2316,2586,2014,2123,2584,1475,
         3006,1299,1236,1052,992,3550,1334,1314,1337,942,
         3951,1128,1108,727,610,3919,1221,868,979,637,
         3409,887,687,533,313,2488,677,426,524,333,
         2259,551,363,290,226,1153,379,217,223,152,
         1500,319,175,143,89,670,149,96,97,69,
         696,170,60,38,23,745)
 Ages       <- c(0:75)
 result     <- smooth_age_5_feeney(Pop, Ages, OAG = TRUE)
 A5         <- names2age(result)
 V5         <- groupAges(Pop,Ages)
 ## Not run: 
 plot(Ages, Pop, type= 'l')
 segments(A5,
	  result/5,
	  A5+5,
	 result/5,
		 col = "red")
segments(A5,
	 V5/5,
	 A5+5,
	 V5/5,
	 col = "blue")
 legend("topright",col=c("black","blue","red"),
   lty=c(1,1,1),
   legend=c("recorded 1","recorded 5","corrected 5"))

## End(Not run)

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