ageRatioTest | R Documentation |
Age ratio test is an age-related test of survey and data quality. In this test, the ratio of the number of children aged from 6 to 29 months to the number of children aged from 30 to 59 months is calculated. This ratio is then compared to an expected ratio (usually set at 0.85). The difference of the observed ratio to the expected ratio is then compared statistically using Chi-squared test.
ageRatioTest(x, ratio = 0.85)
x |
A vector of ages. Should either be in whole months (integer) or in calculated decimal months (numeric). |
ratio |
Expected age ratio. Default is 0.85. |
A lit of class "ageRatioTest"
with:
Variable | Description |
expectedR | Expected sex ratio |
expectedP | Expected proportion aged 6:29 months |
observedR | Observed sex ratio |
observedP | Observed proportion aged 6:29 months |
X2 | Chi-squared test statistic |
df | Degrees of freedom for Chi-squared test |
p | p-value for Chi-squared test |
# Age-ratio test on survey dataset from Kabul, Afghanistan (`dp.ex02`)
# with an age ratio of 0.85
svy <- dp.ex02
ageRatioTest(svy$age, ratio = 0.85)
# The age ratio test applied to data for each sex separately
by(svy$age, svy$sex, ageRatioTest, ratio = 0.85)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.