Image from Maricopa Community College
This project continues with data from the United States Department of Agriculture (USDA)’s Food Access Research Atlas (FARA) database which was used for Project 2. Information for this database comes from the 2010 Census Population and Housing with some data aggregated at the census tract level.The original data set includes over 147 variables.
The database contains information about access to grocery stores, supermarkets and other sources of healthy foods in the United States. It also contains indicators for food access based on demographics and socioeconomic factors. The USDA measures access using distance to stores or by number of stores, as well as individual resources (income, car) and neighborhood level resources (public transportation).
Access to good quality food is linked to health outcomes as well as academic outcomes. Research on the links between race and food access are mixed (Alviola 2013). Alviola and colleagues found no evidence that urban areas in Arkansas with larger populations of racial and ethnic minorities are more likely to have lower access to grocery stores. In analysis of distance and travel time in Seattle, Washington, Ware (2021) and colleagues found that across racial groups income was mixed in its relation to distance with income not always imply a shorter distance.
This project aims to examine what,if any, patterns exist along racial lines in terms of populations that are considered low access at 1 mile and low income for Maryland residents in 2010. The variables that will be used for this analysis include census tract, county, urban/rural designation, population, poverty rate, median family income, racial breakdown of tract, as well as the share of racial groups living more than one mile from the nearest supermarket, supercenter, or large grocery store.
I chose this topic because I am a Maryland resident who is interested in health and nutrition and ensuring equitable access to healthy and nutritious foods.
| Variable | Description |
|---|---|
| Census tract | Numeric, Census tract code |
| State | Character, State name |
| County | Character, name of county |
| Urban | Numeric, Indicator for whether the tract is an urban tract |
| POP2010 | Numeric, Tract population in 2010 |
| P overtyRate | Numeric, Share of the population living below the federal poverty rate. |
| MedianFami lyIncome | Numeric, Median family income for the tract |
lalowi1, lalo wi1share |
Numeric, Number of low-income people with low access (at 1 mile), Numeric, Share of low -income people with low access (at 1 mile ) |
lalowi1 lawhite1 lablack1 laasian1 lanhopi1 laaian1 laomultir1 lahisp1 lahunv1 lasnap1
|
Numeric, Number of people that are low-income who have low access at 1 mile Numeric, Number of people that are White who have low access at 1 mile Numeric, Number of people that are Black who have low access at 1 mile Numeric, Number of people that are Asian who have low access at 1 mile Numeric, Number of people that are Native Hawaiian or Other Pacific Islanders who have low access at 1 mile Numeric, Number of people that are American Indian or Alaskan Native who have low access at 1 mile Numeric, Number of people that are Multiracial who have low access at 1 mile Numeric, Number of people that are Hispanic who have low access at 1 mile Numeric, Number of housing units without a vehicle who have low access at 1 mile Numeric, Number of housing receiving Supplemental Nutrition Assistance Program (SNAP) benefits who have low access at 1 mile |
lalowi1 lawhite1 lablack1 laasian1 lanhopi1 laaian1 laomultir1 lahisp1 lahunv1 lasnap1 |
Numeric, Number of people that are low-income who have low access at 1 mile Numeric, Number of people that are White who have low access at 1 mile Numeric, Number of people that are Black who have low access at 1 mile Numeric, Number of people that are Asian who have low access at 1 mile Numeric, Number of people that are Native Hawaiian or Other Pacific Islanders who have low access at 1 mile Numeric, Number of people that are American Indian or Alaskan Native who have low access at 1 mile Numeric, Number of people that are Multiracial who have low access at 1 mile Numeric, Number of people that are Hispanic who have low access at 1 mile Numeric, Number of housing units without a vehicle that have low access at 1 mile Numeric, Number of housing receiving Supplemental Nutrition Assistance Program (SNAP) benefits that have low access at 1 mile |
lalow1share l awhite1share l ablack1share l aasian1share l anhopi1share laaian1share lao multir1share lahisp1share lahunv1share lasnap1share
|
Numeric, Share of people that are low-income who have low access at 1 mile Numeric, Share of people that are White who have low access at 1 mile Numeric, Share of people that are Black who have low access at 1 mile Numeric, Share of people that are Asian who have low access at 1 mile Numeric, Share of people that are Native Hawaiian or Other Pacific Islanders who have low access at 1 mile Numeric, Share of people that are American Indian or Alaskan Native who have low access at 1 mile Numeric, Share of people that are Multiracial who have low access at 1 mile Numeric, Share of people that are Hispanic who have low access at 1 mile Numeric, Share of housing units without a vehicle that have low access at 1 mile Numeric, Share of housing receiving Supplemental Nutrition Assistance Program (SNAP) benefits that have low access at 1 mile |
| lo wincometracts | Numeric, number of tracts that are low-income |
library(RColorBrewer)
library(tidyverse)
library(GGally)
library(plotly)
library(car)
df <- read_csv("food_access_research.csv")
View(df)
names(df) <- tolower(names(df)) #making all headers lower case
names(df) <- gsub(" ","",names(df)) #removing spaces between header names
head(df)
## # A tibble: 6 × 147
## censustract state county urban pop2010 ohu2010 group…¹ numgq…² pctgq…³ lilat…⁴
## <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1001020100 Alab… Autau… 1 1912 693 0 0 0 0
## 2 1001020200 Alab… Autau… 1 2170 743 0 181 0.0834 0
## 3 1001020300 Alab… Autau… 1 3373 1256 0 0 0 0
## 4 1001020400 Alab… Autau… 1 4386 1722 0 0 0 0
## 5 1001020500 Alab… Autau… 1 10766 4082 0 181 0.0168 0
## 6 1001020600 Alab… Autau… 1 3668 1311 0 0 0 0
## # … with 137 more variables: lilatracts_halfand10 <dbl>,
## # lilatracts_1and20 <dbl>, lilatracts_vehicle <dbl>, hunvflag <dbl>,
## # lowincometracts <dbl>, povertyrate <dbl>, medianfamilyincome <dbl>,
## # la1and10 <dbl>, lahalfand10 <dbl>, la1and20 <dbl>, latracts_half <dbl>,
## # latracts1 <dbl>, latracts10 <dbl>, latracts20 <dbl>,
## # latractsvehicle_20 <dbl>, lapop1_10 <dbl>, lapop05_10 <dbl>,
## # lapop1_20 <dbl>, lalowi1_10 <dbl>, lalowi05_10 <dbl>, lalowi1_20 <dbl>, …
The data set required minimal cleaning. Any cleaning involved transforming the names of variables from upper to lower case.
names(df)
## [1] "censustract" "state" "county"
## [4] "urban" "pop2010" "ohu2010"
## [7] "groupquartersflag" "numgqtrs" "pctgqtrs"
## [10] "lilatracts_1and10" "lilatracts_halfand10" "lilatracts_1and20"
## [13] "lilatracts_vehicle" "hunvflag" "lowincometracts"
## [16] "povertyrate" "medianfamilyincome" "la1and10"
## [19] "lahalfand10" "la1and20" "latracts_half"
## [22] "latracts1" "latracts10" "latracts20"
## [25] "latractsvehicle_20" "lapop1_10" "lapop05_10"
## [28] "lapop1_20" "lalowi1_10" "lalowi05_10"
## [31] "lalowi1_20" "lapophalf" "lapophalfshare"
## [34] "lalowihalf" "lalowihalfshare" "lakidshalf"
## [37] "lakidshalfshare" "laseniorshalf" "laseniorshalfshare"
## [40] "lawhitehalf" "lawhitehalfshare" "lablackhalf"
## [43] "lablackhalfshare" "laasianhalf" "laasianhalfshare"
## [46] "lanhopihalf" "lanhopihalfshare" "laaianhalf"
## [49] "laaianhalfshare" "laomultirhalf" "laomultirhalfshare"
## [52] "lahisphalf" "lahisphalfshare" "lahunvhalf"
## [55] "lahunvhalfshare" "lasnaphalf" "lasnaphalfshare"
## [58] "lapop1" "lapop1share" "lalowi1"
## [61] "lalowi1share" "lakids1" "lakids1share"
## [64] "laseniors1" "laseniors1share" "lawhite1"
## [67] "lawhite1share" "lablack1" "lablack1share"
## [70] "laasian1" "laasian1share" "lanhopi1"
## [73] "lanhopi1share" "laaian1" "laaian1share"
## [76] "laomultir1" "laomultir1share" "lahisp1"
## [79] "lahisp1share" "lahunv1" "lahunv1share"
## [82] "lasnap1" "lasnap1share" "lapop10"
## [85] "lapop10share" "lalowi10" "lalowi10share"
## [88] "lakids10" "lakids10share" "laseniors10"
## [91] "laseniors10share" "lawhite10" "lawhite10share"
## [94] "lablack10" "lablack10share" "laasian10"
## [97] "laasian10share" "lanhopi10" "lanhopi10share"
## [100] "laaian10" "laaian10share" "laomultir10"
## [103] "laomultir10share" "lahisp10" "lahisp10share"
## [106] "lahunv10" "lahunv10share" "lasnap10"
## [109] "lasnap10share" "lapop20" "lapop20share"
## [112] "lalowi20" "lalowi20share" "lakids20"
## [115] "lakids20share" "laseniors20" "laseniors20share"
## [118] "lawhite20" "lawhite20share" "lablack20"
## [121] "lablack20share" "laasian20" "laasian20share"
## [124] "lanhopi20" "lanhopi20share" "laaian20"
## [127] "laaian20share" "laomultir20" "laomultir20share"
## [130] "lahisp20" "lahisp20share" "lahunv20"
## [133] "lahunv20share" "lasnap20" "lasnap20share"
## [136] "tractlowi" "tractkids" "tractseniors"
## [139] "tractwhite" "tractblack" "tractasian"
## [142] "tractnhopi" "tractaian" "tractomultir"
## [145] "tracthispanic" "tracthunv" "tractsnap"
# Filtering the data for the state of Maryland and selecting ariables that will be used for analysis
df2 <- df|>
filter(state == "Maryland")|>
select("censustract", "state", "county", "urban" ,"pop2010", "povertyrate", "medianfamilyincome", "lalowi1", "lalowi1share", "tractlowi", "tractwhite", "tractblack", "tractasian", "tractnhopi", "tractaian", "tractomultir" ,"tracthispanic" ,"tracthunv", "tractsnap", "lapop1","lalowi1","lawhite1","lablack1","laasian1", "lanhopi1", "laaian1", "laomultir1", "lahisp1", "lahunv1", "lasnap1", "lalowi1share", "lawhite1share", "lablack1share", "laasian1share", "lanhopi1share", "laaian1share", "laomultir1share", "lahisp1share", "lahunv1share", "lasnap1", "lowincometracts")
head(df2)
## # A tibble: 6 × 38
## censustract state county urban pop2010 pover…¹ media…² lalowi1 lalow…³ tract…⁴
## <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 24001000100 Mary… Alleg… 0 3718 6.6 56875 1079. 0.290 1029
## 2 24001000200 Mary… Alleg… 0 4564 13.7 60943 1667. 0.365 979
## 3 24001000300 Mary… Alleg… 0 2780 20.2 42727 575. 0.207 917
## 4 24001000400 Mary… Alleg… 1 3022 12.8 48831 600. 0.198 1110
## 5 24001000500 Mary… Alleg… 1 2734 56 34519 472. 0.173 1580
## 6 24001000600 Mary… Alleg… 1 2965 12.6 53438 20.9 0.00705 1025
## # … with 28 more variables: tractwhite <dbl>, tractblack <dbl>,
## # tractasian <dbl>, tractnhopi <dbl>, tractaian <dbl>, tractomultir <dbl>,
## # tracthispanic <dbl>, tracthunv <dbl>, tractsnap <dbl>, lapop1 <dbl>,
## # lawhite1 <dbl>, lablack1 <dbl>, laasian1 <dbl>, lanhopi1 <dbl>,
## # laaian1 <dbl>, laomultir1 <dbl>, lahisp1 <dbl>, lahunv1 <dbl>,
## # lasnap1 <dbl>, lawhite1share <dbl>, lablack1share <dbl>,
## # laasian1share <dbl>, lanhopi1share <dbl>, laaian1share <dbl>, …
# Pivoting the variables with information about census tract population by race.
df_long <- pivot_longer(df2, c("tractwhite","tractblack", "tractasian", "tractnhopi", "tractaian", "tractomultir", "tracthispanic"), names_to = "ethnicity", values_to = "population")
# Calculating and selecting the majority racial group for the census tract. Filtering the census tracts that have no populatin and that are rural. Recoding census urban tracts as yes.
final_df <- df_long|>
group_by(censustract)|>
filter(population == (max(population)))|>
filter(population !=0 & urban=="1" )|>
mutate(urban = recode(urban, "1" =="Yes"))|>
ungroup()
# Categorizing income into low, medium, and high groups
final_df$incomegroup <- cut(final_df$medianfamilyincome, breaks=3, labels=c('Low', 'Medium', 'High'))
#Building a regression model
regressionmodel<-lm(lalowi1share~pop2010+ povertyrate+ medianfamilyincome+ lalowi1+ tractlowi+ ethnicity+ tracthunv+ tractsnap+ lapop1+lalowi1+lawhite1+lablack1+laasian1+ lanhopi1+ laaian1+ laomultir1+ lahisp1+ lahunv1+ lasnap1+ lawhite1share+ lablack1share+ laasian1share+ lanhopi1share+ laaian1share+ laomultir1share+ lahisp1share+ lahunv1share+ lasnap1+ lowincometracts+ population+incomegroup, data=final_df)
summary(regressionmodel)
##
## Call:
## lm(formula = lalowi1share ~ pop2010 + povertyrate + medianfamilyincome +
## lalowi1 + tractlowi + ethnicity + tracthunv + tractsnap +
## lapop1 + lalowi1 + lawhite1 + lablack1 + laasian1 + lanhopi1 +
## laaian1 + laomultir1 + lahisp1 + lahunv1 + lasnap1 + lawhite1share +
## lablack1share + laasian1share + lanhopi1share + laaian1share +
## laomultir1share + lahisp1share + lahunv1share + lasnap1 +
## lowincometracts + population + incomegroup, data = final_df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.191705 -0.005314 -0.000264 0.004919 0.219285
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.522e-02 1.253e-02 2.012 0.04442 *
## pop2010 2.444e-06 8.323e-07 2.936 0.00339 **
## povertyrate 1.788e-04 8.564e-05 2.088 0.03700 *
## medianfamilyincome -1.564e-07 3.479e-08 -4.495 7.66e-06 ***
## lalowi1 1.135e-04 3.000e-06 37.825 < 2e-16 ***
## tractlowi 1.340e-06 1.937e-06 0.692 0.48917
## ethnicitytractblack -1.999e-02 1.224e-02 -1.633 0.10274
## ethnicitytracthispanic -2.661e-02 1.261e-02 -2.110 0.03511 *
## ethnicitytractwhite -1.584e-02 1.221e-02 -1.298 0.19470
## tracthunv -1.653e-06 4.961e-06 -0.333 0.73895
## tractsnap -3.532e-05 7.876e-06 -4.485 8.03e-06 ***
## lapop1 -1.022e+02 5.423e+01 -1.885 0.05971 .
## lawhite1 1.022e+02 5.423e+01 1.885 0.05971 .
## lablack1 1.022e+02 5.423e+01 1.885 0.05971 .
## laasian1 1.022e+02 5.423e+01 1.885 0.05971 .
## lanhopi1 1.022e+02 5.423e+01 1.885 0.05972 .
## laaian1 1.022e+02 5.423e+01 1.885 0.05971 .
## laomultir1 1.022e+02 5.423e+01 1.885 0.05971 .
## lahisp1 3.618e-04 4.938e-05 7.327 4.41e-13 ***
## lahunv1 -4.484e-04 5.712e-05 -7.849 9.55e-15 ***
## lasnap1 2.996e-04 1.996e-05 15.008 < 2e-16 ***
## lawhite1share 1.305e-01 9.174e-03 14.223 < 2e-16 ***
## lablack1share 1.011e-01 1.603e-02 6.311 3.95e-10 ***
## laasian1share 7.500e-02 7.434e-02 1.009 0.31323
## lanhopi1share 3.309e+01 3.668e+00 9.022 < 2e-16 ***
## laaian1share -4.232e+00 2.029e+00 -2.086 0.03721 *
## laomultir1share 3.032e+00 3.053e-01 9.930 < 2e-16 ***
## lahisp1share -1.572e+00 2.279e-01 -6.900 8.56e-12 ***
## lahunv1share 9.190e-01 8.615e-02 10.668 < 2e-16 ***
## lowincometracts 1.309e-03 2.121e-03 0.617 0.53713
## population -6.332e-07 9.172e-07 -0.690 0.49012
## incomegroupMedium -9.363e-04 2.292e-03 -0.409 0.68292
## incomegroupHigh 7.546e-03 5.104e-03 1.478 0.13961
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.01843 on 1148 degrees of freedom
## Multiple R-squared: 0.9366, Adjusted R-squared: 0.9348
## F-statistic: 529.8 on 32 and 1148 DF, p-value: < 2.2e-16
The p-value of the F-statistics suggests that at least one of the predictor variables is significantly related to outcome variable
summary(regressionmodel)$coefficient
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.522035e-02 1.253291e-02 2.0123296 4.441841e-02
## pop2010 2.443688e-06 8.322975e-07 2.9360752 3.390188e-03
## povertyrate 1.788398e-04 8.564121e-05 2.0882445 3.699572e-02
## medianfamilyincome -1.563954e-07 3.479356e-08 -4.4949523 7.663048e-06
## lalowi1 1.134617e-04 2.999621e-06 37.8253339 5.710383e-204
## tractlowi 1.340259e-06 1.937188e-06 0.6918580 4.891664e-01
## ethnicitytractblack -1.998674e-02 1.223911e-02 -1.6330220 1.027386e-01
## ethnicitytracthispanic -2.660611e-02 1.261214e-02 -2.1095643 3.511191e-02
## ethnicitytractwhite -1.584313e-02 1.220986e-02 -1.2975681 1.946965e-01
## tracthunv -1.653495e-06 4.960660e-06 -0.3333216 7.389524e-01
## tractsnap -3.532278e-05 7.875977e-06 -4.4848760 8.027676e-06
## lapop1 -1.022097e+02 5.422817e+01 -1.8848081 5.970817e-02
## lawhite1 1.022097e+02 5.422817e+01 1.8848077 5.970822e-02
## lablack1 1.022097e+02 5.422817e+01 1.8848079 5.970820e-02
## laasian1 1.022097e+02 5.422817e+01 1.8848078 5.970822e-02
## lanhopi1 1.022038e+02 5.422819e+01 1.8846984 5.972301e-02
## laaian1 1.022107e+02 5.422816e+01 1.8848268 5.970565e-02
## laomultir1 1.022090e+02 5.422817e+01 1.8847960 5.970982e-02
## lahisp1 3.618089e-04 4.937787e-05 7.3273488 4.414321e-13
## lahunv1 -4.483806e-04 5.712498e-05 -7.8491158 9.551911e-15
## lasnap1 2.996150e-04 1.996400e-05 15.0077623 1.270557e-46
## lawhite1share 1.304777e-01 9.173632e-03 14.2231277 2.099587e-42
## lablack1share 1.011499e-01 1.602781e-02 6.3108976 3.954620e-10
## laasian1share 7.500160e-02 7.433874e-02 1.0089168 3.132272e-01
## lanhopi1share 3.309390e+01 3.668032e+00 9.0222477 7.564549e-19
## laaian1share -4.232069e+00 2.028896e+00 -2.0858980 3.720822e-02
## laomultir1share 3.031785e+00 3.053214e-01 9.9298160 2.385243e-22
## lahisp1share -1.572440e+00 2.278778e-01 -6.9003655 8.557031e-12
## lahunv1share 9.189880e-01 8.614792e-02 10.6675582 2.134472e-25
## lowincometracts 1.309447e-03 2.121099e-03 0.6173437 5.371305e-01
## population -6.332142e-07 9.172443e-07 -0.6903441 4.901174e-01
## incomegroupMedium -9.363359e-04 2.291663e-03 -0.4085836 6.829214e-01
## incomegroupHigh 7.545649e-03 5.104420e-03 1.4782578 1.396131e-01
vif(regressionmodel)
## GVIF Df GVIF^(1/(2*Df))
## pop2010 1.618834e+01 1 4.023474e+00
## povertyrate 5.075135e+00 1 2.252806e+00
## medianfamilyincome -3.974981e-01 1 NaN
## lalowi1 -1.209231e+00 1 NaN
## tractlowi 4.169707e+00 1 2.041986e+00
## ethnicity 3.867050e-01 3 8.535520e-01
## tracthunv 1.860350e+00 1 1.363947e+00
## tractsnap 2.714022e-01 1 5.209628e-01
## lapop1 1.429280e+15 1 3.780581e+07
## lawhite1 -4.706572e+15 1 NaN
## lablack1 -5.501156e+15 1 NaN
## laasian1 2.374412e+14 1 1.540913e+07
## lanhopi1 2.105266e+10 1 1.450953e+05
## laaian1 1.736411e+11 1 4.167026e+05
## laomultir1 2.089637e+13 1 4.571254e+06
## lahisp1 4.050269e+01 1 6.364173e+00
## lahunv1 1.075145e+01 1 3.278940e+00
## lasnap1 1.271465e+00 1 1.127593e+00
## lawhite1share -1.665170e+00 1 NaN
## lablack1share -1.748405e+01 1 NaN
## laasian1share 1.309245e+01 1 3.618350e+00
## lanhopi1share 6.928471e+00 1 2.632199e+00
## laaian1share 1.514631e+01 1 3.891826e+00
## laomultir1share 4.082889e+01 1 6.389749e+00
## lahisp1share 4.625781e+01 1 6.801310e+00
## lahunv1share 1.121011e+01 1 3.348151e+00
## lowincometracts 3.944643e+00 1 1.986113e+00
## population 3.632982e+00 1 1.906038e+00
## incomegroup 8.141518e+00 2 1.689182e+00
Based on the coefficients tables, a number of variables appear to be significantly correlated with the variable lalow1share. However, the adjusted generalised variance inflation factor also shows that the degree of correlation is high enough between variables which could cause and issue with the model. Removing the variables that have high degree of correlation leaves the following variables for the regression model: ethnicity, tracthunv, tractsnap,lahunv1, lasnap1,incomegroup
regressionmodel2<-lm(lalowi1share~ ethnicity+ tracthunv+ tractsnap+ lahunv1+ lasnap1+ incomegroup, data=final_df)
summary(regressionmodel2)
##
## Call:
## lm(formula = lalowi1share ~ ethnicity + tracthunv + tractsnap +
## lahunv1 + lasnap1 + incomegroup, data = final_df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.28675 -0.01919 -0.00907 0.00632 0.45085
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.665e-02 2.546e-02 1.440 0.150228
## ethnicitytractblack 8.785e-04 2.546e-02 0.034 0.972485
## ethnicitytracthispanic -1.268e-02 2.637e-02 -0.481 0.630692
## ethnicitytractwhite 2.453e-03 2.536e-02 0.097 0.922952
## tracthunv -2.354e-05 1.105e-05 -2.131 0.033306 *
## tractsnap -8.792e-05 1.388e-05 -6.335 3.37e-10 ***
## lahunv1 5.968e-04 5.621e-05 10.616 < 2e-16 ***
## lasnap1 6.972e-04 3.762e-05 18.535 < 2e-16 ***
## incomegroupMedium -1.550e-02 3.162e-03 -4.901 1.09e-06 ***
## incomegroupHigh -2.441e-02 6.595e-03 -3.701 0.000224 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.04373 on 1171 degrees of freedom
## Multiple R-squared: 0.6358, Adjusted R-squared: 0.633
## F-statistic: 227.2 on 9 and 1171 DF, p-value: < 2.2e-16
This model shows that approximately 63% of the variance in the variable the population that are low access and low income at 1 mile can be explained by the number of housing units without a vehicle, the number of housing receiving Supplemental Nutrition Assistance Program (SNAP) benefits that have low access at 1 mile, and somewhat by income.
ggplot(final_df, aes(ethnicity,lalowi1share, fill=ethnicity))+
labs(title="Maryland population with low access and low income \n by ethnic group (1 mile), 2010",
x="Ethnicity",
y = "Population share with low access and low access",
caption= "United States Department of Agriculture Food Access Research Database")+
geom_boxplot(outlier.shape = NA) +
scale_fill_brewer(palette="Dark2", name = "Ethnicity", labels = c("Asian", "Black","Hispanic", "White"))+
theme_minimal()
ggplot(final_df, aes(lalowi1, lasnap1))+
geom_point(color="red", alpha=.25)+
geom_smooth(method=lm, se=F)+
labs(title="Population share with low acces and low-income at 1 mile versus \n number of housing units receiving SNAP Benefits ",
x="Population with low access and low income at 1 mile",
y = "Housing units receiving SNAP benefits",
caption= "United States Department of Agriculture Food Access Research Database")+
theme_minimal()
Given my interest in variations across racial groups, I decided to explore the relationship between race and the share of the population that is low income and low access at 1 mile. The boxplot shows that the share of the population with low access at 1 mile and low-income varies by the majority race in the census tract, with tracts that are majority Asian having the highest share, followed that tracts that are majority White. The scatterplot appears to show that increase in housing units receiving SNAP benefits increases with the population with low access and low income at 1 mile.
plot1 <- ggplot(final_df ,aes(lalowi1, lahunv1, color=incomegroup)) +
geom_point(size=1, alpha=.5) +
labs(title="Population share with low access and low-income versus \n number of housing units with access to no vechicle (1 mile)",
x="Population with low access and low income at 1 mile",
y = "Housing units with no vehicle",
caption= "United States Department of Agriculture Food Access Research Database")+
theme_minimal()+
facet_wrap( ~ ethnicity, ncol=2)
plot1 <- ggplotly(plot1)
plot1
My first visualisation shows a facet wrapped scatterplot showing the relationship between low-income and low access portion of the population and the number of housing units without vehicles grouped by income level. Each mini-graph shows this relationship by ethnic group. There are too few Asian and Hispanic tracts to discern a relationship between the share of the population that is low access and low income at 1 mile and the number of housing units without a vehicle by income. In the census tracts that are majority white, the high income group has fewer housing units with no vehicle and people with low access and low income at 1 mile, while the low income group seems to have more housing units with no vehicle and more people with low access. The pattern is less clear among the black census tracts but appears to be similar to the white census tracts. This visualisation was not what I had envisioned, I was hoping to minimise the overlap between the data points but couldn’t successfully execute the code.
# Extracting and transforming the census tract information to allow for joining shapefile to create a map in tableau
final_df$tract<-(substr(final_df$censustract, 6, 12))
final_df$censustract<-as.character(final_df$censustract)
View(final_df)
# Writing the final data frame to a csv file so that it can be used in tableau
write_csv(final_df, "montgomery_food_access.csv")
The second visualization is a dashboard available at https://public.tableau.com/app/profile/gbaike.ajayi/viz/AccesstoHealthyFoodsinUrbanMaryland/Dashboard1?publish=yes and includes the following components:
A map of urban census tracts in Maryland with colors representing the majority racial group in the tract. The map can be filtered by county, race and income group.
A banner with some key indicators for the census tract
A bar graph that shows the share of the population with low access to healthy foods at 1 mile by race
The dashboard does not reveal any clear patterns but it does offer an an interesting way to explore access to healthy foods in Maryland. Some interesting highlights include that when filtering for high income census tracts, there are two tracts where the share of the population considered to be low access and low income is close to 10%. Filtering by the medium income group reveals one census tract in Prince George’s county where at least 59% of the tract is considered low access and low income. It would be worth investigating why this is so high compared with the neighboring tracts. Among the low income group, there are more census tracts that have a greater share of the population that low access and low income, but it is not an overwhelming majority.
One challenge that I ran into with making the map is that some of the circles on the map appear to be displaced and I couldn’t seem to fix this issue.
Alviola, P. A., Nayga, R. M., Thomsen, M. R., & Wang, Z. (2013). Determinants of Food Deserts. American Journal of Agricultural Economics, 95(5), 1259–1265. http://www.jstor.org/stable/24476908
Ware, B., Amin, M., Jessup, E., & McCluskey, J. (2021). Neighborhood racial composition, income, and distance to grocery retailers in Seattle. Agricultural and Resource Economics Review, 50(3), 512-532. doi:10.1017/age.2021.23