library("readxl")
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(sjPlot)
library(sjmisc)
library(sjlabelled)
## 
## Attaching package: 'sjlabelled'
## The following object is masked from 'package:dplyr':
## 
##     as_label
library(ggplot2)


vaccine <- read.csv(url("https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/us_state_vaccinations.csv"))

ses <- read.csv(url("https://raw.githubusercontent.com/stccenter/COVID-19-Data/master/Socioeconomic%20Data/Socioeconomic%20determinants/socioeconomic%20determinant%20for%20state.csv"))

employment <- read.csv(url("https://raw.githubusercontent.com/stccenter/COVID-19-Data/master/Socioeconomic%20Data/Employment/Unemployment%20Insurance%20Claims/Summary%20report/Unemployment_allstates.csv"))



    

employment<-employment %>% 
  filter(Filed.week.ended=="03/06/2021" )

ggplot(vaccine) + aes(x = location, y=people_fully_vaccinated_per_hundred) +geom_bar(stat='identity')+theme_bw()
## Warning: Removed 708 rows containing missing values (position_stack).

vaccine<-vaccine %>% 
  filter(date=="2021-04-01", people_fully_vaccinated!="NA", people_vaccinated!="NA" )




sum(vaccine[, 'people_fully_vaccinated'])
## [1] 114583082
sum(vaccine[, 'people_vaccinated'])
## [1] 202646126
nrow(vaccine)
## [1] 64
nrow(ses)
## [1] 51
#View(ses_FINAL)


names(ses)[names(ses) == "Name"] <- "location"
names(employment)[names(employment) == "State"] <- "location"

innerJoinDf <- inner_join(ses,vaccine,by="location")
nrow(innerJoinDf)
## [1] 50
innerJoinDf <- inner_join(innerJoinDf,employment,by="location")


library(kableExtra)
## 
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
## 
##     group_rows
library(table1)
## 
## Attaching package: 'table1'
## The following objects are masked from 'package:base':
## 
##     units, units<-
innerJoinDf %>%
  select(Postal.Code,Insured.Unemployment.Rate,Uninsured, Poverty.rate,Population.size,Senior.Population ,White.Population,House.Owner,Bachelor.degrees) %>% 
 kable() %>%
  kable_styling()
Postal.Code Insured.Unemployment.Rate Uninsured Poverty.rate Population.size Senior.Population White.Population House.Owner Bachelor.degrees
AL 0.90 9.7 15.5 4903185 17.4 69.5 68.8 16.3
AK 5.58 12.2 10.1 731545 12.4 71.4 64.7 18.5
AZ 2.09 11.3 13.5 7278717 18.0 81.7 65.3 18.8
AR 2.11 9.1 16.2 3017804 17.4 79.3 65.5 15.1
CA 4.16 7.7 11.8 39512223 14.8 63.6 54.9 21.9
CO 3.49 8.0 9.3 5758736 14.7 87.3 65.9 26.6
CT 5.01 5.9 10.0 3565287 17.6 77.8 65.0 22.0
DE 2.77 6.6 11.3 973764 19.5 70.5 70.3 19.5
DC 3.46 3.5 13.5 705749 12.4 45.1 41.5 25.7
FL 1.66 13.2 12.7 21477737 20.9 77.1 66.2 19.3
GA 3.26 13.4 13.3 10617423 14.3 59.9 64.1 19.9
HI 3.15 4.2 9.3 1415872 19.0 41.1 60.2 22.1
ID 1.90 10.8 11.2 1787065 16.2 92.5 71.6 18.8
IL 4.35 7.4 11.5 12671821 16.1 73.8 66.0 21.7
IN 2.35 8.7 11.9 6732219 16.1 85.2 69.3 17.3
IA 2.94 5.0 11.2 3155070 17.5 91.9 70.5 19.8
KS 1.66 9.2 11.4 2913314 16.4 87.1 66.5 21.6
KY 2.43 6.4 16.3 4467673 16.9 88.9 67.0 14.9
LA 2.63 8.9 19.0 4648794 16.0 63.5 66.5 16.0
ME 2.79 8.0 10.9 1344212 21.3 95.9 72.2 20.8
MD 2.54 6.0 9.0 6045680 15.9 57.3 66.8 21.8
MA 4.36 3.0 9.4 6892503 17.0 80.2 62.2 24.7
MI 3.86 5.8 13.0 9986857 17.7 81.0 71.6 18.2
MN 3.89 4.9 9.0 5639632 16.3 85.1 71.9 24.5
MS 2.86 13.0 19.6 2976149 16.4 59.4 67.3 13.7
MO 2.09 10.0 12.9 6137428 17.2 84.5 67.1 18.4
MT 3.60 8.3 12.6 1068778 19.5 91.1 68.9 23.1
NE 1.49 8.3 9.9 1934408 16.1 88.7 66.3 21.8
NV 5.43 11.4 12.5 3080156 16.2 68.4 56.6 16.7
NH 3.93 6.3 7.3 1359711 18.6 94.7 71.0 22.9
NJ 3.29 7.9 9.2 8882190 16.6 69.5 63.3 25.1
NM 4.18 10.0 18.2 2096829 18.0 76.8 68.1 15.5
NC 1.37 11.3 13.6 10488084 16.7 70.5 65.3 20.5
ND 2.27 6.9 10.6 762062 15.8 89.0 61.3 21.5
OH 3.41 6.6 13.1 11689100 17.5 83.5 66.0 18.2
OK 2.25 14.3 15.2 3956971 16.1 79.2 65.5 17.1
OR 3.70 7.2 11.4 4217737 18.2 88.1 62.9 21.0
PA 6.05 5.8 12.0 12801989 18.7 81.9 68.4 19.5
RI 4.54 4.1 10.8 1059361 17.7 82.0 61.7 20.9
SC 2.05 10.8 13.8 5148714 18.2 68.8 70.3 18.4
SD 1.38 10.2 11.9 884659 17.4 86.7 67.8 20.6
TN 1.53 10.1 13.9 6829174 16.7 79.3 66.5 18.0
TX 2.59 18.4 13.6 28995881 12.9 75.9 61.9 20.0
UT 1.03 9.7 8.9 3205958 11.4 90.2 70.6 23.4
VT 4.21 4.5 10.2 623989 20.1 96.2 70.9 22.7
VA 1.70 7.9 9.9 8535519 15.9 70.2 66.1 22.4
WA 3.92 6.6 9.8 7614893 15.9 79.5 63.1 22.8
WV 3.35 6.7 16.0 1792147 20.5 94.7 73.4 12.6
WI 3.61 5.7 10.4 5822434 17.5 87.4 67.2 20.7
WY 2.01 12.3 10.1 578759 17.1 93.4 71.9 18.8