Analysis of Census data, American Community Servey 2018.

TidyCensus Package was used to extract data for the following Census variables.

Var<-c('Total workers' ="C27013_002",'insurance'="C27013_003",'noInsurance'="C27013_004")


ca_hc <- get_acs(geography = "county",
                   variables = Var,
                   year = 2018,
                   survey = "acs5",
                 state = "06",   output = 'wide',
                   geometry = F) 
## Getting data from the 2014-2018 5-year ACS
## Warning: `funs()` is deprecated as of dplyr 0.8.0.
## Please use a list of either functions or lambdas: 
## 
##   # Simple named list: 
##   list(mean = mean, median = median)
## 
##   # Auto named with `tibble::lst()`: 
##   tibble::lst(mean, median)
## 
##   # Using lambdas
##   list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
ca_hc$NAME <- gsub("County, California","",ca_hc$NAME)


 library(DT)
ca_hc1 <- ca_hc[,c(2,3,5,7)]

ca_hc1 %>%
  kable(col.names = c("County","Total workers","Worker with insurance","Worker without insurance")) %>%
 kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
County Total workers Worker with insurance Worker without insurance
Lake 12988 9463 3525
Mariposa 3996 3378 618
Yuba 18844 15132 3712
Contra Costa 354027 316881 37146
Lassen 5951 5419 532
Santa Barbara 127283 99819 27464
Sonoma 148791 127901 20890
Imperial 34998 26811 8187
Mono 5030 4062 968
Alameda 574651 508949 65702
Sacramento 454965 388329 66636
Napa 43043 38330 4713
Monterey 111282 87544 23738
Sierra 666 555 111
San Diego 1023860 871282 152578
Yolo 59393 51851 7542
Humboldt 33106 25609 7497
Alpine 164 130 34
Mendocino 20179 14969 5210
Santa Cruz 74671 64480 10191
Los Angeles 3239505 2501304 738201
Riverside 653172 512200 140972
Santa Clara 680592 616714 63878
Marin 76321 69472 6849
Siskiyou 9410 7470 1940
Shasta 43932 35764 8168
Del Norte 5235 4242 993
San Luis Obispo 76508 64363 12145
Glenn 6965 5293 1672
Butte 52811 43095 9716
Plumas 4076 3582 494
Kern 221166 163649 57517
Orange 1031753 871956 159797
Calaveras 10492 9219 1273
Sutter 24290 18657 5633
San Mateo 274325 247732 26593
Tuolumne 12234 10726 1508
San Joaquin 199543 159646 39897
Amador 8573 7185 1388
Merced 64682 47911 16771
Modoc 1990 1399 591
Inyo 5001 4182 819
Stanislaus 144263 116117 28146
Tehama 15228 11756 3472
San Benito 17709 14268 3441
El Dorado 50557 45237 5320
San Francisco 354503 327759 26744
Tulare 110136 77379 32757
Nevada 23987 19853 4134
Madera 35029 25486 9543
Trinity 2400 1660 740
San Bernardino 595736 465626 130110
Placer 112608 102362 10246
Solano 129853 114466 15387
Colusa 5917 4388 1529
Kings 35675 27828 7847
Fresno 244726 187515 57211
Ventura 261095 218516 42579
ca_hc1 %>%
  ggplot(aes(x = insuranceE, y = reorder(NAME,insuranceE))) +
  geom_point(color="darkred")+
  labs(x="Insurance Coverage Count",y="County",title = "Full-time workers by county")

State Assembly District

hc_ad <- get_acs(geography = "state legislative district (lower chamber)",
                   variables = Var,
                   year = 2018,
                   survey = "acs5",
                 state = "06",   output = 'wide',
                   geometry = F) 
## Getting data from the 2014-2018 5-year ACS
hc_ad$NAME <- gsub("2018","",hc_ad$NAME)
hc_ad$District <-  as.numeric(gsub("\\D", "", hc_ad$NAME))
hc_ad$Yes.Percent <- hc_ad$insuranceE/hc_ad$`Total workersE`
hc_ad$No.Percent <- 1- hc_ad$Yes.Percent

 library(DT)
hc_ad1 <- hc_ad[,c(9,10,11,7)]

hc_ad1 %>%
  kable(col.names = c("Assembly District","Workers with health insurance (%)","Workers with no insurance (%)",
                      "Workers with no insurance (population)")) %>%
 kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
Assembly District Workers with health insurance (%) Workers with no insurance (%) Workers with no insurance (population)
1 0.8254050 0.1745950 19078
2 0.8165237 0.1834763 22252
3 0.7954750 0.2045250 23919
4 0.8561375 0.1438625 19215
5 0.8194776 0.1805224 20340
6 0.9261161 0.0738839 11510
7 0.8417734 0.1582266 24468
8 0.8392275 0.1607725 23408
9 0.8465593 0.1534407 22213
10 0.8825829 0.1174171 16818
11 0.8817377 0.1182623 17697
12 0.8417273 0.1582727 21932
13 0.7868420 0.2131580 28217
14 0.8828406 0.1171594 18499
15 0.8955335 0.1044665 16688
16 0.9618175 0.0381825 6599
17 0.9142308 0.0857692 18078
18 0.8340503 0.1659497 27774
19 0.9286591 0.0713409 13895
20 0.8712684 0.1287316 23131
21 0.7430293 0.2569707 30238
22 0.9179225 0.0820775 14743
23 0.8447627 0.1552373 22035
24 0.9193421 0.0806579 14345
25 0.9186022 0.0813978 15984
29 0.8887964 0.1112036 15631
26 0.7111496 0.2888504 33513
27 0.8363260 0.1636740 27455
28 0.9309155 0.0690845 11976
30 0.7867181 0.2132819 28728
31 0.6592383 0.3407617 35567
32 0.6369704 0.3630296 38781
33 0.7462700 0.2537300 28740
34 0.8211790 0.1788210 24592
35 0.7792942 0.2207058 30419
36 0.8321632 0.1678368 20942
37 0.8441101 0.1558899 22255
38 0.9056894 0.0943106 14884
39 0.7226508 0.2773492 41089
40 0.8171393 0.1828607 25275
41 0.8687720 0.1312280 20220
42 0.7934383 0.2065617 23736
43 0.8222667 0.1777333 28614
44 0.8185797 0.1814203 25907
45 0.8231579 0.1768421 29397
46 0.7447291 0.2552709 42994
47 0.7368349 0.2631651 38240
48 0.7813894 0.2186106 32740
49 0.7715200 0.2284800 33842
50 0.9087758 0.0912242 16240
51 0.6804672 0.3195328 47164
52 0.7426834 0.2573166 38202
53 0.5289708 0.4710292 77416
54 0.8257391 0.1742609 28274
55 0.8966484 0.1033516 16066
56 0.6735610 0.3264390 35985
57 0.8189931 0.1810069 28253
58 0.7643830 0.2356170 35839
59 0.5015663 0.4984337 65234
60 0.8136528 0.1863472 29602
61 0.7570046 0.2429954 34977
62 0.7911776 0.2088224 34037
63 0.7049028 0.2950972 41856
64 0.6752532 0.3247468 44855
65 0.8156634 0.1843366 27548
66 0.8989066 0.1010934 15940
67 0.8287244 0.1712756 24415
68 0.8894677 0.1105323 19350
69 0.6784223 0.3215777 50917
70 0.8184467 0.1815533 28912
71 0.8400728 0.1599272 22401
72 0.8282743 0.1717257 25368
73 0.9197608 0.0802392 12921
74 0.9021735 0.0978265 16163
75 0.8159242 0.1840758 28041
76 0.8596933 0.1403067 21164
77 0.9364043 0.0635957 10926
78 0.8985776 0.1014224 17648
79 0.8527384 0.1472616 23199
80 0.7191971 0.2808029 35489
hc_ad1 %>%
  ggplot(aes(x = Yes.Percent, y = reorder(District,Yes.Percent))) +
  geom_point(color="brown4")+
  labs(x="Full-time workers(percent)",y="Assembly District",title = "Insurance Coverage (%) by Assembly District")

State Senate District

hc_sd <- get_acs(geography = "state legislative district (upper chamber)",
                   variables = Var,
                   year = 2018,
                   survey = "acs5",
                 state = "06",   output = 'wide',
                   geometry = F) 
## Getting data from the 2014-2018 5-year ACS
hc_sd$NAME <- gsub("2018","",hc_sd$NAME)
hc_sd$District <-  as.numeric(gsub("\\D", "", hc_sd$NAME))
hc_sd$Yes.Percent <- hc_sd$insuranceE/hc_sd$`Total workersE`
hc_sd$No.Percent <- 1- hc_sd$Yes.Percent

 library(DT)
hc_sd1 <- hc_sd[,c(9,10,11,7)] 

hc_sd1 %>%
  kable(col.names = c("Senate District","Workers with health insurance (%)","Workers with no insurance (%)",
                      "Workers with no insurance (population)")) %>%
 kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
Senate District Workers with health insurance (%) Workers with no insurance (%) Workers with no insurance (population)
1 0.8796735 0.1203265 30632
2 0.8414843 0.1585157 40720
3 0.8888036 0.1111964 32169
4 0.8249725 0.1750275 46865
5 0.8096682 0.1903318 52401
6 0.8469084 0.1530916 45963
7 0.9170090 0.0829910 27176
8 0.8418905 0.1581095 41973
9 0.8642962 0.1357038 44413
10 0.8973608 0.1026392 38913
11 0.9213822 0.0786178 31763
12 0.7338233 0.2661767 62806
13 0.9180870 0.0819130 29298
14 0.6210836 0.3789164 77086
15 0.8892862 0.1107138 37404
16 0.8013036 0.1986964 49782
17 0.8547279 0.1452721 40793
18 0.7347011 0.2652989 83510
19 0.7841645 0.2158355 61299
20 0.7397905 0.2602095 76442
21 0.8202884 0.1797116 46493
22 0.7587701 0.2412299 72485
23 0.8066639 0.1933361 51155
24 0.6083441 0.3916559 123607
25 0.8604007 0.1395993 42844
26 0.9175928 0.0824072 28266
27 0.8708420 0.1291580 41010
28 0.7824765 0.2175235 58099
29 0.8501751 0.1498249 45988
33 0.6872341 0.3127659 91393
30 0.6887529 0.3112471 93080
31 0.7867237 0.2132763 64579
32 0.8140382 0.1859618 57817
34 0.7690820 0.2309180 70094
35 0.7421079 0.2578921 75460
36 0.8904197 0.1095803 34456
37 0.8959931 0.1040069 35551
38 0.8419639 0.1580361 48055
39 0.9072690 0.0927310 32353
40 0.7670287 0.2329713 58822
hc_sd1 %>%
  ggplot(aes(x = Yes.Percent, y = reorder(District,Yes.Percent))) +
  geom_point(color="blue")+
  labs(x="Full-time workers(percent)",y="State Senate District",title = "Insurance Coverage (%) by State Senate District")

Congressional District

hc_cd <- get_acs(geography = "congressional district",
                   variables = Var,
                   year = 2018,
                   survey = "acs5",
                 state = "06",   output = 'wide',
                   geometry = F) 
## Getting data from the 2014-2018 5-year ACS
hc_cd$NAME <- gsub("116","",hc_cd$NAME)
hc_cd$District <-  as.numeric(gsub("\\D", "", hc_cd$NAME))
hc_cd$Yes.Percent <- hc_cd$insuranceE/hc_cd$`Total workersE`
hc_cd$No.Percent <- 1- hc_cd$Yes.Percent


hc_cd1 <- hc_cd[,c(9,10,11,7)]

hc_cd1 %>%
  kable(col.names = c("Congressional District","Workers with health insurance (%)","Workers with no insurance (%)",
                      "Workers with no insurance (population)")) %>%
 kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
Congressional District Workers with health insurance (%) Workers with no insurance (%) Workers with no insurance (population)
1 0.8212441 0.1787559 29415
3 0.8402418 0.1597582 31897
5 0.8745109 0.1254891 27708
6 0.8224284 0.1775716 40017
8 0.7662799 0.2337201 41210
10 0.8245619 0.1754381 36242
11 0.8792471 0.1207529 28080
13 0.8693659 0.1306341 32423
15 0.9058235 0.0941765 26302
16 0.6929580 0.3070420 51354
18 0.9290198 0.0709802 17979
20 0.8035462 0.1964538 38181
21 0.6458584 0.3541416 57196
23 0.8163261 0.1836739 35497
24 0.8054396 0.1945604 40281
26 0.8236538 0.1763462 38775
28 0.8177984 0.1822016 46486
29 0.6760152 0.3239848 73887
31 0.7985909 0.2014091 42967
33 0.9395299 0.0604701 14161
34 0.5961276 0.4038724 96036
36 0.7188631 0.2811369 49556
38 0.8163863 0.1836137 42885
39 0.8790473 0.1209527 28312
41 0.7502902 0.2497098 54214
42 0.8520810 0.1479190 34528
44 0.6881648 0.3118352 64761
46 0.7086604 0.2913396 69673
47 0.8311113 0.1688887 39359
49 0.8769995 0.1230005 27675
51 0.7141329 0.2858671 50513
52 0.9291067 0.0708933 18306
2 0.8534541 0.1465459 28303
4 0.8919318 0.1080682 21877
7 0.8867055 0.1132945 25685
9 0.8116928 0.1883072 38902
12 0.9271206 0.0728794 23089
14 0.9053513 0.0946487 25609
25 0.8708576 0.1291424 27797
17 0.9233506 0.0766494 22559
19 0.8651745 0.1348255 34931
22 0.8104969 0.1895031 38421
27 0.8353764 0.1646236 37992
30 0.8494416 0.1505584 39192
32 0.7690890 0.2309110 52360
35 0.7379301 0.2620699 58483
37 0.7736054 0.2263946 55442
40 0.5886638 0.4113362 88267
43 0.7603755 0.2396245 55423
45 0.9175238 0.0824762 21258
48 0.8785113 0.1214887 29267
50 0.8304093 0.1695907 38299
53 0.8658903 0.1341097 33983
hc_cd1$District <- as.numeric(hc_cd1$District)
hc_cd1 %>%
  ggplot(aes(x = Yes.Percent, y = reorder(District,Yes.Percent))) +
  geom_point(color="brown4")+
  labs(x="Full-time workers(percent)",y="Congressional District",title = "Insurance Coverage (%) by Congressional District")