The project involves analyzing and comparing the socioeconomic dynamics related to housing in Maryland and Philadelphia. The dataset includes information on median gross rent, median household income, population, and rent burden for various counties or areas within these regions. The project aims to understand the correlation between key variables, particularly focusing on the relationship between median gross rent and median household income.
To facilitate a comprehensive understanding of the data, a dashboard is being developed. The dashboard will feature visualizations, such as scatter plots and trend lines, to showcase how the variables interact. The unique identifiers assigned to Maryland and Philadelphia allow for a direct comparison within the same visual representation.
The purpose of the dashboard is multi-faceted:
The primary goal is to visually assess and compare the correlation between median gross rent and median household income in both Maryland and Philadelphia. Insights gained from these comparisons can help identify patterns and trends that may be indicative of broader economic dynamics.
The dashboard aids in identifying regional disparities within Maryland and Philadelphia, providing a nuanced understanding of how housing-related variables vary across different counties or areas.
The visualizations generated by the dashboard serve as a decision support tool for policymakers, urban planners, or stakeholders involved in housing and economic development. The insights derived can inform strategies for addressing housing affordability concerns and fostering economic growth.
By directly comparing Maryland and Philadelphia, the dashboard enables a comparative analysis of housing and income dynamics between the two regions. This comparison can highlight similarities, differences, and potential factors influencing these trends. In summary, the project aims to provide actionable insights into the relationship between housing and income in Maryland and Philadelphia through the development of an interactive dashboard. This tool will not only enhance understanding but also support informed decision-making for stakeholders concerned with regional economic development and housing policies.
The data is found in tidycensus.
Describe the data in this section.
The API I use is tidycensus (https://walker-data.com/tidycensus), which is an R package that allows users to interface with a select number of the US Census Bureau’s data APIs and return tidyverse-ready data frames, optionally with simple feature geometry included.
The goal of this part is to create a data analysis (or a case study) using the US Census Bureau’s data.
As part of this analysis, we look at the 3 states Philadelphia, Virginia and Maryland, and understand patterns in median gross rent, median household income, rent burden.
[1] 27886 4
We use the get_acs function to obtain data and feature geometry for the American Community Survey. The variables selected us are:- 1) population = “B02001_001”, 2) median.gross.rent = “B25064_001”, 3) median.household.income = “B19013_001”, 4) rent.burden = “B25071_001”, 5) white = “B03002_003”, 6) af.am = “B03002_004”, 7) hispanic = “B03002_012”, 8) am.ind = “B03002_005”, 9) asian = “B03002_006”, 10)nh.pi = “B03002_007”, 11)multiple = “B03002_009”, 12)other = “B03002_008”
We now save the data into the directory.
We create the data directory and save and read the datasets.
Data directory already exists.
Data read from data/waPct4.csv
Data read from data/waPct3.csv
Data read from data/waPct2.csv
Data read from data/waPct1.csv
data frame with 0 columns and 1 row
Rows: 24
Columns: 23
$ GEOID <int> 24001, 24003, 24005, 24009, 24011, 24013, 2401~
$ af.am <int> 5723, 97133, 247318, 11316, 4318, 6161, 6526, ~
$ am.ind <int> 81, 669, 1434, 80, 23, 314, 94, 741, 3, 342, 1~
$ asian <int> 590, 22643, 51841, 1951, 186, 3752, 1454, 5481~
$ hispanic <int> 1340, 48638, 49211, 4018, 2557, 6691, 4842, 10~
$ median.gross.rent <int> 719, 1764, 1387, 1526, 1026, 1228, 1202, 1725,~
$ median.household.income <int> 51090, 108048, 81846, 120295, 63027, 104708, 8~
$ multiple <int> 1540, 26750, 26353, 4140, 1303, 3706, 3720, 85~
$ nh.pi <int> 4, 284, 351, 33, 0, 28, 36, 35, 0, 98, 11, 78,~
$ other <int> 109, 2164, 3296, 205, 123, 554, 67, 809, 58, 6~
$ population <int> 68684, 584064, 850702, 92515, 33234, 172148, 1~
$ rent.burden <dbl> 29.7, 28.9, 31.1, 28.9, 32.0, 27.9, 30.0, 29.1~
$ white <int> 59297, 385783, 470898, 70772, 24724, 150942, 8~
$ checkTot <int> 68684, 584064, 850702, 92515, 33234, 172148, 1~
$ pct.white <dbl> 0.8633306, 0.6605149, 0.5535405, 0.7649787, 0.~
$ pct.af.am <dbl> 0.08332363, 0.16630540, 0.29072225, 0.12231530~
$ pct.hispanic <dbl> 0.01950964, 0.08327512, 0.05784752, 0.04343080~
$ pct.am.ind <dbl> 1.179314e-03, 1.145422e-03, 1.685667e-03, 8.64~
$ pct.asian <dbl> 0.008590065, 0.038768012, 0.060939083, 0.02108~
$ pct.nh.pi <dbl> 5.823773e-05, 4.862481e-04, 4.126004e-04, 3.56~
$ pct.multiple <dbl> 0.022421525, 0.045799775, 0.030977945, 0.04474~
$ pct.other <dbl> 0.0015869780, 0.0037050734, 0.0038744472, 0.00~
$ year <int> 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021~
n
1 24
data frame with 0 columns and 1 row
Rows: 24
Columns: 23
$ GEOID <int> 24001, 24003, 24005, 24009, 24011, 24013, 2401~
$ af.am <int> 4895, 101009, 252089, 11305, 4385, 6339, 6816,~
$ am.ind <int> 68, 565, 1212, 84, 20, 221, 109, 467, 4, 376, ~
$ asian <int> 631, 23572, 51521, 1837, 152, 3846, 1394, 5328~
$ hispanic <int> 1377, 51224, 51697, 4319, 2736, 7169, 5069, 11~
$ median.gross.rent <int> 743, 1908, 1479, 1589, 1074, 1283, 1322, 1839,~
$ median.household.income <int> 55248, 116009, 88157, 128078, 65326, 111672, 8~
$ multiple <int> 1943, 28755, 30439, 4808, 1366, 4438, 4166, 95~
$ nh.pi <int> 5, 268, 352, 49, 0, 24, 36, 25, 0, 81, 17, 120~
$ other <int> 134, 2690, 3520, 380, 250, 860, 557, 815, 165,~
$ population <int> 68161, 588109, 850737, 93244, 33320, 173225, 1~
$ rent.burden <dbl> 30.4, 29.0, 31.3, 28.7, 31.8, 28.5, 30.8, 28.7~
$ white <int> 59108, 380026, 459907, 70462, 24411, 150328, 8~
$ checkTot <int> 68161, 588109, 850737, 93244, 33320, 173225, 1~
$ pct.white <dbl> 0.8671821, 0.6461829, 0.5405983, 0.7556733, 0.~
$ pct.af.am <dbl> 0.07181526, 0.17175218, 0.29631837, 0.12124105~
$ pct.hispanic <dbl> 0.02020217, 0.08709950, 0.06076731, 0.04631933~
$ pct.am.ind <dbl> 0.0009976379, 0.0009607063, 0.0014246471, 0.00~
$ pct.asian <dbl> 0.009257493, 0.040081005, 0.060560432, 0.01970~
$ pct.nh.pi <dbl> 7.335573e-05, 4.556978e-04, 4.137589e-04, 5.25~
$ pct.multiple <dbl> 0.028506037, 0.048893998, 0.035779565, 0.05156~
$ pct.other <dbl> 0.001965934, 0.004573982, 0.004137589, 0.00407~
$ year <int> 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022~
n
1 24
data frame with 0 columns and 1 row
Rows: 67
Columns: 23
$ GEOID <int> 42001, 42003, 42005, 42007, 42009, 42011, 4201~
$ af.am <int> 1419, 156053, 627, 10028, 356, 17352, 1962, 39~
$ am.ind <int> 75, 976, 11, 74, 45, 230, 89, 38, 343, 46, 41,~
$ asian <int> 783, 48818, 205, 828, 155, 5713, 732, 351, 306~
$ hispanic <int> 7551, 28312, 565, 3048, 606, 96549, 1617, 919,~
$ median.gross.rent <int> 973, 962, 719, 762, 693, 985, 757, 754, 1323, ~
$ median.household.income <int> 72492, 66659, 56838, 62152, 54596, 69272, 5436~
$ multiple <int> 2056, 41869, 854, 5307, 600, 8271, 3016, 942, ~
$ nh.pi <int> 5, 262, 0, 25, 0, 57, 10, 43, 86, 31, 23, 0, 1~
$ other <int> 195, 5086, 30, 155, 50, 1253, 144, 204, 3030, ~
$ population <int> 103782, 1246116, 65967, 168260, 47729, 426967,~
$ rent.burden <dbl> 27.0, 27.5, 24.9, 26.7, 28.1, 29.1, 30.4, 25.7~
$ white <int> 91698, 964740, 63675, 148795, 45917, 297542, 1~
$ checkTot <int> 103782, 1246116, 65967, 168260, 47729, 426967,~
$ pct.white <dbl> 0.8835636, 0.7741976, 0.9652554, 0.8843159, 0.~
$ pct.af.am <dbl> 0.013672891, 0.125231519, 0.009504752, 0.05959~
$ pct.hispanic <dbl> 0.072758282, 0.022720196, 0.008564889, 0.01811~
$ pct.am.ind <dbl> 0.0007226687, 0.0007832337, 0.0001667500, 0.00~
$ pct.asian <dbl> 0.007544661, 0.039176128, 0.003107614, 0.00492~
$ pct.nh.pi <dbl> 4.817791e-05, 2.102533e-04, 0.000000e+00, 1.48~
$ pct.multiple <dbl> 0.01981076, 0.03359960, 0.01294587, 0.03154047~
$ pct.other <dbl> 1.878939e-03, 4.081482e-03, 4.547728e-04, 9.21~
$ year <int> 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021~
n
1 67
data frame with 0 columns and 1 row
Rows: 133
Columns: 23
$ GEOID <int> 51001, 51003, 51005, 51007, 51009, 51011, 5101~
$ af.am <int> 9503, 9712, 847, 2914, 5817, 2906, 21429, 3294~
$ am.ind <int> 69, 324, 0, 0, 251, 6, 406, 116, 18, 104, 0, 7~
$ asian <int> 255, 6174, 4, 1, 219, 28, 24010, 466, 12, 937,~
$ hispanic <int> 3042, 6537, 240, 437, 814, 319, 36594, 2498, 1~
$ median.gross.rent <int> 884, 1434, 606, 1005, 752, 743, 2094, 950, 628~
$ median.household.income <int> 50601, 90568, 49705, 57420, 60876, 55268, 1281~
$ multiple <int> 543, 3294, 208, 175, 726, 326, 10160, 1327, 0,~
$ nh.pi <int> 0, 61, 0, 0, 18, 0, 103, 67, 0, 0, 0, 75, 0, 0~
$ other <int> 44, 213, 40, 0, 236, 183, 1131, 225, 0, 311, 0~
$ population <int> 33388, 111438, 15266, 13220, 31381, 16039, 235~
$ rent.burden <dbl> 27.4, 28.6, 27.4, 30.7, 28.3, 28.6, 25.3, 25.8~
$ white <int> 19932, 85123, 13927, 9693, 23300, 12271, 14193~
$ checkTot <int> 33388, 111438, 15266, 13220, 31381, 16039, 235~
$ pct.white <dbl> 0.5969810, 0.7638597, 0.9122887, 0.7332073, 0.~
$ pct.af.am <dbl> 0.2846232179, 0.0871516000, 0.0554827722, 0.22~
$ pct.hispanic <dbl> 0.0911105787, 0.0586604210, 0.0157212105, 0.03~
$ pct.am.ind <dbl> 0.0020666108, 0.0029074463, 0.0000000000, 0.00~
$ pct.asian <dbl> 7.637475e-03, 5.540300e-02, 2.620202e-04, 7.56~
$ pct.nh.pi <dbl> 0.0000000000, 0.0005473896, 0.0000000000, 0.00~
$ pct.multiple <dbl> 0.016263328, 0.029559037, 0.013625049, 0.01323~
$ pct.other <dbl> 0.0013178387, 0.0019113767, 0.0026202018, 0.00~
$ year <int> 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021~
n
1 133
[1] "America/New_York"
[1] "2023-12-22 21:51:34 EST"
We now use Purr to simultaneously apply functions to vectors.
[1] 0 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 0 0 0 0 0
[1] 743 1908 1479 1589 1074 1283 1322 1839 968 1633 681 1475 1920 1072 1957
[16] 1713 1600 1595 934 1204 1049 1190 1144 1235 719 1764 1387 1526 1026 1228
[31] 1202 1725 878 1503 637 1355 1790 1025 1844 1593 1550 1492 839 1195 979
[46] 1105 1068 1146
The ggplot visualization for Maryland in 2021, comparing median gross rent to median household income, reveals a positive correlation. The graph indicates that as median gross rent rises, median household income tends to increase as well. This suggests a socioeconomic relationship where areas with higher housing costs also exhibit higher income levels.
The ggplot visualization for Maryland in 2021, depicting the relationship between county population and rent burden, shows a flat graph with initial perturbations. The absence of a clear trend indicates no discernible correlation between population and rent burden across the counties. The graph suggests that variations in population size do not consistently correspond to variations in rent burden.
The provided R code prepares and combines datasets for Maryland, Philadelphia and Virginia, assigning unique identifiers (1, 2 and 3). The resulting ggplot visualization compares median gross rent to median household income for both regions. The graphs show similar increasing trends, suggesting a strong positive correlation in both Maryland and Philadelphia. This implies that as median gross rent rises, median household income tends to increase, reflecting a common economic trend across the two locations.
Finally we look at the income of Asian population in all the three states. We find that the income in Maryland is marginally greater than that in Philadelphia and Virginia.
We note the similarities in the behavior of rent and income across states. The analysis done on three states show the inequities which are present across various states.