##The variables include:
###Total Households ###Population 25 years and older
###Less than 9th Grade
###High School no Diploma
###High School Diploma
###Some College no degree
###Associates degree
###Bachelor’s degree
###Graduate or Professional ###Employment Status of the Population 16 years and over
###Civilian Labor Force (16 years & over)
###Employed ###Unemployed
###Unemployment Rate
###Commute Workers 16 yrs and over
###Percent Drove Alone
###Percent Carpooled
###Percent Public Transportation
###Percent Walked
###Percent Other
###Percent Worked at Home
###Median Household Income ($)
###Families ###Percent Families in Poverty
###Percent Civilian Population w/ Health Ins. Cov.
###Total Housing Units
###Percent Occupied ###Percent Vacant
###Total Population ###Voting Age Population
###Male ###Female
###White Alone - those who identify as white alone or as part of a multiracial or ethnic background
###Black Alone - those who identify as black alone or as part of a multiracial or ethnic background ###Asian Alone- those who identify as Asian alone or as part of a multiracial or ethnic background ###American Indian/Alaska Native Alone- those who identify as Amer. Ind/Alaska Native alone or as part of a multiracial or ethnic background
###Native Hawaiian/Pacific Islander Alone- those who identify as Native Amer. alone or as part of a multiracial or ethnic background ###Some Other Race Alone
######Two or More Races ###Hispanic or Latino (of any race) ### Geography
##Article Analysis ###I will be using an article called “Marylanders Against Poverty” by the Baltimore Jewish Council & Staiman Design. In this article, they introduce data with visuals and ranks of every county in Maryland. The information in the article shows the population, number of people living below the poverty line, income (median income, poverty rate, child poverty rate, senior poverty rate, poverty rate amongst Blacks, Hispanics, female-headed households, individuals living below the 200% of the federal poverty rate, and individuals living in deep poverty). The article includes the ranking of each county in regards to (unemployment rate, housing wage, children experiencing homelessness in Maryland schools, and the percent of income spent on child care). Lastly, the article discusses income supports (percent of households in poverty with children that receive temporary cash assistance, percent of children in poverty receiving temporary cash assistance, adults receiving temporary disability assistance program, percent of population participating in food supplement program, penetration rate of the food supplement program, medicaid enrollment, and uninsured population). Although there are many variables that are associated with poverty, an explanatory analysis has shown that there are other features that contribute to a person’s socioeconomic status and other impacts of poverty (government assistance, homelessness, and the need for higher housing wages).
###The article states some interesting, yet alarming facts; stating that there are more people experiencing poverty now than there were 30 years ago. It is said that “nearly 200,000 more Marylanders are trying to get by on incomes below the Federal Poverty Level than in 1990 – a year that the U.S. economy entered a recession – and almost every county in the state has a higher poverty rate than it had in 1990”. Almost half of all Marylanders living in poverty lived in deep poverty, defined as having incomes at or below 50 percent of the Federal Poverty Level. While unemployment rates have continued to decline since the Great Recession, wages often aren’t high enough to support a family. The article also shares a disturbing fact that even with the new state minimum wage at $11 per hour as of January 2020, someone working full-time at minimum wage makes only 40 percent of the income needed to afford a two-bedroom apartment in Maryland.
setwd("~/Data 110 Folder")
MD_df <- read.csv("MD_economic.csv")
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.1.3
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5 v purrr 0.3.4
## v tibble 3.1.6 v dplyr 1.0.7
## v tidyr 1.1.4 v stringr 1.4.0
## v readr 2.1.1 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(dplyr)
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.1.3
library(ggpubr)
## Warning: package 'ggpubr' was built under R version 4.1.3
library(ggplot2)
library(psych)
## Warning: package 'psych' was built under R version 4.1.3
##
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
library(corrplot)
## corrplot 0.92 loaded
library(RColorBrewer)
library(dslabs)
## Warning: package 'dslabs' was built under R version 4.1.3
library(highcharter)
## Warning: package 'highcharter' was built under R version 4.1.3
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
##
## Attaching package: 'highcharter'
## The following object is masked from 'package:dslabs':
##
## stars
##Head, Tail, and Dimension
head(MD_df)
## Jurisdictions Total.Households Population.25.years.and.older
## 1 Allegany County 27759 50489
## 2 Anne Arundel County 205395 387306
## 3 Baltimore city 239791 425235
## 4 Baltimore County 312859 573263
## 5 Calvert County 31462 61269
## 6 Caroline County 11996 22216
## Less.than.9th.Grade High.School.no.Diploma High.School.Diploma
## 1 1307 4002 21070
## 2 9133 21910 93676
## 3 20732 46577 126395
## 4 18315 32698 152622
## 5 1096 2716 18833
## 6 1230 2470 9079
## Some.College.no.degree Associates.degree Bachelor.s.degree
## 1 10154 4758 4888
## 2 77911 29279 90536
## 3 82107 20061 67779
## 4 112480 40355 125363
## 5 15552 4642 10564
## 6 4072 1687 2182
## Graduate.or.Professional
## 1 4310
## 2 64861
## 3 61584
## 4 91430
## 5 7866
## 6 1496
## Employment.Status.of.the.Population.16.years.and.over
## 1 61337
## 2 451557
## 3 502594
## 4 670033
## 5 71843
## 6 25875
## Civilian.Labor.Force..16.years...over. Employed Unemployed Unemployment.Rate
## 1 31591 28738 2853 9.0
## 2 306519 290628 15891 5.2
## 3 308703 277954 30749 10.0
## 4 445373 420974 24399 5.5
## 5 49333 45756 3577 7.3
## 6 16761 15674 1087 6.5
## Commute.Workers.16.yrs.and.over Percent.Drove.Alone Percent.Carpooled
## 1 28108 82.5 9.7
## 2 296978 80.1 7.5
## 3 272953 60.0 9.1
## 4 412831 79.2 8.7
## 5 45262 81.7 8.4
## 6 15387 83.7 8.6
## Percent.Public.Transportation Percent.Walked Percent.Other
## 1 0.5 4.4 1.2
## 2 3.6 2.3 1.4
## 3 18.2 6.6 2.3
## 4 4.8 1.8 1.5
## 5 3.0 0.7 0.9
## 6 0.9 2.4 1.7
## Percent.Worked.at.Home Median.Household.Income.... Families
## 1 1.7 42771 17126
## 2 5.1 94502 142696
## 3 3.8 46641 123385
## 4 4.0 71810 204288
## 5 5.3 100350 23759
## 6 2.6 52469 8670
## Percent.Families.in.Poverty Percent.Civilian.Population.w..Health.Ins..Cov.
## 1 10.6 94.1
## 2 3.9 94.6
## 3 17.2 92.0
## 4 6.0 93.3
## 5 3.3 94.7
## 6 12.1 91.7
## Total.Housing.Units Percent.Occupied Percent.Vacant Total.Population
## 1 33211 84.0 16.0 72591
## 2 219319 93.1 6.9 564600
## 3 296923 81.3 18.7 619796
## 4 337031 93.0 7.0 828637
## 5 34613 90.4 9.6 90824
## 6 13525 88.4 11.6 32785
## Voting.Age.Population Male Female White.Alone Black.Alone Asian.Alone
## 1 58846 37892 34699 64164 5899 594
## 2 418118 279581 285019 417111 91567 20818
## 3 462592 291377 328419 187725 389222 15855
## 4 607614 392930 435707 514340 231516 49045
## 5 68233 45184 45640 73885 10797 1504
## 6 24049 15971 16814 26338 4376 190
## American.Indian.Alaska.Native.Alone Native.Hawaiian.Pacific.Islander.Alone
## 1 120 24
## 2 1025 408
## 3 1886 309
## 4 2320 398
## 5 150 34
## 6 96 18
## Some.Other.Race.Alone Two.or.More.Races Hispanic.or.Latino..of.any.race.
## 1 210 1580 1257
## 2 13095 20576 41275
## 3 10412 14387 30729
## 4 8728 22290 42438
## 5 541 3913 3276
## 6 721 1046 2247
## Life.expectancy Geography
## 1 76.4 R
## 2 79.6 S/U
## 3 73.4 S/U
## 4 78.7 S/U
## 5 79.7 R
## 6 76.1 R
tail(MD_df)
## Jurisdictions Total.Households Population.25.years.and.older
## 19 St. Mary's County 39276 73031
## 20 Somerset County 8362 17070
## 21 Talbot County 16498 28077
## 22 Washington County 55999 103916
## 23 Wicomico County 37415 63959
## 24 Worcester County 21190 38930
## Less.than.9th.Grade High.School.no.Diploma High.School.Diploma
## 19 2404 5125 21776
## 20 872 2228 7180
## 21 996 1956 7210
## 22 3313 10233 38185
## 23 2331 4987 21301
## 24 1043 2819 12456
## Some.College.no.degree Associates.degree Bachelor.s.degree
## 19 15543 5951 13009
## 20 3441 887 1617
## 21 5433 1989 5448
## 22 21830 8061 13451
## 23 13111 4458 10373
## 24 8238 2675 7439
## Graduate.or.Professional
## 19 9223
## 20 845
## 21 5045
## 22 8843
## 23 7398
## 24 4260
## Employment.Status.of.the.Population.16.years.and.over
## 19 86676
## 20 21979
## 21 31332
## 22 120112
## 23 82053
## 24 43529
## Civilian.Labor.Force..16.years...over. Employed Unemployed Unemployment.Rate
## 19 56495 54121 2374 4.2
## 20 9564 8593 971 10.2
## 21 18689 17863 826 4.4
## 22 72273 67375 4898 6.8
## 23 53854 49785 4069 7.6
## 24 25756 23915 1841 7.1
## Commute.Workers.16.yrs.and.over Percent.Drove.Alone Percent.Carpooled
## 19 55125 82.6 9.4
## 20 8335 81.6 6.2
## 21 17611 78.1 9.7
## 22 66237 80.8 9.8
## 23 48673 83.6 8.6
## 24 23449 80.5 7.3
## Percent.Public.Transportation Percent.Walked Percent.Other
## 19 2.2 2.4 1.0
## 20 0.8 5.6 1.4
## 21 1.3 3.3 1.2
## 22 1.4 2.1 1.1
## 23 0.6 2.4 1.5
## 24 2.2 2.6 1.9
## Percent.Worked.at.Home Median.Household.Income.... Families
## 19 2.5 86508 27646
## 20 4.5 39239 5258
## 21 6.3 65595 10959
## 22 4.8 58260 37413
## 23 3.3 54493 24425
## 24 5.5 59458 13493
## Percent.Families.in.Poverty Percent.Civilian.Population.w..Health.Ins..Cov.
## 19 5.8 94.2
## 20 18.0 91.3
## 21 6.7 93.8
## 22 9.7 93.0
## 23 10.2 91.7
## 24 7.8 92.6
## Total.Housing.Units Percent.Occupied Percent.Vacant Total.Population
## 19 43276 89.6 10.4 110979
## 20 11244 73.8 26.2 25801
## 21 20110 81.9 18.1 37461
## 22 61199 91.4 8.6 149546
## 23 41911 88.8 11.2 102014
## 24 55822 37.8 62.2 51559
## Voting.Age.Population Male Female White.Alone Black.Alone Asian.Alone
## 19 81547 55420 55559 87485 15922 3079
## 20 20719 13821 11980 13703 10845 266
## 21 29319 17595 19866 31137 4342 534
## 22 113424 75958 73588 124033 15675 2636
## 23 75053 48622 53392 69062 25818 3336
## 24 41458 25205 26354 42634 6977 710
## American.Indian.Alaska.Native.Alone Native.Hawaiian.Pacific.Islander.Alone
## 19 220 28
## 20 91 13
## 21 32 31
## 22 330 62
## 23 210 74
## 24 102 55
## Some.Other.Race.Alone Two.or.More.Races Hispanic.or.Latino..of.any.race.
## 19 684 3561 5377
## 20 414 469 906
## 21 378 1007 2427
## 22 1375 5435 6698
## 23 983 2531 5145
## 24 149 932 1741
## Life.expectancy Geography
## 19 79.5 R
## 20 76.3 R
## 21 81.1 R
## 22 77.5 R
## 23 76.9 R
## 24 78.5 R
dim(MD_df)
## [1] 24 43
view(MD_df)
str(MD_df)
## 'data.frame': 24 obs. of 43 variables:
## $ Jurisdictions : chr "Allegany County" "Anne Arundel County" "Baltimore city" "Baltimore County" ...
## $ Total.Households : int 27759 205395 239791 312859 31462 11996 60432 37076 54988 12940 ...
## $ Population.25.years.and.older : int 50489 387306 425235 573263 61269 22216 115213 69969 103318 23131 ...
## $ Less.than.9th.Grade : int 1307 9133 20732 18315 1096 1230 2363 2187 2346 926 ...
## $ High.School.no.Diploma : int 4002 21910 46577 32698 2716 2470 6658 5674 5189 2466 ...
## $ High.School.Diploma : int 21070 93676 126395 152622 18833 9079 34633 25824 33029 8856 ...
## $ Some.College.no.degree : int 10154 77911 82107 112480 15552 4072 22755 15106 24837 4753 ...
## $ Associates.degree : int 4758 29279 20061 40355 4642 1687 8943 5084 8473 1476 ...
## $ Bachelor.s.degree : int 4888 90536 67779 125363 10564 2182 25023 9632 17540 2926 ...
## $ Graduate.or.Professional : int 4310 64861 61584 91430 7866 1496 14838 6462 11904 1728 ...
## $ Employment.Status.of.the.Population.16.years.and.over: int 61337 451557 502594 670033 71843 25875 135084 81142 122589 26313 ...
## $ Civilian.Labor.Force..16.years...over. : int 31591 306519 308703 445373 49333 16761 91970 53741 82373 16613 ...
## $ Employed : int 28738 290628 277954 420974 45756 15674 88335 50620 78635 15240 ...
## $ Unemployed : int 2853 15891 30749 24399 3577 1087 3635 3121 3738 1373 ...
## $ Unemployment.Rate : num 9 5.2 10 5.5 7.3 6.5 4 5.8 4.5 8.3 ...
## $ Commute.Workers.16.yrs.and.over : int 28108 296978 272953 412831 45262 15387 86849 49958 79070 14847 ...
## $ Percent.Drove.Alone : num 82.5 80.1 60 79.2 81.7 83.7 85.5 82.9 81.4 78.4 ...
## $ Percent.Carpooled : num 9.7 7.5 9.1 8.7 8.4 8.6 6.9 8.4 7.3 14.9 ...
## $ Percent.Public.Transportation : num 0.5 3.6 18.2 4.8 3 0.9 0.8 1.2 5.8 0.8 ...
## $ Percent.Walked : num 4.4 2.3 6.6 1.8 0.7 2.4 1.4 1.6 1.1 2.1 ...
## $ Percent.Other : num 1.2 1.4 2.3 1.5 0.9 1.7 0.7 1.4 0.6 1.3 ...
## $ Percent.Worked.at.Home : num 1.7 5.1 3.8 4 5.3 2.6 4.7 4.6 3.7 2.6 ...
## $ Median.Household.Income.... : int 42771 94502 46641 71810 100350 52469 90510 70516 93973 50532 ...
## $ Families : int 17126 142696 123385 204288 23759 8670 45399 26121 40303 8539 ...
## $ Percent.Families.in.Poverty : num 10.6 3.9 17.2 6 3.3 12.1 3.4 6.5 5.2 11.9 ...
## $ Percent.Civilian.Population.w..Health.Ins..Cov. : num 94.1 94.6 92 93.3 94.7 91.7 96.3 94.5 95.9 94.4 ...
## $ Total.Housing.Units : int 33211 219319 296923 337031 34613 13525 63123 42269 58014 16700 ...
## $ Percent.Occupied : num 84 93.1 81.3 93 90.4 88.4 95.6 87.3 93.4 77.3 ...
## $ Percent.Vacant : num 16 6.9 18.7 7 9.6 11.6 4.4 12.7 6.6 22.7 ...
## $ Total.Population : int 72591 564600 619796 828637 90824 32785 167319 102416 156021 32386 ...
## $ Voting.Age.Population : int 58846 418118 462592 607614 68233 24049 127833 77244 114231 24851 ...
## $ Male : int 37892 279581 291377 392930 45184 15971 82784 50878 75368 15476 ...
## $ Female : int 34699 285019 328419 435707 45640 16814 84535 51538 80653 16910 ...
## $ White.Alone : int 64164 417111 187725 514340 73885 26338 154304 90422 72951 21345 ...
## $ Black.Alone : int 5899 91567 389222 231516 10797 4376 5585 6972 67351 8901 ...
## $ Asian.Alone : int 594 20818 15855 49045 1504 190 2762 1505 4916 325 ...
## $ American.Indian.Alaska.Native.Alone : int 120 1025 1886 2320 150 96 348 280 894 27 ...
## $ Native.Hawaiian.Pacific.Islander.Alone : int 24 408 309 398 34 18 75 35 163 0 ...
## $ Some.Other.Race.Alone : int 210 13095 10412 8728 541 721 1001 983 1151 554 ...
## $ Two.or.More.Races : int 1580 20576 14387 22290 3913 1046 3244 2219 8595 1234 ...
## $ Hispanic.or.Latino..of.any.race. : int 1257 41275 30729 42438 3276 2247 5368 4231 8358 1615 ...
## $ Life.expectancy : num 76.4 79.6 73.4 78.7 79.7 76.1 79.1 76.8 79.2 76.8 ...
## $ Geography : chr "R" "S/U" "S/U" "S/U" ...
unique(MD_df)
## Jurisdictions Total.Households Population.25.years.and.older
## 1 Allegany County 27759 50489
## 2 Anne Arundel County 205395 387306
## 3 Baltimore city 239791 425235
## 4 Baltimore County 312859 573263
## 5 Calvert County 31462 61269
## 6 Caroline County 11996 22216
## 7 Carroll County 60432 115213
## 8 Cecil County 37076 69969
## 9 Charles County 54988 103318
## 10 Dorchester County 12940 23131
## 11 Frederick County 90022 166221
## 12 Garrett County 11865 21378
## 13 Harford County 92895 172031
## 14 Howard County 111337 210338
## 15 Kent County 7605 13932
## 16 Montgomery County 369242 713454
## 17 Prince George's County 306694 607229
## 18 Queen Anne's County 17995 34452
## 19 St. Mary's County 39276 73031
## 20 Somerset County 8362 17070
## 21 Talbot County 16498 28077
## 22 Washington County 55999 103916
## 23 Wicomico County 37415 63959
## 24 Worcester County 21190 38930
## Less.than.9th.Grade High.School.no.Diploma High.School.Diploma
## 1 1307 4002 21070
## 2 9133 21910 93676
## 3 20732 46577 126395
## 4 18315 32698 152622
## 5 1096 2716 18833
## 6 1230 2470 9079
## 7 2363 6658 34633
## 8 2187 5674 25824
## 9 2346 5189 33029
## 10 926 2466 8856
## 11 4713 7623 40825
## 12 730 1602 9311
## 13 3782 8507 46622
## 14 4546 5386 29437
## 15 622 1142 4138
## 16 36934 26790 98014
## 17 43844 40417 156973
## 18 750 2026 10163
## 19 2404 5125 21776
## 20 872 2228 7180
## 21 996 1956 7210
## 22 3313 10233 38185
## 23 2331 4987 21301
## 24 1043 2819 12456
## Some.College.no.degree Associates.degree Bachelor.s.degree
## 1 10154 4758 4888
## 2 77911 29279 90536
## 3 82107 20061 67779
## 4 112480 40355 125363
## 5 15552 4642 10564
## 6 4072 1687 2182
## 7 22755 8943 25023
## 8 15106 5084 9632
## 9 24837 8473 17540
## 10 4753 1476 2926
## 11 32534 13284 39146
## 12 3700 1843 2244
## 13 38458 14187 36150
## 14 30345 11851 63325
## 15 2615 784 2644
## 16 98365 37163 190725
## 17 136486 36033 110917
## 18 6464 2892 7377
## 19 15543 5951 13009
## 20 3441 887 1617
## 21 5433 1989 5448
## 22 21830 8061 13451
## 23 13111 4458 10373
## 24 8238 2675 7439
## Graduate.or.Professional
## 1 4310
## 2 64861
## 3 61584
## 4 91430
## 5 7866
## 6 1496
## 7 14838
## 8 6462
## 9 11904
## 10 1728
## 11 28096
## 12 1948
## 13 24325
## 14 65448
## 15 1987
## 16 225463
## 17 82559
## 18 4780
## 19 9223
## 20 845
## 21 5045
## 22 8843
## 23 7398
## 24 4260
## Employment.Status.of.the.Population.16.years.and.over
## 1 61337
## 2 451557
## 3 502594
## 4 670033
## 5 71843
## 6 25875
## 7 135084
## 8 81142
## 9 122589
## 10 26313
## 11 194819
## 12 24679
## 13 200369
## 14 244975
## 15 16794
## 16 822213
## 17 723402
## 18 39552
## 19 86676
## 20 21979
## 21 31332
## 22 120112
## 23 82053
## 24 43529
## Civilian.Labor.Force..16.years...over. Employed Unemployed Unemployment.Rate
## 1 31591 28738 2853 9.0
## 2 306519 290628 15891 5.2
## 3 308703 277954 30749 10.0
## 4 445373 420974 24399 5.5
## 5 49333 45756 3577 7.3
## 6 16761 15674 1087 6.5
## 7 91970 88335 3635 4.0
## 8 53741 50620 3121 5.8
## 9 82373 78635 3738 4.5
## 10 16613 15240 1373 8.3
## 11 137361 130387 6974 5.1
## 12 14638 13937 701 4.8
## 13 136253 129108 7145 5.2
## 14 174816 167493 7323 4.2
## 15 9588 9131 457 4.8
## 16 585924 554085 31839 5.4
## 17 514437 476889 37548 7.3
## 18 26542 25556 986 3.7
## 19 56495 54121 2374 4.2
## 20 9564 8593 971 10.2
## 21 18689 17863 826 4.4
## 22 72273 67375 4898 6.8
## 23 53854 49785 4069 7.6
## 24 25756 23915 1841 7.1
## Commute.Workers.16.yrs.and.over Percent.Drove.Alone Percent.Carpooled
## 1 28108 82.5 9.7
## 2 296978 80.1 7.5
## 3 272953 60.0 9.1
## 4 412831 79.2 8.7
## 5 45262 81.7 8.4
## 6 15387 83.7 8.6
## 7 86849 85.5 6.9
## 8 49958 82.9 8.4
## 9 79070 81.4 7.3
## 10 14847 78.4 14.9
## 11 128717 78.1 9.6
## 12 13738 79.5 9.9
## 13 128501 83.4 8.6
## 14 166207 81.2 7.2
## 15 8927 67.8 7.9
## 16 545924 65.3 9.8
## 17 469632 66.5 11.3
## 18 24973 77.7 9.8
## 19 55125 82.6 9.4
## 20 8335 81.6 6.2
## 21 17611 78.1 9.7
## 22 66237 80.8 9.8
## 23 48673 83.6 8.6
## 24 23449 80.5 7.3
## Percent.Public.Transportation Percent.Walked Percent.Other
## 1 0.5 4.4 1.2
## 2 3.6 2.3 1.4
## 3 18.2 6.6 2.3
## 4 4.8 1.8 1.5
## 5 3.0 0.7 0.9
## 6 0.9 2.4 1.7
## 7 0.8 1.4 0.7
## 8 1.2 1.6 1.4
## 9 5.8 1.1 0.6
## 10 0.8 2.1 1.3
## 11 2.9 2.1 1.2
## 12 0.6 3.7 0.6
## 13 1.7 1.2 0.8
## 14 3.8 1.0 1.1
## 15 1.8 10.0 1.6
## 16 15.5 2.1 1.4
## 17 16.0 2.0 1.4
## 18 2.2 1.6 1.2
## 19 2.2 2.4 1.0
## 20 0.8 5.6 1.4
## 21 1.3 3.3 1.2
## 22 1.4 2.1 1.1
## 23 0.6 2.4 1.5
## 24 2.2 2.6 1.9
## Percent.Worked.at.Home Median.Household.Income.... Families
## 1 1.7 42771 17126
## 2 5.1 94502 142696
## 3 3.8 46641 123385
## 4 4.0 71810 204288
## 5 5.3 100350 23759
## 6 2.6 52469 8670
## 7 4.7 90510 45399
## 8 4.6 70516 26121
## 9 3.7 93973 40303
## 10 2.6 50532 8539
## 11 6.1 88502 65073
## 12 5.7 48174 8206
## 13 4.4 83445 67167
## 14 5.7 115576 82294
## 15 11.0 56638 4644
## 16 5.9 103178 257855
## 17 2.8 78607 202472
## 18 7.6 89241 12995
## 19 2.5 86508 27646
## 20 4.5 39239 5258
## 21 6.3 65595 10959
## 22 4.8 58260 37413
## 23 3.3 54493 24425
## 24 5.5 59458 13493
## Percent.Families.in.Poverty Percent.Civilian.Population.w..Health.Ins..Cov.
## 1 10.6 94.1
## 2 3.9 94.6
## 3 17.2 92.0
## 4 6.0 93.3
## 5 3.3 94.7
## 6 12.1 91.7
## 7 3.4 96.3
## 8 6.5 94.5
## 9 5.2 95.9
## 10 11.9 94.4
## 11 4.5 94.7
## 12 7.6 92.5
## 13 5.4 96.1
## 14 3.6 95.2
## 15 7.8 93.7
## 16 4.8 91.6
## 17 6.5 88.1
## 18 3.8 95.0
## 19 5.8 94.2
## 20 18.0 91.3
## 21 6.7 93.8
## 22 9.7 93.0
## 23 10.2 91.7
## 24 7.8 92.6
## Total.Housing.Units Percent.Occupied Percent.Vacant Total.Population
## 1 33211 84.0 16.0 72591
## 2 219319 93.1 6.9 564600
## 3 296923 81.3 18.7 619796
## 4 337031 93.0 7.0 828637
## 5 34613 90.4 9.6 90824
## 6 13525 88.4 11.6 32785
## 7 63123 95.6 4.4 167319
## 8 42269 87.3 12.7 102416
## 9 58014 93.4 6.6 156021
## 10 16700 77.3 22.7 32386
## 11 93645 95.1 4.9 246105
## 12 19080 61.8 38.2 29516
## 13 98277 94.0 6.0 250132
## 14 115003 95.6 4.4 312495
## 15 10667 71.3 28.7 19666
## 16 385485 95.5 4.5 1039198
## 17 330708 92.8 7.2 905161
## 18 20754 86.2 13.8 49071
## 19 43276 89.6 10.4 110979
## 20 11244 73.8 26.2 25801
## 21 20110 81.9 18.1 37461
## 22 61199 91.4 8.6 149546
## 23 41911 88.8 11.2 102014
## 24 55822 37.8 62.2 51559
## Voting.Age.Population Male Female White.Alone Black.Alone Asian.Alone
## 1 58846 37892 34699 64164 5899 594
## 2 418118 279581 285019 417111 91567 20818
## 3 462592 291377 328419 187725 389222 15855
## 4 607614 392930 435707 514340 231516 49045
## 5 68233 45184 45640 73885 10797 1504
## 6 24049 15971 16814 26338 4376 190
## 7 127833 82784 84535 154304 5585 2762
## 8 77244 50878 51538 90422 6972 1505
## 9 114231 75368 80653 72951 67351 4916
## 10 24851 15476 16910 21345 8901 325
## 11 176511 121305 124800 199955 22103 11186
## 12 23763 14618 14898 28689 170 111
## 13 189002 122344 127788 198611 33702 6564
## 14 212310 152843 159652 183406 57755 54328
## 15 15837 9426 10240 16175 2914 218
## 16 653497 501571 537627 563929 187943 153504
## 17 595152 435878 469283 170009 572465 38811
## 18 37499 24230 24841 43799 3439 268
## 19 81547 55420 55559 87485 15922 3079
## 20 20719 13821 11980 13703 10845 266
## 21 29319 17595 19866 31137 4342 534
## 22 113424 75958 73588 124033 15675 2636
## 23 75053 48622 53392 69062 25818 3336
## 24 41458 25205 26354 42634 6977 710
## American.Indian.Alaska.Native.Alone Native.Hawaiian.Pacific.Islander.Alone
## 1 120 24
## 2 1025 408
## 3 1886 309
## 4 2320 398
## 5 150 34
## 6 96 18
## 7 348 75
## 8 280 35
## 9 894 163
## 10 27 0
## 11 618 174
## 12 62 0
## 13 444 11
## 14 592 41
## 15 39 0
## 16 3091 477
## 17 3266 333
## 18 38 67
## 19 220 28
## 20 91 13
## 21 32 31
## 22 330 62
## 23 210 74
## 24 102 55
## Some.Other.Race.Alone Two.or.More.Races Hispanic.or.Latino..of.any.race.
## 1 210 1580 1257
## 2 13095 20576 41275
## 3 10412 14387 30729
## 4 8728 22290 42438
## 5 541 3913 3276
## 6 721 1046 2247
## 7 1001 3244 5368
## 8 983 2219 4231
## 9 1151 8595 8358
## 10 554 1234 1615
## 11 3917 8152 21623
## 12 16 468 316
## 13 3267 7533 10608
## 14 3727 12646 20343
## 15 29 291 851
## 16 88027 42227 197242
## 17 96031 24246 157427
## 18 441 1019 1805
## 19 684 3561 5377
## 20 414 469 906
## 21 378 1007 2427
## 22 1375 5435 6698
## 23 983 2531 5145
## 24 149 932 1741
## Life.expectancy Geography
## 1 76.4 R
## 2 79.6 S/U
## 3 73.4 S/U
## 4 78.7 S/U
## 5 79.7 R
## 6 76.1 R
## 7 79.1 R
## 8 76.8 R
## 9 79.2 R
## 10 76.8 R
## 11 80.2 R
## 12 78.9 R
## 13 79.4 R
## 14 83.3 R
## 15 79.6 R
## 16 84.9 S/U
## 17 79.6 S/U
## 18 79.4 R
## 19 79.5 R
## 20 76.3 R
## 21 81.1 R
## 22 77.5 R
## 23 76.9 R
## 24 78.5 R
###1.Life expectancy: ###a. Does characteristics of poverty have an impact on life expectancy? ###2. Geography ###a. Does geography have any effect on socioeconomic status? ###3. County ###a. Does where you live have an effect on the population with higher education?
library(janitor)
##
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
Maryland_df <- MD_df%>%
janitor::clean_names()
Maryland_df$life_expectancy
## [1] 76.4 79.6 73.4 78.7 79.7 76.1 79.1 76.8 79.2 76.8 80.2 78.9 79.4 83.3 79.6
## [16] 84.9 79.6 79.4 79.5 76.3 81.1 77.5 76.9 78.5
library("highcharter")
library("magrittr")
##
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
##
## set_names
## The following object is masked from 'package:tidyr':
##
## extract
hc <- highchart() %>%
hc_title(text = "Life Expectancy Amongst Counties") %>%
hc_chart(type = "column") %>%
hc_xAxis(categories = c("Allegany County", "Anne Arundel County" , "Baltimore city" , "Baltimore County" , "Calvert County" , "Caroline County" ,
"Carroll County" , "Cecil County" , "Charles County" ,
"Dorchester County" , "Frederick County" , "Garrett County" ,
"Harford County" , "Howard County" , "Kent County" ,
"Montgomery County" , "Prince George's County", "Queen Anne's County" ,
"St. Mary's County" ,"Somerset County" , "Talbot County" ,
"Washington County" , "Wicomico County" , "Worcester County" )) %>%
hc_add_series(data = c(76.4, 79.6, 73.4, 78.7, 79.7, 76.1, 79.1, 76.8 ,79.2, 76.8, 80.2, 78.9, 79.4, 83.3, 79.6, 84.9 ,79.6, 79.4, 79.5, 76.3, 81.1, 77.5, 76.9 ,78.5)) %>% hc_yAxis(min = 60)%>%
hc_title(
text=" Lif Expectancy of Every County In Maryland")%>%
hc_xAxis(
title = list(text="County")) %>%
hc_yAxis(
title = list(text="Life Expectancy"))
hc1 <- hc %>%
hc_tooltip(crosshairs = TRUE, shared = TRUE) %>%
hc_yAxis(minorGridLineWidth = 0, gridLineWidth = 0,
plotBands = list(
list(from = 70, to = 75, color = "rgba(68, 170, 213, 0.1)",
label = list(text = "Low")),
list(from = 75.1, to = 80, color = "rgba(0, 0, 0, 0.1)",
label = list(text = "Medium")),
list(from = 80.1, to = 85, color = "rgba(68, 170, 213, 0.1)",
label = list(text = "High"))
))%>%
hc_title(
text=" Lif Expectancy of Every County In Maryland")%>%
hc_xAxis(
title = list(text="County")) %>%
hc_yAxis(
title = list(text="Life Expectancy"))
hc1
data_new1 <- Maryland_df[order(Maryland_df$life_expectancy, decreasing = TRUE), ]
Counties_5 <- subset(data_new1, select = c( "life_expectancy", "jurisdictions", "median_household_income","percent_civilian_population_w_health_ins_cov")) %>%
head(5)
Counties_10 <-subset(data_new1, select = c("life_expectancy","jurisdictions", "median_household_income", "percent_civilian_population_w_health_ins_cov")) %>%
tail(5)
Counties_total <- rbind(Counties_10, Counties_5)
ggplot(Counties_total, aes(x = median_household_income, y = life_expectancy, color=jurisdictions)) +
xlab("Median Household Income") +
ylab("Life Expectancy") +
theme_minimal(base_size = 14, base_family = "Georgia") +
geom_point(size = 3, alpha = 0.5) +
geom_smooth(method=lm, se=FALSE, lty = 2, size = 0.3)+
ggtitle("County Life Expectancy In relation to Income")+
geom_smooth(method = lm, se = FALSE, color = "black", lty=2, size = 0.3)+
xlim(30000 ,120000)
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
setwd("~/Data 110 Folder")
MD_lit <- read.csv("ExportedData1.csv")
MD_lit1 = cbind(MD_df, MD_lit)
view(MD_lit1)
data_new2 <- MD_lit1[order(MD_lit1$Upper.bound, decreasing = FALSE), ]
colnames(data_new2)
## [1] "Jurisdictions"
## [2] "Total.Households"
## [3] "Population.25.years.and.older"
## [4] "Less.than.9th.Grade"
## [5] "High.School.no.Diploma"
## [6] "High.School.Diploma"
## [7] "Some.College.no.degree"
## [8] "Associates.degree"
## [9] "Bachelor.s.degree"
## [10] "Graduate.or.Professional"
## [11] "Employment.Status.of.the.Population.16.years.and.over"
## [12] "Civilian.Labor.Force..16.years...over."
## [13] "Employed"
## [14] "Unemployed"
## [15] "Unemployment.Rate"
## [16] "Commute.Workers.16.yrs.and.over"
## [17] "Percent.Drove.Alone"
## [18] "Percent.Carpooled"
## [19] "Percent.Public.Transportation"
## [20] "Percent.Walked"
## [21] "Percent.Other"
## [22] "Percent.Worked.at.Home"
## [23] "Median.Household.Income...."
## [24] "Families"
## [25] "Percent.Families.in.Poverty"
## [26] "Percent.Civilian.Population.w..Health.Ins..Cov."
## [27] "Total.Housing.Units"
## [28] "Percent.Occupied"
## [29] "Percent.Vacant"
## [30] "Total.Population"
## [31] "Voting.Age.Population"
## [32] "Male"
## [33] "Female"
## [34] "White.Alone"
## [35] "Black.Alone"
## [36] "Asian.Alone"
## [37] "American.Indian.Alaska.Native.Alone"
## [38] "Native.Hawaiian.Pacific.Islander.Alone"
## [39] "Some.Other.Race.Alone"
## [40] "Two.or.More.Races"
## [41] "Hispanic.or.Latino..of.any.race."
## [42] "Life.expectancy"
## [43] "Geography"
## [44] "X"
## [45] "X.1"
## [46] "X.2"
## [47] "prose.literacy.skills2"
## [48] "Lower.bound"
## [49] "Upper.bound"
County_5 <- subset(data_new2, select = c( "Upper.bound", "Jurisdictions","Percent.Families.in.Poverty")) %>%
head(5)
County_10 <-subset(data_new2, select = c("Upper.bound", "Jurisdictions", "Percent.Families.in.Poverty")) %>%
tail(5)
County_total <- rbind(County_10, County_5)
ggplot(County_total, aes(x =Percent.Families.in.Poverty , y = Upper.bound, color=Jurisdictions)) +
xlab("Percent of Families in Poverty") +
ylab("Illiteracy Rate") +
theme_minimal(base_size = 14, base_family = "Georgia") +
geom_point(size = 3, alpha = 0.5) +
geom_smooth(method=lm, se=FALSE, lty = 2, size = 0.3)+
ggtitle("County Poverty Rate In relation to Illiteracy")+
geom_smooth(method = lm, se = FALSE, color = "black", lty=2, size = 0.3)
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
ggplot(data = Counties_total, aes(x = reorder (jurisdictions, median_household_income), y = median_household_income, fill = jurisdictions,)) +
geom_bar(stat = "identity")+
theme(axis.text.x = element_text(angle = 90))+
coord_flip() +
geom_text(aes(label = median_household_income ), hjust = 1.2, colour = "white", fontface = "bold") +
ggtitle("Income of Top 5 and Lowest 5 counties in MD")+
xlab("County")+
ylab("Median Household Income")
##Link to tableau: https://public.tableau.com/app/profile/nate.jack7718/viz/MDSocio/MDSocioeconomics
###This tableau is a better visual Of poverty rate across the state of Maryland. As you can see, near the district, the poverty rate is the lowest. Then as we get to the outskirts of MD in the North-Western and South-Eastern parts, moving away from the district, poverty rates grow.
x <- c(1096, 2716, 18833, 4642, 10564, 7866)
labels <- c("Less Than 9th Grade", "No High School Diploma", "High School Diploma", "Associate's", "Bachelors", "Graduate or Professional")
piepercent<- round(100*x/sum(x), 1)
pie(x, labels = piepercent, main = "Relationship Educational Background With Lowest Poverty Pie Chart",col = rainbow(length(x)))
legend("topleft", c("Less Than 9th Grade", "No High School Diploma", "High School Diploma", "Associate's", "Bachelors", "Graduate or Professional"), cex = 0.6,
fill = rainbow(length(x)))
x1 <- c(2187, 5674, 25824, 5084, 9632, 6462)
labels <- c("Less Than 9th Grade", "No High School Diploma", "High School Diploma", "Associate's", "Bachelors", "Graduate or Professional")
piepercent<- round(100*x1/sum(x1), 1)
pie(x1, labels = piepercent, main = "Relationship Educational Background With Middle Poverty Pie Chart",col = rainbow(length(x1)))
legend("topleft", c("Less Than 9th Grade", "No High School Diploma", "High School Diploma", "Associate's", "Bachelors", "Graduate or Professional"), cex = 0.6,
fill = rainbow(length(x1)))
### Setting up data for pie chart with Highest poverty rate
x2 <- c(872, 2228, 7180, 887, 1617, 845)
labels <- c("Less Than 9th Grade", "No High School Diploma", "High School Diploma", "Associate's", "Bachelors", "Graduate or Professional")
piepercent<- round(100*x2/sum(x2), 1)
pie(x2, labels = piepercent, main = "Relationship Educational Background With Highest Poverty Pie Chart",col = rainbow(length(x2)))
legend("topleft", c("Less Than 9th Grade", "No High School Diploma", "High School Diploma", "Associate's", "Bachelors", "Graduate or Professional"), cex = 0.6,
fill = rainbow(length(x2)))
new_df <- subset(Maryland_df, select = -c(jurisdictions,total_households, population_25_years_and_older, employment_status_of_the_population_16_years_and_over,civilian_labor_force_16_years_over, employed, commute_workers_16_yrs_and_over, percent_drove_alone, percent_carpooled, percent_worked_at_home, families, percent_civilian_population_w_health_ins_cov, total_housing_units, percent_occupied, voting_age_population, geography, male, female, white_alone, black_alone, asian_alone, american_indian_alaska_native_alone, native_hawaiian_pacific_islander_alone, some_other_race_alone, two_or_more_races, hispanic_or_latino_of_any_race, percent_other, percent_vacant))
colnames(Maryland_df)
## [1] "jurisdictions"
## [2] "total_households"
## [3] "population_25_years_and_older"
## [4] "less_than_9th_grade"
## [5] "high_school_no_diploma"
## [6] "high_school_diploma"
## [7] "some_college_no_degree"
## [8] "associates_degree"
## [9] "bachelor_s_degree"
## [10] "graduate_or_professional"
## [11] "employment_status_of_the_population_16_years_and_over"
## [12] "civilian_labor_force_16_years_over"
## [13] "employed"
## [14] "unemployed"
## [15] "unemployment_rate"
## [16] "commute_workers_16_yrs_and_over"
## [17] "percent_drove_alone"
## [18] "percent_carpooled"
## [19] "percent_public_transportation"
## [20] "percent_walked"
## [21] "percent_other"
## [22] "percent_worked_at_home"
## [23] "median_household_income"
## [24] "families"
## [25] "percent_families_in_poverty"
## [26] "percent_civilian_population_w_health_ins_cov"
## [27] "total_housing_units"
## [28] "percent_occupied"
## [29] "percent_vacant"
## [30] "total_population"
## [31] "voting_age_population"
## [32] "male"
## [33] "female"
## [34] "white_alone"
## [35] "black_alone"
## [36] "asian_alone"
## [37] "american_indian_alaska_native_alone"
## [38] "native_hawaiian_pacific_islander_alone"
## [39] "some_other_race_alone"
## [40] "two_or_more_races"
## [41] "hispanic_or_latino_of_any_race"
## [42] "life_expectancy"
## [43] "geography"
M<-cor(new_df)
corrplot(M, type = 'upper', order = 'hclust', tl.col = 'black',
cl.ratio = 0.2, tl.srt = 45, col = COL2('RdBu', 10))
setwd("~/Data 110 Folder")
MD_bounds <- read.csv("MD_bounds.csv")
MD_Geo = cbind(MD_df, MD_bounds)
view(MD_Geo)
MD_Geo%>%
select(Longitude, Unemployment.Rate, Percent.Families.in.Poverty, Median.Household.Income....,Life.expectancy, Latitude) %>%
leaflet() %>%
setView(lng = -77.2030633, lat = 39.1373815, zoom = 7) %>%
addTiles() %>%
addMarkers(clusterOptions = markerClusterOptions(),
~Longitude, ~Latitude,
label = ~paste(
"Unemployment :", Unemployment.Rate,
"Poverty Rate :", Percent.Families.in.Poverty,
"Income :", Median.Household.Income....,
"Life Expectancy :", Life.expectancy))
###The variables are a mix of characters, numeric values, and, integers. The data came from the Maryland Department of Planning. I cleaned the data by obtaining the top and lowest five counties in the state of Maryland. I used subset and select functions in R. I wanted to see the top and lowest 5 counties in regard to their life expectancy, so I selected “jurisdiction” and “life expectancy” to get the result. After doing that, I used the “rbind” function in order to combine the two new data frames into one. I also extracted information for each pie chart by creating vectors that included: “Less Than 9th Grade”, “No High School Diploma”, “High School Diploma”, “Associate’s”, “Bachelors”, and “Graduate or Professional”. I assigned the correlating numeric values to each variable in order for them to be plotted in the pie charts.
###Lastly, I chose this topic because I’ve had my own experiences with poverty. I know what it means for someone to live in deep poverty and how it impacts people and their livelihood. I know how to live in a home with a single mother who has to work two or three jobs to stay afloat. I understand how household income can affect how much food you put in the fridge every month, how it affects the age you die, and how geography plays an overwhelming role in what resources you receive and quickly they come. Every month about 3 to four times, I donate the rest of the food that I didn’t sell from my catering business. I also receive donations for just about holiday and prepare and cook it for anyone I can find who is in need or less fortunate. Therefore, researching a topic that affected me and still impacts what I do today, is my purpose for using this topic.