datalab-dev / graves-endocrine_surgeons

Claire Graves' 2022 collaboration to identify access to endocrine surgery centers
GNU General Public License v3.0
1 stars 1 forks source link

Transportation Census Variable Missing Data #29

Closed MicheleTobias closed 1 year ago

MicheleTobias commented 1 year ago

The estimate_population.R file is returning reasonable results for all of the variables, except that the transportation variable is returning all zeros. We need to investigate why that is happening. Some ideas: Is it that we can't get this variable at the tract level? Is there something missing from the request? Is it something wrong with the TidyCensus package (if so, we should report the bug when we figure it out)?

As a backup plan, is there a different source for the transportation data, like getting the tables directly from the census?

alisonsnwong commented 1 year ago

I loaded the transportation variable from get_acs() in the tract level and block group level separately and all variables for all GEOID returned NA values.

According to the census reporter website, the data from the B08406 table (transportation) is only available country-wide at the county level. I tried anything smaller than that and there are no data for it, so getting the tables directly from the census won't be an option as well.

https://censusreporter.org/data/table/?table=B08406&geo_ids=050|01000US&primary_geo_id=05000US06113#valueType|estimate

alisonsnwong commented 1 year ago

I will start looking at other sources of transportation data.

alisonsnwong commented 1 year ago

B08101_001 - B08101_056 variables: MEANS OF TRANSPORTATION TO WORK BY AGE.

These variables show results at the tract level and it is divided by age for each type of transportation. We can use the total age rows (includes all ages) for each transportation type for our analysis.

MicheleTobias commented 1 year ago

Thanks for investigating this! Looks like you found a good solution to work with the data we can get. I agree that county-level data isn't very useful here - compare San Bernardino County in CA with any county on the east coast!

alisonsnwong commented 1 year ago

Yeah, no problem. I added the new variables in the census_variables.csv.

MicheleTobias commented 1 year ago

Does the new data require any different analysis to aggregate the data the way we need it or does TidyCensus handle that automatically?

alisonsnwong commented 1 year ago

The new variables are on the same ACS 5-year data table so Tidycensus can handle it automatically as well, along with the other variables.

MicheleTobias commented 1 year ago

I believe we have solved this issue, but if not, please reopen it and add more information.