Closed ericmanning closed 8 months ago
Might be related to #138
Thank you, getting these tables right is a challenge sometimes. I'm checking in with the team on this one.
The Census Bureau did not publish the P12J through P12O information in any summary file for the 2010 census. So if my suggestion is correct, then you can't actually tabulate age and sex by block and H/L and race for 2010.
Correct, we need to setup warnings so that people use an older version of the package as it's not backwards compatible with pre-2020.
FWIW, the package has always used the current set of variables for sex and age, which are incorrect -- so (correct me if I'm wrong) any version will produce inaccurate estimates for 2010 if age OR sex is TRUE
From wru-0.1-12/R/census_geo_api.R
,
if (age == F & sex == F) {
num <- ifelse(3:10 != 10, paste("0", 3:10, sep = ""), "10")
vars <- paste("P0050", num, sep = "")
}
if (age == F & sex == T) {
eth.let <- c("I", "B", "H", "D", "E", "F", "C")
num <- as.character(c("01", "02", "26"))
vars <- NULL
for (e in 1:length(eth.let)) {
vars <- c(vars, paste("P012", eth.let[e], "0", num, sep = ""))
}
}
if (age == T & sex == F) {
eth.let <- c("I", "B", "H", "D", "E", "F", "C")
num <- as.character(c(c("01", "03", "04", "05", "06", "07", "08", "09"), seq(10, 25), seq(27, 49)))
vars <- NULL
for (e in 1:length(eth.let)) {
vars <- c(vars, paste("P012", eth.let[e], "0", num, sep = ""))
}
}
if (age == T & sex == T) {
eth.let <- c("I", "B", "H", "D", "E", "F", "C")
num <- as.character(c(c("01", "03", "04", "05", "06", "07", "08", "09"), seq(10, 25), seq(27, 49)))
vars <- NULL
for (e in 1:length(eth.let)) {
vars <- c(vars, paste("P012", eth.let[e], "0", num, sep = ""))
}
}
Why are race totals assigned by the following variables
which correspond to the following Census tables
and not the following tables' variables instead?
Using the former yields aggregate population counts that exceed the population total for each geography because it ought to double-count non-white Hispanic or Latino individuals. The latter yields matching counts.