<div>βThis book covers applications of R to the general discipline of radiation dosimetry and to the specific areas of luminescence dosimetry, luminescence dating, and radiation protection dosimetry. It features more than 90 detailed worked examples of R code fully integrated into the text, with ext
Analyzing US Census Data: Methods, Maps, and Models in R
β Scribed by Kyle Walker
- Publisher
- CRC Press/Chapman & Hall
- Year
- 2023
- Tongue
- English
- Leaves
- 378
- Series
- Chapman & Hall/CRC The R Series
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Census data are widely used by practitioners to understand demographic change, allocate resources, address inequalities, and make sound business decisions. Until recently, projects using US Census data have required proficiency with multiple web interfaces and software platforms to prepare, map, and present data products. This book introduces readers to tools in the R programming language for accessing and analyzing Census data, helping analysts manage these types of projects in a single computing environment.
Chapters in this book cover the following key topics:
β’ Rapidly acquiring data from the decennial US Census and American Community Survey using R, then analyzing these datasets using tidyverse tools;
β’ Visualizing US Census data with a wide range of methods including charts in ggplot2 as well as both static and interactive maps;
β’ Using R as a geographic information system (GIS) to manage, analyze, and model spatial demographic data from the US Census;
β’ Working with and modeling individual-level microdata from the American Community Surveyβs PUMS datasets;
β’ Applying these tools and workflows to the analysis of historical Census data, other US government datasets, and international Census data from countries like Canada, Brazil, Kenya, and Mexico.
Kyle Walker is an associate professor of geography at Texas Christian University, director of TCUβs Center for Urban Studies, and a spatial data science consultant. His research focuses on demographic trends in the United States, demographic data visualization, and software tools for open spatial data science. He is the lead author of a number of R packages including tigris, tidycensus, and mapboxapi.
β¦ Table of Contents
Cover
Half Title
Title Page
Copyright Page
Dedication
Contents
Preface
1. The US Census and the R programming language
1.1. Census data: an overview
1.2. Census hierarchies
1.3. How to find US Census data
1.3.1. Data downloads from the Census Bureau
1.3.2. The Census API
1.3.3. Third-party data distributors
1.4. What is R?
1.4.1. Getting started with R
1.4.2. Basic data structures in R
1.4.3. Functions and packages
1.4.4. Package ecosystems in R
1.5. Analyses using R and US Census data
1.5.1. Census data packages in R: a brief summary
1.5.2. Health resource access
1.5.3. COVID-19 and pandemic response
1.5.4. Politics and gerrymandering
1.5.5. Social equity research
1.5.6. Census data visualization
2. An introduction to tidycensus
2.1. Getting started with tidycensus
2.1.1. Decennial Census
2.1.2. American Community Survey
2.2. Geography and variables in tidycensus
2.2.1. Geographic subsets
2.3. Searching for variables in tidycensus
2.4. Data structure in tidycensus
2.4.1. Understanding GEOIDs
2.4.2. Renaming variable IDs
2.5. Other Census Bureau datasets in tidycensus
2.5.1. Using get_estimates()
2.5.2. Using get_flows()
2.6. Debugging tidycensus errors
2.7. Exercises
3. Wrangling Census data with tidyverse tools
3.1. The tidyverse
3.2. Exploring Census data with tidyverse tools
3.2.1. Sorting and filtering data
3.2.2. Using summary variables and calculating new columns
3.3. Group-wise Census data analysis
3.3.1. Making group-wise comparisons
3.3.2. Tabulating new groups
3.4. Comparing ACS estimates over time
3.4.1. Time-series analysis: some cautions
3.4.2. Preparing time-series ACS estimates
3.5. Handling margins of error in the American Community Survey with tidycensus
3.5.1. Calculating derived margins of error in tidycensus
3.5.2. Calculating group-wise margins of error
3.6. Exercises
4. Exploring US Census data with visualization
4.1. Basic Census visualization with ggplot2
4.1.1. Getting started with ggplot2
4.1.2. Visualizing multivariate relationships with scatter plots
4.2. Customizing ggplot2 visualizations
4.2.1. Improving plot legibility
4.2.2. Custom styling of ggplot2 charts
4.2.3. Exporting data visualizations from R
4.3. Visualizing margins of error
4.3.1. Data setup
4.3.2. Using error bars for margins of error
4.4. Visualizing ACS estimates over time
4.5. Exploring age and sex structure with population pyramids
4.5.1. Preparing data from the Population Estimates API
4.5.2. Designing and styling the population pyramid
4.6. Visualizing group-wise comparisons
4.7. Advanced visualization with ggplot2 extensions
4.7.1. ggridges
4.7.2. ggbeeswarm
4.7.3. Geofaceted plots
4.7.4. Interactive visualization with plotly
4.8. Learning more about visualization
4.9. Exercises
5. Census geographic data and applications in R
5.1. Basic usage of tigris
5.1.1. Understanding tigris and simple features
5.1.2. Data availability in tigris
5.2. Plotting geographic data
5.2.1. ggplot2 and geom_sf()
5.2.2. Interactive viewing with mapview
5.3. tigris workflows
5.3.1. TIGER/Line and cartographic boundary shapefiles
5.3.2. Caching tigris data
5.3.3. Understanding yearly differences in TIGER/Line files
5.3.4. Combining tigris datasets
5.4. Coordinate reference systems
5.4.1. Using the crsuggest package
5.4.2. Plotting with coord_sf()
5.5. Working with geometries
5.5.1. Shifting and rescaling geometry for national US mapping
5.5.2. Converting polygons to points
5.5.3. Exploding multipolygon geometries to single parts
5.6. Exercises
6. Mapping Census data with R
6.1. Using geometry in tidycensus
6.1.1. Basic mapping of sf objects with plot()
6.2. Map-making with ggplot2 and geom_sf
6.2.1. Choropleth mapping
6.2.2. Customizing ggplot2 maps
6.3. Map-making with tmap
6.3.1. Choropleth maps with tmap
6.3.2. Adding reference elements to a map
6.3.3. Choosing a color palette
6.3.4. Alternative map types with tmap
6.4. Cartographic workflows with non-Census data
6.4.1. National election mapping with tigris shapes
6.4.2. Understanding and working with ZCTAs
6.5. Interactive mapping
6.5.1. Interactive mapping with Leaflet
6.5.2. Alternative approaches to interactive mapping
6.6. Advanced examples
6.6.1. Mapping migration flows
6.6.2. Linking maps and charts
6.6.3. Reactive mapping with Shiny
6.7. Working with software outside of R for cartographic projects
6.7.1. Exporting maps from R
6.7.2. Interoperability with other visualization software
6.8. Exercises
7. Spatial analysis with US Census data
7.1. Spatial overlay
7.1.1. Note: aligning coordinate reference systems
7.1.2. Identifying geometries within a metropolitan area
7.1.3. Spatial subsets and spatial predicates
7.2. Spatial joins
7.2.1. Point-in-polygon spatial joins
7.2.2. Spatial joins and group-wise spatial analysis
7.3. Small area time-series analysis
7.3.1. Area-weighted areal interpolation
7.3.2. Population-weighted areal interpolation
7.3.3. Making small-area comparisons
7.4. Distance and proximity analysis
7.4.1. Calculating distances
7.4.2. Calculating travel times
7.4.3. Catchment areas with buffers and isochrones
7.4.4. Computing demographic estimates for zones with areal interpolation
7.5. Better cartography with spatial overlay
7.5.1. βErasingβ areas from Census polygons
7.6. Spatial neighborhoods and spatial weights matrices
7.6.1. Understanding spatial neighborhoods
7.6.2. Generating the spatial weights matrix
7.7. Global and local spatial autocorrelation
7.7.1. Spatial lags and Moranβs I
7.7.2. Local spatial autocorrelation
7.7.3. Identifying clusters and spatial outliers with local indicators of spatial association (LISA)
7.8. Exercises
8. Modeling US Census data
8.1. Indices of segregation and diversity
8.1.1. Data setup with spatial analysis
8.1.2. The dissimilarity index
8.1.3. Multi-group segregation indices
8.1.4. Visualizing the diversity gradient
8.2. Regression modeling with US Census data
8.2.1. Data setup and exploratory data analysis
8.2.2. Inspecting the outcome variable with visualization
8.2.3. βFeature engineeringβ
8.2.4. A first regression model
8.2.5. Dimension reduction with principal components analysis
8.3. Spatial regression
8.3.1. Methods for spatial regression
8.3.2. Choosing between spatial lag and spatial error models
8.4. Geographically weighted regression
8.4.1. Choosing a bandwidth for GWR
8.4.2. Fitting and evaluating the GWR model
8.4.3. Limitations of GWR
8.5. Classification and clustering of ACS data
8.5.1. Geodemographic classification
8.5.2. Spatial clustering & regionalization
8.6. Exercises
9. Introduction to Census microdata
9.1. What is βmicrodata?β
9.1.1. Microdata resources: IPUMS
9.1.2. Microdata and the Census API
9.2. Using microdata in tidycensus
9.2.1. Basic usage of get_pums()
9.2.2. Understanding default data from get_pums()
9.3. Working with PUMS variables
9.3.1. Variables available in the ACS PUMS
9.3.2. Recoding PUMS variables
9.3.3. Using variables filters
9.4. Public Use Microdata Areas (PUMAs)
9.4.1. What is a PUMA?
9.4.2. Working with PUMAs in PUMS data
9.5. Exercises
10. Analyzing Census microdata
10.1. PUMS data and the tidyverse
10.1.1. Basic tabulation of weights with tidyverse tools
10.1.2. Group-wise data tabulation
10.2. Mapping PUMS data
10.3. Survey design and the ACS PUMS
10.3.1. Getting replicate weights
10.3.2. Creating a survey object
10.3.3. Calculating estimates and errors with srvyr
10.3.4. Converting standard errors to margins of error
10.4. Modeling with PUMS data
10.4.1. Data preparation
10.4.2. Fitting and evaluating the model
10.5. Exercises
11. Other Census and government data resources
11.1. Mapping historical geographies of New York City with NHGIS
11.1.1. Getting started with NHGIS
11.1.2. Working with NHGIS data in R
11.1.3. Mapping NHGIS data in R
11.2. Analyzing complete-count historical microdata with IPUMS and R
11.2.1. Getting microdata from IPUMS
11.2.2. Loading microdata into a database
11.2.3. Accessing your microdata database with R
11.2.4. Analyzing big Census microdata in R
11.3. Other US government datasets
11.3.1. Accessing Census data resources with censusapi
11.3.2. Analyzing labor markets with lehdr
11.3.3. Bureau of Labor Statistics data with blscrapeR
11.3.4. Working with agricultural data with tidyUSDA
11.4. Getting government data without R packages
11.4.1. Making requests to APIs with httr
11.4.2. Writing your own data access functions
11.5. Exercises
12. Working with Census data outside the United States
12.1. The International Data Base and the idbr R package
12.1.1. Visualizing IDB data
12.1.2. Interactive and animated visualization of global demographic data
12.2. Country-specific Census data packages
12.2.1. Canada: cancensus
12.2.2. Kenya: rKenyaCensus
12.2.3. Mexico: combining mxmaps and inegiR
12.2.4. Brazil: aligning the geobr R package with raw Census data files for spatial analysis
12.3. Other international data resources
12.4. Exercises
Conclusion
Bibliography
Index
π SIMILAR VOLUMES
This advanced undergraduate/graduate textbook teaches students in finance and economics how to use R to analyse financial data and implement financial models. It demonstrates how to take publically available data and manipulate, implement models and generate outputs typical for particular analyses.
<p><p>This book is a comprehensive introduction to financial modeling that teaches advanced undergraduate and graduate students in finance and economics how to use R to analyze financial data and implement financial models. This text will show students how to obtain publicly available data, manipula
<p><span>Interactions between species are of fundamental importance to all living systems and the framework we have for studying these interactions is community ecology. This is important to our understanding of the planets biological diversity and how species interactions relate to the functioning
<p><span>Interactions between species are of fundamental importance to all living systems and the framework we have for studying these interactions is community ecology. This is important to our understanding of the planets biological diversity and how species interactions relate to the functioning