-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.rmarkdown
1637 lines (1242 loc) · 73 KB
/
index.rmarkdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: Climate resilience requires equitable access to quality green energy jobs. The City of Saint Paul is at the forefront.
author:
- name: Elham Ali
corresponding: true
email: [email protected]
roles:
- Researcher
- Data Storytelling
- Human-centered Design
- Data Visualization
affiliations:
- Beeck Center for Social Impact and Innovation at Georgetown University
license: CC BY-SA 4.0
keywords:
- climate justice
- climate-ready workforce
- green jobs
- climate change
- equity
date: '2024-09-19'
abstract: |
Minnesota, particularly the City of Saint Paul, has seen a surge in climate resilience funding aimed at expanding green energy job opportunities. However, BIPOC communities remain underrepresented in these jobs and disproportionately suffer from the adverse effects of human-driven climate change.
keypoints:
- climate change
- green jobs
- workforce hiring
citation:
container-title: Beeck Center for Social Impact and Innovation
draft: false
bibliography: references.bib
code-fold: true
# reference-location: margin
# citation-location: margin
echo: true
warning: false
---
## Background
This analysis looks at access to green energy jobs (like energy efficiency, renewable energy, and green construction) by race/ethnicity, gender, education, and income in St. Paul, Minnesota, USA.
## Questions
Here are some of the questions I will explore using different datasets:
- How much climate resilience funding has St. Paul received?
- What specific green jobs are being created in St. Paul (e.g., energy efficiency, renewable energy, green construction)?
- What is the quality of these jobs? How much do they pay? What qualifications are needed (education and experience)?
- Who is getting these jobs, based on education, race/ethnicity, gender, and income levels?
## Data Sources
The data for this project comes from:
- The National Center for O\*NET Development
- 2023 Occupational Employment and Wage Survey
- Urban Institute 11 elements of job quality: Clean Energy Job Quality and Education Data
- National and local demographic data from the 2022 American Community Survey Public Use Microdata Sample (ACS PUMS)
- US Census Bureau's 2023 QuickFacts tool
- Invest.gov
- Geocorr from the Missouri Census Data Center
I will reduce each large dataset to focus only on questions related to green jobs and job quality. Please note that some datasets have already been pre-processed in Python with specific filters applied. We can find the original raw datasets in the data folder for reference.
## Analysis
I will look at each question one by one and clean the data as I go. Some datasets might need to be combined, so I will organize the data during the analysis before exploring the results.
### Load packages and libraries
```{r load-packages-libraries, echo = TRUE, message = FALSE, results = 'markup'}
#| label: load-packages-libraries
## For folder structure
library(here)
library(ezknitr)
## For data import/cleaning
library(tidyverse)
library(purrr)
library(rlang)
library(forcats)
library(readxl)
## For graphing
library(highcharter)
library(igraph)
library(RColorBrewer)
library(htmlwidgets)
library(gt)
# library(viridis)
```
### 1. Climate Resilience Funding for St. Paul
::: callout-note
## RQ 1: How much climate resilience funding has the City of Saint Paul received?
As of June 2024, **Minnesota** received a total of \$7,101,423,527 in funding for climate resilience, while **St. Paul** received \$446,286,762. Specifically, as of January 2024, St. Paul has secured \$433,028,012 from the Bipartisan Infrastructure Law (BIL) and \$13,258,750 from the Inflation Reduction Act (IRA) for **climate resilience efforts.**
St. Paul's funding makes up **6.28%** of Minnesota's total climate resilience funding. Nearly **95% of St. Paul's funding i**s allocated to **transportation** **projects**, with clean energy, buildings, and manufacturing receiving **less than 2% of the total**. It's like filling up a swimming pool with water but using only a small 8 oz glass for clean energy, buildings, and manufacturing.
As of January 2024, St. Paul received **\$8,337,843 from the BIL** and **\$200,000 from the IRA** specifically for investments in clean energy, buildings, and manufacturing.
:::
```{r}
# Import data
funding <- read_csv(here("processed_data", "FundingSummary.csv"))
saveRDS(funding, here("processed_data", "funding.rds"))
funding <- readRDS(here("processed_data", "funding.rds"))
```
```{r}
#| label: clean-convert-funding-data
### Convert the `Funding Amount` to numeric and handling commas in the values
funding <- funding %>%
mutate(`Funding Amount` = as.numeric(gsub(",", "", `Funding Amount`)))
```
#### Filter for MN State and City of St. Paul
First, I will filter the dataset by State: **Minnesota**, and then narrow it down further to focus on the **City of St. Paul** and the surrounding region. Please note that St. Paul is part of the **Minneapolis-St. Paul-Bloomington, MN-WI** region, so I'll ensure it's included within that larger metropolitan area.
```{r}
# Filter for Minnesota funding
minnesota_funding <- funding %>%
filter(State == "Minnesota")
saveRDS(minnesota_funding, here("processed_data", "minnesota_funding.rds"))
```
```{r}
# Further filter for St. Paul, considering variations in city names
st_paul_funding <- minnesota_funding %>%
filter(str_detect(City, regex("Saint Paul|St. Paul|South St. Paul|Minneapolis--St. Paul|Minneapolis-St. Paul", ignore_case = TRUE)))
saveRDS(st_paul_funding, here("processed_data", "st_paul_funding.rds"))
# glimpse(st_paul_funding)
```
#### Calculate funding for MN State and City of St. Paul
```{r}
# Set options to avoid scientific notation
options(scipen = 999)
# Load Minnesota and St. Paul data
minnesota_funding <- readRDS(here("processed_data", "minnesota_funding.rds"))
st_paul_funding <- readRDS(here("processed_data", "st_paul_funding.rds"))
# Calculate total funding for Minnesota
total_minnesota_funding <- minnesota_funding %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE))
cat("The total amount of funding Minnesota received for climate as of June 2024 is $",
format(total_minnesota_funding$total_funding, big.mark = ","), "\n")
# Calculate total funding for St. Paul
total_st_paul_funding <- st_paul_funding %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE))
cat("The total amount of funding St. Paul received for climate as of June 2024 is $",
format(total_st_paul_funding$total_funding, big.mark = ","), "\n")
# Calculate total funds by funding source for St. Paul
source_st_paul_funding <- st_paul_funding %>%
group_by(`Funding Source`) %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE))
# Calculate specific totals for BIL and IRA
bil_funding <- st_paul_funding %>%
filter(`Funding Source` == "BIL") %>%
summarise(total_bil = sum(`Funding Amount`, na.rm = TRUE))
ira_funding <- st_paul_funding %>%
filter(`Funding Source` == "IRA") %>%
summarise(total_ira = sum(`Funding Amount`, na.rm = TRUE))
# Print specific funding from BIL and IRA
cat("As of January 2024, St. Paul has been allocated $",
format(bil_funding$total_bil, big.mark = ",", scientific = FALSE),
" from the Bipartisan Infrastructure Law (BIL) and $",
format(ira_funding$total_ira, big.mark = ",", scientific = FALSE),
" from the Inflation Reduction Act (IRA).\n")
# Filter for the specific category 'Clean Energy, Buildings, and Manufacturing'
st_paul_clean_energy_funding <- st_paul_funding %>%
filter(Category == "Clean Energy, Buildings, and Manufacturing")
# Calculate total funds by funding source for the specific category
source_st_paul_clean_energy_funding <- st_paul_clean_energy_funding %>%
group_by(`Funding Source`) %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE))
# Calculate total funding across all sources for the specific category
total_st_paul_clean_energy_funding <- st_paul_clean_energy_funding %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE))
# Calculate specific totals for BIL and IRA in the specific category
bil_clean_energy_funding <- st_paul_clean_energy_funding %>%
filter(`Funding Source` == "BIL") %>%
summarise(total_bil = sum(`Funding Amount`, na.rm = TRUE))
ira_clean_energy_funding <- st_paul_clean_energy_funding %>%
filter(`Funding Source` == "IRA") %>%
summarise(total_ira = sum(`Funding Amount`, na.rm = TRUE))
# Print the total amount of funding for the specific category
cat("The total amount of funding St. Paul received for 'Clean Energy, Buildings, and Manufacturing' as of June 2024 is $",
format(total_st_paul_clean_energy_funding$total_funding, big.mark = ","), "\n")
# Print specific funding from BIL and IRA for the specific category
cat("As of January 2024, St. Paul has been allocated $",
format(bil_clean_energy_funding$total_bil, big.mark = ",", scientific = FALSE),
" from the Bipartisan Infrastructure Law (BIL) and $",
format(ira_clean_energy_funding$total_ira, big.mark = ",", scientific = FALSE),
" from the Inflation Reduction Act (IRA) to invest in 'Clean Energy, Buildings, and Manufacturing'.\n")
```
As of January 2024, St. Paul has been allocated \$ 433,028,012 million from the Bipartisan Infrastructure Law (BIL) and \$ 13,258,750 from the Inflation Reduction Act (IRA) to invest in climate resilience efforts in total.
As of January 2024, St. Paul has been allocated \$ 8,337,843 million from the Bipartisan Infrastructure Law (BIL) and \$ 200,000 from the Inflation Reduction Act (IRA) to invest in 'Clean Energy, Buildings, and Manufacturing'.
#### Calculate fraction of St. Paul's funding from MN's
```{r}
minnesota_funding <- readRDS(here("processed_data", "minnesota_funding.rds"))
st_paul_funding <- readRDS(here("processed_data", "st_paul_funding.rds"))
# Calculate total funding for Minnesota
total_minnesota_funding <- minnesota_funding %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE)) %>%
pull(total_funding)
# Calculate total funding for St. Paul
total_st_paul_funding <- st_paul_funding %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE)) %>%
pull(total_funding)
# Calculate the fraction of St. Paul's funding from Minnesota's total funding
fraction_st_paul <- total_st_paul_funding / total_minnesota_funding
# Output the results
cat("The fraction of St. Paul's funding from Minnesota's total funding is: ",
round(fraction_st_paul, 4), "\n")
cat("This means St. Paul's funding is", round(fraction_st_paul * 100, 2), "% of Minnesota's total funding.\n")
```
#### Visualize categories of funding for St. Paul
```{r}
# Group the St. Paul data by Category and calculate the total funding for each category
st_paul_category_funding <- st_paul_funding %>%
group_by(Category) %>%
summarise(total_funding = sum(`Funding Amount`, na.rm = TRUE)) %>%
arrange(desc(total_funding))
colors <- brewer.pal(n = length(unique(st_paul_category_funding$Category)), "Set3")
# Create an interactive bar chart using highcharter
hchart_bar <- highchart() %>%
hc_chart(type = "bar") %>%
hc_xAxis(categories = st_paul_category_funding$Category, title = list(text = "Category")) %>%
hc_yAxis(title = list(text = "Total Funding ($)"), labels = list(format = "{value:,.0f}")) %>%
hc_add_series(name = "Total Funding",
data = st_paul_category_funding$total_funding,
colorByPoint = TRUE,
colors = colors) %>%
hc_title(text = "Total Funding by Category in St. Paul") %>%
hc_tooltip(pointFormat = "Total Funding: ${point.y:,.0f}") %>%
hc_exporting(
enabled = TRUE,
buttons = list(contextButton = list(menuItems = c("downloadPNG", "downloadJPEG", "downloadSVG", "downloadPDF")))
)
# Saving the chart as an HTML file
saveWidget(hchart_bar, file = here("graphs", "st_paul_funding_bar.html"))
```
A quick glance tells us that almost **95%** of St. Paul's funding goes to transportation efforts. Clean energy, buildings and manufacturing received less than **2%** of funding.
```{r}
# Create an interactive pie chart using highcharter
hchart_pie <- highchart() %>%
hc_chart(type = "pie") %>%
hc_add_series(name = "Total Funding",
data = list_parse2(st_paul_category_funding %>%
mutate(name = Category, y = total_funding)),
colors = colors) %>%
hc_title(text = "Total Funding by Category in St. Paul") %>%
hc_tooltip(pointFormat = "Total Funding: ${point.y:,.0f}") %>%
hc_plotOptions(pie = list(innerSize = '50%', dataLabels = list(enabled = TRUE))) %>%
hc_exporting(
enabled = TRUE,
buttons = list(contextButton = list(menuItems = c("downloadPNG", "downloadJPEG", "downloadSVG", "downloadPDF")))
)
saveWidget(hchart_pie, file = here("graphs", "st_paul_funding_pie.html"))
```
```{r}
## Export the funding data to CSV for graphing
write.csv(minnesota_funding, here("processed_data", "minnesota_funding.csv"), row.names = FALSE)
write.csv(st_paul_funding, here("processed_data", "st_paul_funding.csv"), row.names = FALSE)
```
### 2. Types of Green Jobs in St. Paul
::: callout-note
## RQ 2: What specific green jobs are being created in the Minneapolis-Saint Paul metropolitan area and nationally (e.g., energy efficiency, renewable energy, green construction)?
[Nationally]{.underline}
There's a total of **17,119,730 employed people** in green jobs nationally. Specifically, in **Energy Efficiency**, there are 4,928,520 (28.79 %), in **Green Construction** there are 10,624,140 (62.06 %), and in **Renewable Energy Generation** there are 1,567,070 (9.15 %).
The **mean annual wage** for the occupation in U.S. dollars for green jobs is \$78,363.4, and for non-green jobs is \$73,763.67. That means green jobs pay **\$4,599.73 more** than non-green jobs **nationally**.
The **mean hourly wage** for the occupation in U.S. dollars for green jobs is \$37.67547, and for non-green jobs is \$34.80. That means green jobs pay **\$2.88 more** than non-green jobs **nationally**.
[Minneapolis-Saint Paul Metropolitan Area]{.underline}
There's a total of **214,340 employed people** in green jobs in the Minneapolis-Saint Paul metropolitan area. Specifically, in **Energy Efficiency**, there are 66,410 ( 30.98 %), in **Green Construction** there are 124,680 ( 58.17 %), and in **Renewable Energy Generation** there are 23,250 ( 10.85 %).
The **mean annual wage** for the occupation in U.S. dollars for green jobs **in this area** is \$84,561.7, and for non-green jobs is \$77,192.53. That means green jobs in Saint Paul pay \$7,369.169 more than non-green jobs in this area.
The **mean hourly wage** for the occupation in U.S. dollars for green jobs **in this area** is \$40.65, and for non-green jobs is \$36.31. That means green jobs in Saint Paul pay **\$4.35 more** than non-green jobs in this area.
:::
#### Green jobs nationally
```{r}
# Import national jobs data
national_jobs <- read_csv(here("processed_data", "OWES_and_ONET-National.csv"))
saveRDS(national_jobs, here("processed_data", "national_jobs.rds"))
national_jobs <- readRDS(here("processed_data", "national_jobs.rds"))
```
Here, we'd want to filter to only green jobs
```{r}
# Convert necessary columns to numeric where needed
national_jobs <- national_jobs %>%
mutate(
TOT_EMP = as.numeric(TOT_EMP),
# JOBS_1000 = as.numeric(JOBS_1000),
# PCT_TOTAL = as.numeric(PCT_TOTAL),
H_MEAN = as.numeric(H_MEAN),
A_MEAN = as.numeric(A_MEAN),
A_MEDIAN = as.numeric(A_MEDIAN),
H_MEDIAN = as.numeric(H_MEDIAN)
)
# Filter the dataset to include only relevant sectors
filtered_jobs <- national_jobs %>%
filter(`O*NET-SOC Sector` %in% c("Energy Efficiency", "Renewable Energy Generation", "Green Construction"))
# Function to summarize data for each sector
summarize_by_sector <- function(df) {
df %>%
summarize(
TOT_EMP = sum(TOT_EMP, na.rm = TRUE),
# JOBS_1000 = sum(JOBS_1000 * TOT_EMP, na.rm = TRUE) / sum(TOT_EMP, na.rm = TRUE),
# PCT_TOTAL = sum(PCT_TOTAL * TOT_EMP, na.rm = TRUE) / sum(TOT_EMP, na.rm = TRUE),
H_MEAN = mean(H_MEAN, na.rm = TRUE),
A_MEAN = mean(A_MEAN, na.rm = TRUE),
A_MEDIAN = median(A_MEDIAN, na.rm = TRUE),
H_MEDIAN = median(H_MEDIAN, na.rm = TRUE)
)
}
# Summarize the data for each sector and overall
sector_summary <- filtered_jobs %>%
group_by(`O*NET-SOC Sector`) %>%
summarize_by_sector()
# Calculate the summary for all sectors combined
overall_summary <- filtered_jobs %>%
summarize_by_sector()
# Combine the results: sector-wise and overall
final_summary <- bind_rows(sector_summary, tibble(`O*NET-SOC Sector` = "All", overall_summary))
# Save the final summary as an RDS file and CSV for future reference
saveRDS(final_summary, here("processed_data", "sector_summary.rds"))
write_csv(final_summary, here("processed_data", "sector_summary.csv"))
# Output the final summary to the user
print(final_summary)
```
```{r}
# Calculate total employment and sector percentages
total_green_jobs <- final_summary %>% filter(`O*NET-SOC Sector` == "All") %>% pull(TOT_EMP)
energy_efficiency_jobs <- final_summary %>% filter(`O*NET-SOC Sector` == "Energy Efficiency") %>% pull(TOT_EMP)
green_construction_jobs <- final_summary %>% filter(`O*NET-SOC Sector` == "Green Construction") %>% pull(TOT_EMP)
renewable_energy_jobs <- final_summary %>% filter(`O*NET-SOC Sector` == "Renewable Energy Generation") %>% pull(TOT_EMP)
# Calculate the percentages
energy_efficiency_pct <- round((energy_efficiency_jobs / total_green_jobs) * 100, 2)
green_construction_pct <- round((green_construction_jobs / total_green_jobs) * 100, 2)
renewable_energy_pct <- round((renewable_energy_jobs / total_green_jobs) * 100, 2)
# Create the concatenated sentence
cat("There's a total of", format(total_green_jobs, big.mark = ",", scientific = FALSE),
"employed people in green jobs nationally. Specifically, in Energy Efficiency, there are",
format(energy_efficiency_jobs, big.mark = ",", scientific = FALSE),
"(", energy_efficiency_pct, "%), in Green Construction there are",
format(green_construction_jobs, big.mark = ",", scientific = FALSE),
"(", green_construction_pct, "%), and in Renewable Energy Generation there are",
format(renewable_energy_jobs, big.mark = ",", scientific = FALSE),
"(", renewable_energy_pct, "%).\n")
```
Let's visualize this so it's easier to compare across all green sectors
```{r}
# Convert the O*NET-SOC Sector to a factor for ordering in the chart
final_summary <- final_summary %>%
mutate(`O*NET-SOC Sector` = factor(`O*NET-SOC Sector`, levels = c("Energy Efficiency", "Green Construction", "Renewable Energy Generation", "All")))
# Visualizing TOT_EMP across the sectors
hchart(final_summary, "column", hcaes(x = `O*NET-SOC Sector`, y = TOT_EMP)) %>%
hc_title(text = "Total Employment by Sector") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Total Employment"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f}</b>')
# Visualizing H_MEAN (Mean Hourly Wage) across the sectors
hchart(final_summary, "column", hcaes(x = `O*NET-SOC Sector`, y = H_MEAN)) %>%
hc_title(text = "Mean Hourly Wage by Sector") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Mean Hourly Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:.2f} USD</b>')
# Visualizing A_MEAN (Mean Annual Wage) across the sectors
hchart(final_summary, "column", hcaes(x = `O*NET-SOC Sector`, y = A_MEAN)) %>%
hc_title(text = "Mean Annual Wage by Sector") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Mean Annual Wage (USD)"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f} USD</b>')
# Visualizing A_MEDIAN (Median Annual Wage) across the sectors
hchart(final_summary, "column", hcaes(x = `O*NET-SOC Sector`, y = A_MEDIAN)) %>%
hc_title(text = "Median Annual Wage by Sector") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Median Annual Wage (USD)"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f} USD</b>')
# Visualizing H_MEDIAN (Median Hourly Wage) across the sectors
hchart(final_summary, "column", hcaes(x = `O*NET-SOC Sector`, y = H_MEDIAN)) %>%
hc_title(text = "Median Hourly Wage by Sector") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Median Hourly Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:.2f} USD</b>')
```
I'm also curious about the differences between green jobs and non-green jobs for mean hourly wage and mean annual wage.
```{r}
# Define green jobs as sectors related to energy and construction
green_jobs_sectors <- c("Energy Efficiency", "Renewable Energy Generation", "Green Construction")
# Add a new column to identify green and non-green jobs
national_jobs <- national_jobs %>%
mutate(
Job_Type = ifelse(`O*NET-SOC Sector` %in% green_jobs_sectors, "Green Jobs", "Non-Green Jobs")
)
# Group by job type (Green vs Non-Green) and calculate mean wages
job_type_summary <- national_jobs %>%
group_by(Job_Type) %>%
summarize(
H_MEAN = mean(H_MEAN, na.rm = TRUE),
A_MEAN = mean(A_MEAN, na.rm = TRUE)
)
# Visualizing Mean Hourly Wage (H_MEAN) for Green vs Non-Green Jobs
hchart(job_type_summary, "column", hcaes(x = Job_Type, y = H_MEAN)) %>%
hc_title(text = "Mean Hourly Wage: Green Jobs vs Non-Green Jobs") %>%
hc_xAxis(title = list(text = "Job Type")) %>%
hc_yAxis(title = list(text = "Mean Hourly Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:.2f} USD</b>')
# Visualizing Mean Annual Wage (A_MEAN) for Green vs Non-Green Jobs
hchart(job_type_summary, "column", hcaes(x = Job_Type, y = A_MEAN)) %>%
hc_title(text = "Mean Annual Wage: Green Jobs vs Non-Green Jobs") %>%
hc_xAxis(title = list(text = "Job Type")) %>%
hc_yAxis(title = list(text = "Mean Annual Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f} USD</b>')
```
```{r}
# Summarizing core findings nationally
# Extract green and non-green job wage data
green_wages <- job_type_summary %>% filter(Job_Type == "Green Jobs")
non_green_wages <- job_type_summary %>% filter(Job_Type == "Non-Green Jobs")
# Calculate the difference between green and non-green jobs
difference_annual <- green_wages$A_MEAN - non_green_wages$A_MEAN
difference_hourly <- green_wages$H_MEAN - non_green_wages$H_MEAN
# Format and print the sentences
cat("The mean annual wage for the occupation in U.S. dollars for green jobs is $",
format(green_wages$A_MEAN, big.mark = ",", scientific = FALSE),
", and for non-green jobs is $",
format(non_green_wages$A_MEAN, big.mark = ",", scientific = FALSE),
". That means green jobs pay $",
format(abs(difference_annual), big.mark = ",", scientific = FALSE),
ifelse(difference_annual > 0, " more", " less"),
" than non-green jobs nationally.\n", sep = "")
cat("The mean hourly wage for the occupation in U.S. dollars for green jobs is $",
format(green_wages$H_MEAN, big.mark = ",", scientific = FALSE),
", and for non-green jobs is $",
format(non_green_wages$H_MEAN, big.mark = ",", scientific = FALSE),
". That means green jobs pay $",
format(abs(difference_hourly), big.mark = ",", scientific = FALSE),
ifelse(difference_hourly > 0, " more", " less"),
" than non-green jobs nationally.\n", sep = "")
```
I'd like to see a word cloud of different job titles for each sector
```{r}
# Filter the dataset for green jobs only
green_jobs <- national_jobs %>%
filter(`O*NET-SOC Sector` %in% c("Energy Efficiency", "Renewable Energy Generation", "Green Construction"))
# Extract job titles and count their occurrences
job_titles <- green_jobs %>%
count(OCC_TITLE, sort = TRUE)
# Create a word cloud using highcharter
hchart(
job_titles,
"wordcloud",
hcaes(name = OCC_TITLE, weight = n)
) %>%
hc_title(text = "Word Cloud of Green Job Titles")
```
Now let's create separate word clouds for each of the green sectors ("Energy Efficiency", "Renewable Energy Generation", and "Green Construction").
```{r}
# Filter the dataset for each sector
energy_efficiency_jobs <- national_jobs %>%
filter(`O*NET-SOC Sector` == "Energy Efficiency")
renewable_energy_jobs <- national_jobs %>%
filter(`O*NET-SOC Sector` == "Renewable Energy Generation")
green_construction_jobs <- national_jobs %>%
filter(`O*NET-SOC Sector` == "Green Construction")
# Create a function to generate word clouds
generate_wordcloud <- function(data, sector_name) {
job_titles <- data %>%
count(OCC_TITLE, sort = TRUE)
hchart(
job_titles,
"wordcloud",
hcaes(name = OCC_TITLE, weight = n)
) %>%
hc_title(text = paste("Word Cloud of", sector_name, "Job Titles"))
}
# Generate word cloud for Energy Efficiency
energy_efficiency_wordcloud <- generate_wordcloud(energy_efficiency_jobs, "Energy Efficiency")
# Generate word cloud for Renewable Energy Generation
renewable_energy_wordcloud <- generate_wordcloud(renewable_energy_jobs, "Renewable Energy Generation")
# Generate word cloud for Green Construction
green_construction_wordcloud <- generate_wordcloud(green_construction_jobs, "Green Construction")
# Display the word clouds
energy_efficiency_wordcloud
renewable_energy_wordcloud
green_construction_wordcloud
```
Let's export for graphing
```{r}
## Export the national jobs data to CSV for graphing
write.csv(national_jobs, here("processed_data", "national_jobs.csv"), row.names = FALSE)
# Export the job_type_summary dataset to CSV for graphing
write.csv(job_type_summary, here("processed_data", "national_job_type_summary.csv"), row.names = FALSE)
```
#### Green jobs in St. Paul
```{r}
# Import St. Paul jobs data
st_paul_jobs <- read_csv(here("processed_data", "OWES_and_ONET-St_Paul.csv"))
saveRDS(st_paul_jobs, here("processed_data", "st_paul_jobs.rds"))
st_paul_jobs <- readRDS(here("processed_data", "st_paul_jobs.rds"))
```
```{r}
# Convert necessary columns to numeric where needed
st_paul_jobs <- st_paul_jobs %>%
mutate(
TOT_EMP = as.numeric(TOT_EMP),
H_MEAN = as.numeric(H_MEAN),
A_MEAN = as.numeric(A_MEAN),
A_MEDIAN = as.numeric(A_MEDIAN),
H_MEDIAN = as.numeric(H_MEDIAN)
)
# Filter the dataset to include only relevant green sectors
filtered_st_paul_jobs <- st_paul_jobs %>%
filter(`O*NET-SOC Sector` %in% c("Energy Efficiency", "Renewable Energy Generation", "Green Construction"))
# Function to summarize data for each sector
summarize_by_sector <- function(df) {
df %>%
summarize(
TOT_EMP = sum(TOT_EMP, na.rm = TRUE),
H_MEAN = mean(H_MEAN, na.rm = TRUE),
A_MEAN = mean(A_MEAN, na.rm = TRUE),
A_MEDIAN = median(A_MEDIAN, na.rm = TRUE),
H_MEDIAN = median(H_MEDIAN, na.rm = TRUE)
)
}
# Summarize the data for each sector and overall
sector_summary_st_paul <- filtered_st_paul_jobs %>%
group_by(`O*NET-SOC Sector`) %>%
summarize_by_sector()
# Calculate the summary for all sectors combined
overall_summary_st_paul <- filtered_st_paul_jobs %>%
summarize_by_sector()
# Combine the results: sector-wise and overall
final_summary_st_paul <- bind_rows(sector_summary_st_paul, tibble(`O*NET-SOC Sector` = "All", overall_summary_st_paul))
# Save the final summary as an RDS file and CSV for future reference
saveRDS(final_summary_st_paul, here("processed_data", "sector_summary_st_paul.rds"))
write_csv(final_summary_st_paul, here("processed_data", "sector_summary_st_paul.csv"))
# Output the final summary to the user
print(final_summary_st_paul)
# Calculate total employment and sector percentages for St. Paul
total_green_jobs_st_paul <- final_summary_st_paul %>% filter(`O*NET-SOC Sector` == "All") %>% pull(TOT_EMP)
energy_efficiency_jobs_st_paul <- final_summary_st_paul %>% filter(`O*NET-SOC Sector` == "Energy Efficiency") %>% pull(TOT_EMP)
green_construction_jobs_st_paul <- final_summary_st_paul %>% filter(`O*NET-SOC Sector` == "Green Construction") %>% pull(TOT_EMP)
renewable_energy_jobs_st_paul <- final_summary_st_paul %>% filter(`O*NET-SOC Sector` == "Renewable Energy Generation") %>% pull(TOT_EMP)
# Calculate the percentages
energy_efficiency_pct_st_paul <- round((energy_efficiency_jobs_st_paul / total_green_jobs_st_paul) * 100, 2)
green_construction_pct_st_paul <- round((green_construction_jobs_st_paul / total_green_jobs_st_paul) * 100, 2)
renewable_energy_pct_st_paul <- round((renewable_energy_jobs_st_paul / total_green_jobs_st_paul) * 100, 2)
# Create the concatenated sentence for St. Paul
cat("There's a total of", format(total_green_jobs_st_paul, big.mark = ",", scientific = FALSE),
"employed people in green jobs in Saint Paul. Specifically, in Energy Efficiency, there are",
format(energy_efficiency_jobs_st_paul, big.mark = ",", scientific = FALSE),
"(", energy_efficiency_pct_st_paul, "%), in Green Construction there are",
format(green_construction_jobs_st_paul, big.mark = ",", scientific = FALSE),
"(", green_construction_pct_st_paul, "%), and in Renewable Energy Generation there are",
format(renewable_energy_jobs_st_paul, big.mark = ",", scientific = FALSE),
"(", renewable_energy_pct_st_paul, "%).\n")
# Visualizing TOT_EMP across the green sectors for St. Paul
final_summary_st_paul <- final_summary_st_paul %>%
mutate(`O*NET-SOC Sector` = factor(`O*NET-SOC Sector`, levels = c("Energy Efficiency", "Green Construction", "Renewable Energy Generation", "All")))
hchart(final_summary_st_paul, "column", hcaes(x = `O*NET-SOC Sector`, y = TOT_EMP)) %>%
hc_title(text = "Total Employment by Sector in Saint Paul") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Total Employment"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f}</b>')
```
```{r}
# Convert the O*NET-SOC Sector to a factor for ordering in the chart for St. Paul
final_summary_st_paul <- final_summary_st_paul %>%
mutate(`O*NET-SOC Sector` = factor(`O*NET-SOC Sector`, levels = c("Energy Efficiency", "Green Construction", "Renewable Energy Generation", "All")))
# Visualizing TOT_EMP across the sectors for St. Paul
hchart(final_summary_st_paul, "column", hcaes(x = `O*NET-SOC Sector`, y = TOT_EMP)) %>%
hc_title(text = "Total Employment by Sector in Saint Paul") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Total Employment"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f}</b>')
# Visualizing H_MEAN (Mean Hourly Wage) across the sectors for St. Paul
hchart(final_summary_st_paul, "column", hcaes(x = `O*NET-SOC Sector`, y = H_MEAN)) %>%
hc_title(text = "Mean Hourly Wage by Sector in Saint Paul") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Mean Hourly Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:.2f} USD</b>')
# Visualizing A_MEAN (Mean Annual Wage) across the sectors for St. Paul
hchart(final_summary_st_paul, "column", hcaes(x = `O*NET-SOC Sector`, y = A_MEAN)) %>%
hc_title(text = "Mean Annual Wage by Sector in Saint Paul") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Mean Annual Wage (USD)"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f} USD</b>')
# Visualizing A_MEDIAN (Median Annual Wage) across the sectors for St. Paul
hchart(final_summary_st_paul, "column", hcaes(x = `O*NET-SOC Sector`, y = A_MEDIAN)) %>%
hc_title(text = "Median Annual Wage by Sector in Saint Paul") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Median Annual Wage (USD)"), labels = list(format = "{value:,0f}")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f} USD</b>')
# Visualizing H_MEDIAN (Median Hourly Wage) across the sectors for St. Paul
hchart(final_summary_st_paul, "column", hcaes(x = `O*NET-SOC Sector`, y = H_MEDIAN)) %>%
hc_title(text = "Median Hourly Wage by Sector in Saint Paul") %>%
hc_xAxis(title = list(text = "Sector")) %>%
hc_yAxis(title = list(text = "Median Hourly Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:.2f} USD</b>')
# Define green jobs as sectors related to energy and construction for St. Paul
green_jobs_sectors_st_paul <- c("Energy Efficiency", "Renewable Energy Generation", "Green Construction")
# Add a new column to identify green and non-green jobs for St. Paul
st_paul_jobs <- st_paul_jobs %>%
mutate(
Job_Type = ifelse(`O*NET-SOC Sector` %in% green_jobs_sectors_st_paul, "Green Jobs", "Non-Green Jobs")
)
# Group by job type (Green vs Non-Green) and calculate mean wages for St. Paul
job_type_summary_st_paul <- st_paul_jobs %>%
group_by(Job_Type) %>%
summarize(
H_MEAN = mean(H_MEAN, na.rm = TRUE),
A_MEAN = mean(A_MEAN, na.rm = TRUE)
)
# Visualizing Mean Hourly Wage (H_MEAN) for Green vs Non-Green Jobs in St. Paul
hchart(job_type_summary_st_paul, "column", hcaes(x = Job_Type, y = H_MEAN)) %>%
hc_title(text = "Mean Hourly Wage: Green Jobs vs Non-Green Jobs in Saint Paul") %>%
hc_xAxis(title = list(text = "Job Type")) %>%
hc_yAxis(title = list(text = "Mean Hourly Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:.2f} USD</b>')
# Visualizing Mean Annual Wage (A_MEAN) for Green vs Non-Green Jobs in St. Paul
hchart(job_type_summary_st_paul, "column", hcaes(x = Job_Type, y = A_MEAN)) %>%
hc_title(text = "Mean Annual Wage: Green Jobs vs Non-Green Jobs in Saint Paul") %>%
hc_xAxis(title = list(text = "Job Type")) %>%
hc_yAxis(title = list(text = "Mean Annual Wage (USD)")) %>%
hc_tooltip(pointFormat = '<b>{point.y:,0f} USD</b>')
# Summarizing core findings for Saint Paul
# Extract green and non-green job wage data for St. Paul
green_wages_st_paul <- job_type_summary_st_paul %>% filter(Job_Type == "Green Jobs")
non_green_wages_st_paul <- job_type_summary_st_paul %>% filter(Job_Type == "Non-Green Jobs")
# Calculate the difference between green and non-green jobs for St. Paul
difference_annual_st_paul <- green_wages_st_paul$A_MEAN - non_green_wages_st_paul$A_MEAN
difference_hourly_st_paul <- green_wages_st_paul$H_MEAN - non_green_wages_st_paul$H_MEAN
# Format and print the sentences for Saint Paul
cat("The mean annual wage for the occupation in U.S. dollars for green jobs in Saint Paul is $",
format(green_wages_st_paul$A_MEAN, big.mark = ",", scientific = FALSE),
", and for non-green jobs is $",
format(non_green_wages_st_paul$A_MEAN, big.mark = ",", scientific = FALSE),
". That means green jobs in Saint Paul pay $",
format(abs(difference_annual_st_paul), big.mark = ",", scientific = FALSE),
ifelse(difference_annual_st_paul > 0, " more", " less"),
" than non-green jobs in Saint Paul.\n", sep = "")
cat("The mean hourly wage for the occupation in U.S. dollars for green jobs in Saint Paul is $",
format(green_wages_st_paul$H_MEAN, big.mark = ",", scientific = FALSE),
", and for non-green jobs is $",
format(non_green_wages_st_paul$H_MEAN, big.mark = ",", scientific = FALSE),
". That means green jobs in Saint Paul pay $",
format(abs(difference_hourly_st_paul), big.mark = ",", scientific = FALSE),
ifelse(difference_hourly_st_paul > 0, " more", " less"),
" than non-green jobs in Saint Paul.\n", sep = "")
```
I'd like to see a word cloud of different job titles for each sector in St. Paul
```{r}
# Filter the dataset for green jobs only in St. Paul
green_jobs_st_paul <- st_paul_jobs %>%
filter(`O*NET-SOC Sector` %in% c("Energy Efficiency", "Renewable Energy Generation", "Green Construction"))
# Extract job titles and count their occurrences in St. Paul
job_titles_st_paul <- green_jobs_st_paul %>%
count(OCC_TITLE, sort = TRUE)
# Create a word cloud for green jobs in St. Paul using highcharter
hchart(
job_titles_st_paul,
"wordcloud",
hcaes(name = OCC_TITLE, weight = n)
) %>%
hc_title(text = "Word Cloud of Green Job Titles in Saint Paul")
```
Now let's create separate word clouds for each of the green sectors ("Energy Efficiency", "Renewable Energy Generation", and "Green Construction") for St. Paul
```{r}
# Filter the dataset for each sector in St. Paul
energy_efficiency_jobs_st_paul <- st_paul_jobs %>%
filter(`O*NET-SOC Sector` == "Energy Efficiency")
renewable_energy_jobs_st_paul <- st_paul_jobs %>%
filter(`O*NET-SOC Sector` == "Renewable Energy Generation")
green_construction_jobs_st_paul <- st_paul_jobs %>%
filter(`O*NET-SOC Sector` == "Green Construction")
# Create a function to generate word clouds for St. Paul sectors
generate_wordcloud_st_paul <- function(data, sector_name) {
job_titles <- data %>%
count(OCC_TITLE, sort = TRUE)
hchart(
job_titles,
"wordcloud",
hcaes(name = OCC_TITLE, weight = n)
) %>%
hc_title(text = paste("Word Cloud of", sector_name, "Job Titles in Saint Paul"))
}
# Generate word cloud for Energy Efficiency in St. Paul
energy_efficiency_wordcloud_st_paul <- generate_wordcloud_st_paul(energy_efficiency_jobs_st_paul, "Energy Efficiency")
# Generate word cloud for Renewable Energy Generation in St. Paul
renewable_energy_wordcloud_st_paul <- generate_wordcloud_st_paul(renewable_energy_jobs_st_paul, "Renewable Energy Generation")
# Generate word cloud for Green Construction in St. Paul
green_construction_wordcloud_st_paul <- generate_wordcloud_st_paul(green_construction_jobs_st_paul, "Green Construction")
# Display the word clouds for St. Paul
energy_efficiency_wordcloud_st_paul
renewable_energy_wordcloud_st_paul
green_construction_wordcloud_st_paul
```
Let's export for graphing
```{r}
# Export the St. Paul jobs data to CSV for graphing
write.csv(st_paul_jobs, here("processed_data", "st_paul_jobs.csv"), row.names = FALSE)
# Export the job_type_summary dataset for St. Paul to CSV for graphing
write.csv(job_type_summary_st_paul, here("processed_data", "st_paul_job_type_summary.csv"), row.names = FALSE)
```
### 3. Quality, Pay, and Qualifications of Green Jobs
::: callout-note
## RQ 3: What is the quality of these green jobs? How much do they pay? What qualifications are needed (education and experience) nationally?
**Higher education** is associated with better-quality green jobs, particularly in the energy efficiency sector. Most high- and medium-quality jobs in energy efficiency require at least a Bachelor's Degree.
**Individuals with lower education levels** are more likely to end up in green construction, especially in lower-quality jobs. Energy efficiency tends to offer a better quality of jobs across all education levels, with strong representation in both high and medium-quality segments.
**Union membership** is **associated** with **higher-quality jobs** in all three sectors, particularly in energy efficiency and renewable energy generation, where a majority of high-quality jobs are unionized.
:::
```{r}
# Import green job quality data
quality_green_jobs <- read_csv(here("processed_data", "Job_Info_Merged_All_Green.csv"))
saveRDS(quality_green_jobs, here("processed_data", "quality_green_jobs.rds"))
quality_green_jobs <- readRDS(here("processed_data", "quality_green_jobs.rds"))
```
Now, let's transform this dataframe so it's visualization-ready.
```{r}
# Rename columns to snake_case format
quality_green_jobs <- quality_green_jobs %>%
rename(
report_occupation = `Reported Occupation`,
onet_soc_code = `O*NET-SOC Code`,
onet_soc_title = `O*NET-SOC Title`,
onet_soc_category = `O*NET-SOC Category`,
onet_soc_sector = `O*NET-SOC Sector`,
renewable_energy_generation = `Renewable Energy Generation`,
energy_efficiency = `Energy Efficiency`,
green_construction = `Green Construction`,
benchmark_total = `Benchmark Total`,
wage = Wage,
forty_hours = `40 hours`,
schedule = Schedule,
health_ins = `Health Ins`,
retirement = Retirement,
growth = Growth,
unemployment = Unemployment,
illness_injury = `Illness/injury`,
ojt = OJT,
union = Union,
autonomy_benchmark = autonomy_benchmark,
quality = quality,
education = education,
matrix_title = `2022 National Employment Matrix title`,
matrix_code = `2022 National Employment Matrix code`,
typical_education_needed = `Typical education needed for entry`,
work_experience_related = `Work experience in a related occupation`,
on_the_job_training = `Typical on-the-job training needed to attain competency in the occupation`
)
```
```{r}
# Convert the variables to the correct types
quality_green_jobs <- quality_green_jobs %>%
mutate(
# Factors
onet_soc_category = factor(onet_soc_category),
onet_soc_sector = factor(onet_soc_sector),
quality = factor(quality, levels = c("Low Quality", "Medium Quality", "High Quality")),
education = factor(education),
typical_education_needed = factor(typical_education_needed),
work_experience_related = factor(work_experience_related),
on_the_job_training = factor(on_the_job_training),
# Yes/No columns as numeric (1 for Yes, 0 for No)
renewable_energy_generation = as.numeric(renewable_energy_generation),
energy_efficiency = as.numeric(energy_efficiency),
green_construction = as.numeric(green_construction),
wage = as.numeric(wage),
forty_hours = as.numeric(forty_hours),
schedule = as.numeric(schedule),
health_ins = as.numeric(health_ins),
retirement = as.numeric(retirement),
growth = as.numeric(growth),
unemployment = as.numeric(unemployment),
illness_injury = as.numeric(illness_injury),
ojt = as.numeric(ojt),
union = as.numeric(union),
autonomy_benchmark = as.numeric(autonomy_benchmark)
)
```
```{r}
# Visualize quality jobs compared across sectors
quality_summary <- quality_green_jobs %>%
gather(key = "sector", value = "is_green_job", renewable_energy_generation, energy_efficiency, green_construction) %>%
filter(is_green_job == 1) %>%
group_by(sector, quality) %>%
summarise(count = n()) %>%