Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting...

57
Hack the Census: Census Tools for Developers 20 th Annual New Mexico Data User’s Conference November 15, 2018 Presented by: Eric Coyle Data Dissemination Specialist U.S. Census Bureau

Transcript of Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting...

Page 1: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Hack the Census: Census Tools for Developers

20th Annual New Mexico Data User’s Conference November 15, 2018

Presented by: Eric CoyleData Dissemination SpecialistU.S. Census Bureau

Page 2: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

American Community Survey• Overview• Geography

Census Bureau Application Programming Interface (API)• API Basics• Using the API• Building an API Request• API Demo• Resources for Learning More

Additional Tools & Resources

Q&A

Agenda

2

Page 3: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

The American Community Survey Overview

3

Page 4: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

The American Community SurveyThe Foundation

The American Community Survey (ACS) is on the leading edge of survey design, continuous improvement, and data quality

• The nation’s most current, reliable, and accessible data source for local statistics on critical planning topics such as age, children, veterans, commuting, education, income, and employment

• Surveys 3.5 million households and informs over $675 billion of Federal government spending each year

• Visit 20,000 Group Quarter facilities and sample approximately 194,000 residents each year

• Covers 35+ topics, supports over 300 evidence-based Federal government uses, and produces 11 billion estimates each year

• Three key annual data releases:

• 1-year Estimates (for large populations)

• 1-year Supplemental Estimates (for small populations)

• 5-year Estimates (for very small populations)

4

Page 5: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

ACS vs. 2010 CensusHow is the ACS Different from the Census?

5

ACS 2010 and 2020 Census

purpose Sample estimates Official counts

produces Population characteristics Population totals

new data every Year 10 years

data reflect Period of time Point in time

Collects Information previously on the census “long form” “Short form” information

Page 6: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

The American Community SurveyContent Overview

AncestryCitizenshipDisabilityEducational AttainmentFertilityGrandparentsLanguageMarital StatusMigrationSchool EnrollmentVeterans

Class of Worker CommutingEmployment StatusFood Stamps (SNAP)Health InsuranceHours/Week, Weeks/YearIncomeIndustry & Occupation

AgeHispanic OriginRaceRelationshipSex

POPULATION

SOCIAL DEMOGRAPHIC

ECONOMIC

Computer & Internet UseCosts (Mortgage, Taxes, Insurance)Heating Fuel Home ValueOccupancyPlumbing/Kitchen FacilitiesStructureTenure (Own/Rent)UtilitiesVehiclesYear Built/ Year Moved In

HOUSING

6

Page 7: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

7

The American Community SurveyAvailability of ACS Data Products

Estimated Population of Geographic Area

2017 1-Year Estimates2017 1-Year Supplemental

Estimates 2013-2017 5-Year Estimates

65,000 or more X X X

20,000 to 64,999 X X

Less than 20,000 X

Release Date September 13, 2018 October 18, 2018 December 6, 2018

Page 8: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Census Geography

8

Page 9: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Selected Census Geographic Concepts—Statistical Areas

• Regions

• Divisions

• Census County Divisions

• Census Designated Places

• Public Use Microdata Areas (PUMA)

• Zip Code Tabulation Areas (ZCTAs)

• Census Tracts

• Block Groups

• Block

9

Source: U.S. Census Bureau, 2012-2016 American Community Survey 5-Year Estimates

Hispanic or Latino Origin by Race by Census Tracts in Bernalillo County

Page 10: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Census Geography Hierarchy

10

• 1,200 to 8,000 population (optimum 4,000)

• 480 to 3,200 housing units

• 600 to 3,000

population

• 240 to 1,200

housing units

Central axis describes

a nesting relationship

• Cities and towns -- incorporated

• Census Designated Places (CDPs):

- - Unincorporated; no size threshold

- - Separate and distinct from city/town

- - Redefined each censusBlocks are not defined by population

and are the smallest geographic level

at which data are ever released

(Decennial Census, not the ACS)

Page 11: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

API Basics

11

Page 12: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Types of ACS Tables in API

• Detailed Tables (B or C)• Subject Tables (S)

• Most detailed ACS statistics• Each table covers one primary topic• May contain cross tabulationsDescription

Types In API

• Data Profiles (DP) - includes %• Comparison Profiles (CP) -

includes statistical significance

• Most common ACS statistics• Derived from tables• Each profile covers manytopicsDescription

12

TypesIn API

Tables Profiles

Page 13: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Table/Profile Numbering

• B=Data Product Type (Base Table)• 06=Subject (Place of Birth)• 004=Sequential Number (2 or 3 digits)• A=Race/Hispanic Origin (White Alone)• PR=For Puerto Rico Geographies Only

B06004APR

13

census.gov/programs-surveys/acs/guidance/which-data-tool/table-ids-explained.html

Page 14: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

The Census Data API

14

• Application Programming Interface

• Data Service

• Enables Census Bureau data providers to expose data in a standardized way

• Gives software developers the ability to create custom apps

• Allows data scientists more flexibility to develop data analytics

Page 15: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Advantages

15

• Reduces the learning curve by standardizing across multiple datasets

• Access only the variables, geographies and table cells needed

• No need to host data on another server

• Gives immediate access to most current data

• No complex interface

Page 16: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Uses

16

• Supports mobile and web applications

• Drives interactive data visualizations

• Connects to statistical analysis software like R

Page 17: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

API: Examples of Use

• Census Business Builder

• Cleargov

• Cornell University Poverty Map

• My Congressional District

• My Tribal Area

• PennState SDC Dashboards

census.gov/data/developers/app-gallery

17

Page 18: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Using the API

18

Page 19: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Example: American Community Surveydata.census.gov

19

Page 20: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Output

20

https://api.census.gov/data/2016/acs/acs5?get=NAME,B17001_002E,B17001_002M&for=state:*

Returns data in json format that looks like this:

[["NAME","B17001_002E","B17001_002M","state"],["Alabama","868666","11290","01"],["Alaska","72826","2617","02"],["Arizona","1165636","11825","04"],["Arkansas","542431","8531","05"],

Continued…

Page 21: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Building an API Request

21

Page 22: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

API Request –Four Easy Steps

1Identify thedataset youwant to use

2 Identify itemsneeded

Variablenames

Geography codes

(usually FIPS)

22

https://api.census.gov/data.html

https://www.census.gov/developers

Page 23: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

API Request –Four Easy Steps

3Request the

variables and geographies

?get=variable,names,

separated,by,commas

&for=geographylevel:code

4 Put it all together

https://api.census.gov/data/ 2016/acs/acs5?get=NAME,

B17001_002E,B17001_002M&for=state:*

23

Page 24: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Example: American Community Surveydata.census.gov

24

Page 25: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

API Discovery Toolhttps://api.census.gov/data.html

25

Page 26: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Start Your Data Request

https://api.census.gov/data/2016/acs/acs5?get= NAME,B17001_002E,B17001_002M&for=state:*

Requests always begin with:https://api.census.gov/data1

26

Page 27: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Add the Dataset Name

https://api.census.gov/data/2016/acs/acs5?get= NAME,B17001_002E,B17001_002M&for=state:*

Find the dataset name at: https://api.census.gov/data/ 2016.html

2

27

Page 28: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

https://api.census.gov/data/2016/acs/acs5.html

28

Page 29: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Start Your Variable Request

https://api.census.gov/data/2016/acs/acs5?get= NAME,B17001_002E,B17001_002M&for=state:*

Always start your variablerequest with ?get=3

29

Page 30: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Add Your Variables

https://api.census.gov/data/2016/acs/acs5?get=NAME,B17001_002E,B17001_002M&for=state:*

Find the variables you wanthere:

https://api.census.gov/ data/2016/acs/acs5/ variables.html

4

30

Page 31: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

https://api.census.gov/data/2016/acs/acs5/variables.html

31

Page 32: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Add Your Geography

https://api.census.gov/data/2016/acs/acs5?get= NAME,B17001_002E,B17001_002M&for=state:*

Find available geographieshere:

https://api.census.gov/data/2016/acs/acs5/geography.html

5

32

Page 33: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

https://api.census.gov/data/2016/acs/acs5/geography.html

33

Page 34: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Put it all Together

https://api.census.gov/data/2016/acs/acs5?get= NAME,B17001_002E,B17001_002M&for=state:*

Returns data in json format6

34

Page 35: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Output

35

• https://api.census.gov/data/2016/acs/acs5

• ?get=NAME,B17001_002E,B17001_002M&for=state:*

• [["NAME","B17001_002E","B17001_002M","state"],

• ["Alabama","868666","11290","01"],• ["Alaska","72826","2617","02"],

• ["Arizona","1165636","11825","04"],

• ["Arkansas","542431","8531","05"],

• Continued…

Page 36: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Groups Functionality

36

• Pull More Than 50 Variables with One Call

• Groups for 2016 ACS5

https://api.census.gov/data/2016/acs/acs5/groups.html

• Example for ACS5: Group B17001

https://api.census.gov/data/2016/acs/acs5?get=group(B17001)&for=us:*

• All variable names will appear first followed by all the values in the output

Page 37: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Stay Connected: The Developers Pagewww.census.gov/developers/

37

Page 38: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Available APIs for ACSwww.census.gov/data/developers/data-sets.html

38

Page 39: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Available APIs for ACS

39

• ACS 1-Year Data (2011-2017)

• ACS 3-Year Data (2012-2013)

• ACS 5-Year Data (2009-2016)

• ACS Migration Flows (2009-2015)

• Supplemental (2014-2017)

Page 40: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

API Demo

40

Page 41: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Live Demo

41

• For all counties in New Mexico, what percent of people/households:

– Have a disability

– Have income below the poverty level

– Do not have a vehicle at home

Page 42: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Resources for Learning More

42

Page 43: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

ACS Website

census.gov/acs

43

Page 44: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

New/Modified/Deleted Tables

census.gov/programs-surveys/acs/technical-documentation/table-and-geography-changes

44

Page 45: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Visualizing Table/Variable Changes

B28002_004E

20152016

45

Page 46: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Benefits of API Compared to American FactFinder or Summary File

• Get the exact variables and geographies you need

• Quickly update queries to get data across years: Mostvariables are consistent from year to year

• Easily merge results: List of geographies is consistent within aparticular ACS dataset in the API

Example: Table B07012 “All Parishes in Louisiana”

46

Page 47: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Accessing Census Data

47

Page 49: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Additional Tools & Resources

49

Page 50: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Statistics in Schools

50

Search entire SIS site

census.gov/schools

Page 51: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Receive weekly Data Gems.These short “how-to” videos are an easy and quick way to increase your knowledge of Census data. Get them in your inbox!

Get access to our data courses.You will learn-at-your-own-pace with these video-tutorials designed for different skill levels.

Interact with our instructors via webinars. Learn about our data releases and tools while attending these live virtual classes.

Bring our data experts to you.Request free workshops and webinars for your organization: [email protected]

Take part in this communityShare your feedback and ideas for our educational content:[email protected]

Census.gov/Academy: Visit and Subscribe

https://census.gov/academy

51

Page 52: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Preview New Data Dissemination onData.census.gov

*For official statistics, continue to use existing data tools on census.gov, such as American

FactFinder

52

Page 53: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

The latest news releases and

statements from the U.S.

Census Bureau. Also, find

upcoming events, and useful

information for mediacensus.gov/newsroom.html

Featured stories on various

topics such as families,

housing, employment,

business, education, the

economy, emergency

preparedness, and populationcensus.gov/AmericaCounts

Stay Current

This blog gives the director's

point of view on everything from

Census Bureau news to how we

measure America's people,

places and economy. census.gov/newsroom/blogs/direct

or.html

Provides links to timely story

ideas highlighting the Census

Bureau's newsworthy statistics

that relate to current events,

observances, holidays, and

anniversariescensus.gov/newsroom/stories.html

census.gov/newsroom/facts-for-features.html

NEWSROOM

AMERICA COUNTS

DIRECTOR’S BLOG

STATS FOR STORIES

53

Page 54: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Sign up for and manage alerts athttps://public.govdelivery.com/acco

unts/USCENSUS/subscriber/new

More information on the

American Community Survey: https://www.census.gov/acs

Stay Connected

Census (Non-media inquiries)

800-923-8282

Public Information Office (Media)

301-763-3030

facebook.com/uscensusbureau

twitter.com/uscensusbureau

youtube.com/user/uscensusbureau

instagram.com/uscensusbureau/

pinterest.com/uscensusbureau/

linkedin.com/company/us-census-bureau

54

Page 55: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Your story

Your outcome

Your data details

To tell us your story, visit:census.gov/acs/www/share-your-story/index.php

The American Community SurveyData Tell Stories. Tell Us Yours!

55

Page 56: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

U.S. Census Bureau

Data Dissemination Specialist

Eric Coyle(702) 236-3202

[email protected]

Additional Assistance:

Toll-free number:1-844-ASK-DATA (1-844-275-2342)

[email protected]

Additional Resources:Want Free Training?Need Local Stats?

56

Page 57: Hack the Census: Census Tools for Developers · 11/15/2018  · Welcome and Overview of Meeting Objectives Meeting of Data Products Redesign Group and American Community Survey Steering

Q&A and Thank You!

57