kosukeimai / wru

Who Are You? Bayesian Prediction of Racial Category Using Surname and Geolocation
132 stars 31 forks source link

2010 block-level census data #147

Open ericmanning opened 7 months ago

ericmanning commented 7 months ago

Thanks for the bug fix for the census tables. Because the correct 2010 tabes for age and sex by race are only available at the tract level and up (the tables' prefix is PCT), requests for all 2010 block-level data yield tables with NAs (and a warning from each API call) after this fix -- even when age and sex args are FALSE. The package should probably (?) throw an error if block-level data is requested and either age OR sex is TRUE.

See, for example, the output of:

get_census_data(states = 'WY', age = F, sex = F, year = '2010', census.geo = 'block', county.list = list('WY' = '017'))

While it's not possible, therefore, to impute race with age and sex conditioning at the block level in the 2010 census, one could still do so at the block level if age and sex args are FALSE. The package would instead have to pull race/ethnicity totals from Table P5 in the 2010 SF1.

1beb commented 6 months ago

Thanks for this. I'm not sure what was done for 2010 at the block level. I will have to look at the previous releases to see.

31YY88 commented 2 months ago

Hi found myself struggling with the same problem, any update on this?