-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnalysisNCES.qmd
More file actions
82 lines (59 loc) · 1.89 KB
/
Copy pathAnalysisNCES.qmd
File metadata and controls
82 lines (59 loc) · 1.89 KB
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
---
title: "AnalysisNCES"
format: html
---
## Setup
```{r}
#| label: setup
#| message: false
#| warning: false
library(tidyverse)
library(janitor)
library(scales)
library(sf)
library(mapview)
library(RColorBrewer)
```
```{r}
teaching_staff_totals <- read_rds("data-processed/teaching_staff_totals.rds")
salary_col_comparison <- read_rds("data-processed/salary_col_comparison.rds")
```
## NCES District Types
We decided not to use this so I moved the analysis I already did with NCES district types down here and didn't continue to use it.
### Count and Average Pay for NCES
```{r}
teaching_staff_totals |> group_by(nces_description) |> count()
```
Finding average pay per school year for each NCES district type.
```{r}
district_types_nces_chart <- teaching_staff_totals |> group_by(nces_description, school_year) |>
summarize(avg_pay = mean(average_base_pay))
district_types_nces_chart
```
Graphing it.
```{r}
ggplot(district_types_nces_chart, aes(x = school_year, y = avg_pay, color = nces_description, group = nces_description)) +
geom_point() +
geom_line() +
theme(legend.position = "bottom") +
guides(color = guide_legend(nrow = 4, byrow = TRUE))
```
### Average and Median of difference between salary and ALICE for each NCES district type
```{r}
salary_col_comparison |> group_by(nces_description) |>
summarize(avg_difference = mean(difference),
median_difference = median(difference),
number_of_districts = n()) |>
arrange(avg_difference)
```
```{r}
avg_difference_over_time_nces <- salary_col_comparison |> group_by(nces_description, end_year) |>
summarize(avg_difference = mean(difference))
avg_difference_over_time_nces
```
```{r}
ggplot(avg_difference_over_time_nces,
aes(x = end_year, y = avg_difference, color = nces_description, group = nces_description)) +
geom_line() +
scale_y_continuous(limits = c(-10000,5000), n.breaks = 10)
```