library(readxl)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.6
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.1     ✔ tibble    3.3.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.2
## ✔ purrr     1.2.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
district<-read_excel("district.xls")
districtsped<-district %>% select(DISTNAME, DPETSPEP, DPFPASPEP)
#3a)Summary of percent SPED
summary(districtsped$DPETSPEP)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    9.90   12.10   12.27   14.20   51.70
#3b) Summary of Money spent on SPED
summary(districtsped$DPFPASPEP)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   0.000   5.800   8.900   9.711  12.500  49.000       5
#4) Variable "DPFPASPEP" for money spent on SPED has missing observations 
#5) There are 1202 observations left
cleandistrictsped<-districtsped %>% drop_na()
#6) Point graph comparing DPFPASPEP and DPETSPEP
ggplot(cleandistrictsped,aes(x=DPFPASPEP, y=DPETSPEP))+ geom_point()

#these two variables have very little correlation the slope is relatively flat at zero on the point graph meaning relatively no correlation 
#7) The correlation is positive and slightly low at 0.37. 
cor(cleandistrictsped$DPETSPEP, cleandistrictsped$DPFPASPEP)
## [1] 0.3700234
#8) This means that money spent on special education only increases slightly as percent special education increases.