Publications by Corey Sparks, PhD
IPUMS - NHIS Mortality Example
IPUMS - NHIS Mortality Example CodeShow All CodeHide All CodeView Source Author Corey Sparks, PhD This example is intended to show the basics of coding mortality and censoring using the IPUMS NHIS mortality data. Read in IPUMS IHIS extract Code library(tidyverse) ── Attaching packages ─────────────────...
1401 sym Python (6679 sym/17 pcs) 5 img
DEM 7283: Longitudinal Models for Change using Generalized Estimating Equations
In this example, we will use Generalized Estimating Equations to do some longitudinal modeling of data from the ECLS-K 2011. Specifically, we will model changes in a student’s standardized math score as a continuous outcome and self rated health as a binomial outcome, from fall kindergarten to spring, 1st grade. Introduction to GEE’s Up unti...
8747 sym R (20617 sym/79 pcs) 4 img 1 tbl
CPS Unemployment Rate - COVID
library(ipumsr) library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(car) ## Loading required package: carData ## ## Attaching package: 'car' ## The following...
9 sym R (3737 sym/40 pcs) 1 img
DEM 7283 - Principal Components Analysis
This example illustrates the use of the method of Principal Components Analysis to form an index of overall health using data from the 2016 CDC Behavioral Risk Factor Surveillance System (BRFSS) SMART MSA data. Link Principal Components is a mathematical technique (not a statistical one!) based off the eigenvalue decomposition/singular value deco...
8568 sym R (15728 sym/36 pcs) 6 img
DEM 7093 - Using IPUMS for Estimation of Population Characteristics in Various Geographic Areas
In this example we will use the IPUMS USA data to produce survey-based estimates for various geographic levels present in the IPUMS. This example uses the 2014-2018 ACS 5-year microdata. library(ipumsr) ## Registered S3 methods overwritten by 'ipumsr': ## method from ## format.pillar_shaft_haven_labelled_chr h...
868 sym R (6886 sym/33 pcs) 10 img
DEM 5093/7093 Point Pattern Analysis
This example shows how to use R and QGIS from within R to perform a series of common point pattern analysis techniques. library(mapview) library(sf) ## Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3 library(censusxy) addr<-read.csv(url("https://raw.githubusercontent.com/coreysparks/data/master/wic_west_side.csv")) addr<-addr[c(6, 12:14)] names(...
348 sym R (19751 sym/77 pcs) 2 img
Geocoding in R using Census Geocoder
In this example, we will geocode addresses using the Census Bureau’s batch geocoding service. The work will be done by the censusxy package. Read in the address data We will use the from the CSV created in the Lab 3 exercise. addr<-read.csv(url("https://raw.githubusercontent.com/coreysparks/data/master/wic_west_side.csv")) addr<-addr[c(6, 12:...
301 sym R (1302 sym/10 pcs)
Bexar county population
library(ggplot2) library(tidycensus) library(tigris) library(dplyr) library(mapview) bex_tract<-get_acs(geography="tract", state = "TX", county = "Bexar", year=2018,variables = c("DP05_0078PE","DP05_0071PE"), output = "wide", geometry = T) ## Getting data from the 2014-2018 5-year ACS ## Downloading feature geometry from the Census website. To c...
107 sym R (2062 sym/10 pcs) 2 img
Bexar County Education Ratio
This example shows how to calculate an index of education segregation for Bexar County, TX using data from the 2018 American Community Survey Some measures of economic segregation are calculated by the Census bureau directly, in the American Community Survey, the Census provides the Gini Index of income inequality for many geographies. This measu...
1837 sym R (1611 sym/10 pcs) 2 img
Bexar County Income Ratio
This example shows how to calculate an index of income segregation for Bexar County, TX using data from the 2018 American Community Survey Some measures of economic segregation are calculated by the Census bureau directly, in the American Community Survey, the Census provides the Gini Index of income inequality for many geographies. This measure ...
1850 sym R (1517 sym/9 pcs) 2 img