library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.1     ✔ readr     2.2.0
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.3     ✔ tibble    3.3.1
## ✔ lubridate 1.9.5     ✔ tidyr     1.3.2
## ✔ purrr     1.2.2     
## ── 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)
library(pastecs)
## 
## Attaching package: 'pastecs'
## 
## The following objects are masked from 'package:dplyr':
## 
##     first, last
## 
## The following object is masked from 'package:tidyr':
## 
##     extract
clean <- read_excel("district.xls")
clean <- clean |> drop_na(DA0CC23R,DPSTKIDR) %>% filter(DA0CC23R>0)
clean <- clean |> mutate(DA0CC23R_SQRT=sqrt(DA0CC23R))

#cor(clean) errored
district_kid23 <- clean %>% select(DPSTKIDR,DA0CC23R) %>% arrange(-DPSTKIDR,DA0CC23R)

district_kid23
## # A tibble: 972 × 2
##    DPSTKIDR DA0CC23R
##       <dbl>    <dbl>
##  1    156.      10.3
##  2     59.7     68.3
##  3     54.1      7.6
##  4     53.5     37.9
##  5     28.5     10.8
##  6     28.2     20  
##  7     27.6     35.9
##  8     24.2     33.3
##  9     23.2     44.3
## 10     22.7     29.4
## # ℹ 962 more rows
cor(district_kid23)
##            DPSTKIDR   DA0CC23R
## DPSTKIDR 1.00000000 0.02585312
## DA0CC23R 0.02585312 1.00000000

X - NUMBER OF STUDENTS PER TEACHER Y - COLLEGE ADMISSIONS: % AT/ABOVE CRITERION (2022-2023)

pairs(district_kid23)

cor.test(clean$DPSTKIDR,clean$DPSTKIDR)
## 
##  Pearson's product-moment correlation
## 
## data:  clean$DPSTKIDR and clean$DPSTKIDR
## t = 1477919422, df = 970, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  1 1
## sample estimates:
## cor 
##   1
cor.test(clean$DPSTKIDR,clean$DPSTKIDR,method="spearman")
## Warning in cor.test.default(clean$DPSTKIDR, clean$DPSTKIDR, method =
## "spearman"): cannot compute exact p-value with ties
## 
##  Spearman's rank correlation rho
## 
## data:  clean$DPSTKIDR and clean$DPSTKIDR
## S = 0, p-value < 2.2e-16
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho 
##   1
cor.test(clean$DPSTKIDR,clean$DA0CC23R,method="kendall")
## 
##  Kendall's rank correlation tau
## 
## data:  clean$DPSTKIDR and clean$DA0CC23R
## z = 1.7577, p-value = 0.07881
## alternative hypothesis: true tau is not equal to 0
## sample estimates:
##        tau 
## 0.03793969

I originally attempted to date my data under Kendall because this data does not feel normal. There seems to be no correlation between number of students per teacher and the percentage of graduating students.