-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCB_pov_edu_level.rmd
38 lines (31 loc) · 1.55 KB
/
CB_pov_edu_level.rmd
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
---
title: ''
author: "laetitia"
date: "11/19/2024"
output: html_document
---
*libraries needed
```{r}
library(readxl)
library(ggplot2)
library(lubridate)
```
*imported table for education vs poverty from excel
*cut out headers and footers and limited data to only "age 25 and over" values by setting reading frame from B14:P14
```{r}
library(readxl)
CB_pov_edu2 <- read_excel("CB_pov_edu2.xlsx", range = "B13:P14")
```
*renamed columns for convenience and overview
```{r}
colnames(CB_pov_edu2) <- c("1","2", "Percent_People_Below_Pov_Threshold_All_Edu_Levels", "4", "5", "Percent_People_Below_Pov_Threshold_No_HS", "7","8","Percent_People_Below_Pov_Threshold_Some_College_No_4Y", "10","11","Percent_People_Below_Pov_Threshold_4Y_Or_Higher")
```
*make bar graph for all education levels for people aged 25 and over in 2023, percentage of people below poverty threshold vs degree (color the degree), manually entered percentages
```{r}
Edu_Levels <- c("All Education Levels", "No High School Degree","Some College","University (4 Years) Or Higher")
Percent_Below_Poverty1 <- c(9.5, 25.1,13.1,8.5)
Graph_Edu <- data.frame(Edu_Levels, Percent_Below_Poverty1)
ggplot(data=Graph_Edu,aes (x = Edu_Levels, y = Percent_Below_Poverty1, fill=Edu_Levels)) + geom_bar(stat="identity") + theme_classic() + theme(axis.text.x = element_text(angle=50, hjust =1)) + labs(title="Percentage of Population (25+) Below Poverty Threshold by Education Level",
x ="Education Level", y = "Percent Below Poverty (%)") + labs (fill= "Education Levels")
```
```