Calculating group-wise margins of error
One way to reduce margins of error in an ACS analysis is to combine estimates when appropriate. This can be accomplished using tidyverse group-wise data analysis tools. In this exercise, you'll combine estimates for male and female elderly poverty in Vermont, and use the moe_sum() function as part of this group-wise analysis. While you may lose some detail with this type of approach, your estimates will be more reliable relative to their margins of error than before you combined them.
Este exercício faz parte do curso
Analyzing US Census Data in R
Instruções do exercício
- Group the
vt_eldpovdataset by the GEOID column. - In the
summarize()call, use themoe_sum()function to calculate a derived margin of error. - Check the proportion of rows with margins of error that exceed their estimates.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Group the dataset and calculate a derived margin of error
vt_eldpov2 <- vt_eldpov %>%
___(___) %>%
summarize(
estmf = sum(estimate),
moemf = ___(___ = moe, estimate = estimate)
)
# Filter rows where newly-derived margin of error exceeds newly-derived estimate
moe_check2 <- filter(vt_eldpov2, ___ > estmf)
# Check proportion of rows where margin of error exceeds estimate
nrow(moe_check2) / ___(vt_eldpov2)