Learn R Programming

nipnTK (version 0.2.0)

ageHeaping: Age-heaping analysis

Description

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)

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)

Arguments

x

A vector of ages. Should either be in whole months (integer) or in calculated decimal months (numeric).

divisor

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

Examples

Run this code
# 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

# 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

Run the code above in your browser using DataLab