Skip to contents

Age heaping is the tendency to report children's ages to the nearest year or adults’ ages to the nearest multiple of five or ten years. Age heaping is very common. This is a major reason why data from nutritional anthropometry surveys is often analysed and reported using broad age groups.

Usage

ageHeaping(x, divisor = 12)

Arguments

x

Vector of ages

divisor

Divisor (usually 5, 6, 10, or 12); default is 12

Value

A list of class "ageHeaping" with:

VariableDescription
X2Chi-squared test statistic
dfDegrees of freedom or Chi-squared test
pp-value for Chi-squared test
tabTable of remainders (for x \%\% divisor)
pctTable of proportions (\%) of remainders for x \%\% divisor)

Examples

# Test for age heaping using SMART survey data in Kabul, Afghanistan (dp.ex02)
# using a divisor of 12
svy <- dp.ex02
ah12 <- ageHeaping(svy$age)
ah12
#> 
#> 	Age-heaping Analysis
#> 
#> data:	Remainder of svy$age / 12
#> X-squared = 214.9588, df = 11, p-value = 0.0000
#> 

# Test for age heaping using SMART survey data in Kabul, Afthanistan (dp.ex02)
# using a divisor of 6
ah6 <- ageHeaping(svy$age, divisor = 6)
ah6
#> 
#> 	Age-heaping Analysis
#> 
#> data:	Remainder of svy$age / 6
#> X-squared = 145.0275, df = 5, p-value = 0.0000
#>