1

Pretty simple problem, I think, but not sure of the proper solution. Have done some research on this and think I recall seeing a solution somewhere, but cannot remember where...anyway,

Want to get DP03, one-year acs data for all Ohio counties, year 2019. However, The code below only accesses 39 of Ohio's 88 counties. How can I access the remaining counties?

My guess is that data is only being pulled for counties with populations greater than 60,000.

library(tidycensus)
library(tidyverse)


acs_2019 <- load_variables(2019, dataset = "acs1/profile")

DP03 <- acs_2019 %>% 
  filter(str_detect(name, pattern = "^DP03")) %>% 
  pull(name, label)

Ohio_county <- 
  get_acs(geography = "county",
          year = 2019,
          state = "OH",
          survey = "acs1",
          variables = DP03,
          output = "wide")

This results in a table that looks like this...

Ohio_county
# A tibble: 39 x 550
   GEOID NAME  `Estimate!!EMPL~ `Estimate!!EMPL~ `Estimate!!EMPL~ `Estimate!!EMPL~ `Estimate!!EMPL~
   <chr> <chr>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>
 1 39057 Gree~           138295              815           138295               NA            87465
 2 39043 Erie~            61316              516            61316               NA            38013
 3 39153 Summ~           442279             1273           442279               NA           286777
 4 39029 Colu~            83317              634            83317               NA            48375
 5 39099 Maho~           188298              687           188298               NA           113806
 6 39145 Scio~            60956              588            60956               NA            29928
 7 39003 Alle~            81560              377            81560               NA            49316
 8 39023 Clar~           108730              549           108730               NA            64874
 9 39093 Lora~           250606              896           250606               NA           150136
10 39113 Mont~           428140              954           428140               NA           267189

Pretty sure I've seen a solution somewhere, but cannot recall where.

Any help would be appreciated since it would let the office more easily pull census data rather than wading through the US Census Bureau site. Best of luck and Thank you!

James Crumpler
  • 192
  • 1
  • 8
  • 1
    It looks like the data you are trying to access is not available for all Ohio counties. I get this message when I run your code: `The one-year ACS provides data for geographies with populations of 65,000 and greater.` So, I don't think it has anything to do with a difference between the data available via the API versus browsing the site. – qdread Dec 02 '20 at 14:49
  • A colleague already pulled all the information...I assume it was pulled using the ACS1. It certainly is all data related to the DP03 variables. This makes me think it exists, though it was mentioned that the methodology used was a little complicated. – James Crumpler Dec 02 '20 at 15:20
  • I assume you are referring to the [ACS supplemental tables](https://www.census.gov/acs/www/data/data-tables-and-tools/supplemental-tables/) which have data at a population threshold of 20,000, not 65,000. In tidycensus you can see the available variables by calling `load_variables(2019, dataset = 'acsse')` – qdread Dec 02 '20 at 15:30
  • Alright, double checked with co-worker. A combination of function and tables were called within the analysis such as population (which I verified through the get_estimates function, some acsse data for populations less than 65k, and some from the S0101 series? ) Broadly, it seems my question was far more narrow than the actual analysis performed. Think your initial assessment was right. Though what dataset has the S0101 tables? – James Crumpler Dec 02 '20 at 18:52
  • 1
    S0101 is individual-level so it is the `acs1/subject` data. – qdread Dec 02 '20 at 19:07

1 Answers1

0

My colleague, who already pulled the data, did not specify whether or not the DP03 data came from the ACS 1 year survey or the ACS 5 year survey. As it turns out, it was from the ACS 5 year survey, which includes all Ohio counties, not just those counties over 65,000 population. Follow comments above for a description of how this answer was determined.

Code for all counties is here

library(tidycensus)
library(tidyverse)

acs_2018 <- load_variables(2018, dataset = "acs5/profile")


DP03 <- acs_2019 %>% 
  filter(str_detect(name, pattern = "^DP03")) %>% 
  pull(name)

Ohio_county <- 
  get_acs(geography = "county",
          year = 2018,
          state = "OH",
          survey = "acs5",
          variables = DP03,
          output = "wide")
James Crumpler
  • 192
  • 1
  • 8