library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.2     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.1.0     
## ── 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
library(readxl)
setwd("C:/Users/KaeRo/Desktop/R Studio/Reseach Data Selection")
library(readxl)
district <- read_excel("district.xls")

Create a new data frame with “DISTNAME”, “DPETSPEP” (percent special education) and “DPFPASPEP” (money spent on special education). call the dataframe whatever you want

New_district<-district %>% select(DISTNAME,DPETSPEP,DPFPASPEP)

Give me “summary()” statistics for both DPETSPEP and DFPASPEP. You can summarize them separately if you want.

summary(New_district$DPETSPEP)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    9.90   12.10   12.27   14.20   51.70
summary(New_district$DFPASPEP)
## Warning: Unknown or uninitialised column: `DFPASPEP`.
## Length  Class   Mode 
##      0   NULL   NULL

Which variable has missing values? Answer: DFPASPEP

remove the missing observations. How many are left overall? (REMOVE WITH drop_na) Answer: There are now 1202 observations (there were 1207)

Clean_New_district<-New_district %>% drop_na()

Create a point graph (hint: ggplot + geom_point()) to compare DPFPASPEP and DPETSPEP. Are they correlated? Answer: Not really (Correlation is .37) Do a mathematical check (cor()) of DPFPASPEP and DPETSPEP. What is the result? Answer: .37

ggplot(data=Clean_New_district,mapping=aes(x=DPFPASPEP,y=DPETSPEP)) + geom_point()

cor(Clean_New_district$DPFPASPEP,Clean_New_district$DPETSPEP)
## [1] 0.3700234

How would you interpret these results? (No real right or wrong answer – just tell me what you see)

I interepret these results that school districts do not rely on percentage of special education students to decide their funding for special education. This means that funding for special education is reliant on other factors, such as property taxes of the district, general funding for the school, or administration of the school district’s priorities.