library(readxl)
district <- read_excel("district.xls")
View(district)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.0     ✔ readr     2.1.6
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.1     ✔ tibble    3.3.1
## ✔ lubridate 1.9.5     ✔ 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
hwdata <- district %>%
  select(DISTNAME, DPETSPEP, DPFPASPEP)
summary(hwdata$DPETSPEP)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    9.90   12.10   12.27   14.20   51.70
summary(hwdata$DPFPASPEP)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   0.000   5.800   8.900   9.711  12.500  49.000       5
#DPFPASPEP has 5 missing values
drop_na(hwdata)
## # A tibble: 1,202 × 3
##    DISTNAME                     DPETSPEP DPFPASPEP
##    <chr>                           <dbl>     <dbl>
##  1 CAYUGA ISD                       14.6      28.9
##  2 ELKHART ISD                      12.1       8.8
##  3 FRANKSTON ISD                    13.1       8.4
##  4 NECHES ISD                       10.5      10.1
##  5 PALESTINE ISD                    13.5       6.1
##  6 WESTWOOD ISD                     14.5       9.4
##  7 SLOCUM ISD                       14.7       9.9
##  8 ANDREWS ISD                      10.4      10.9
##  9 PINEYWOODS COMMUNITY ACADEMY     11.6       9.2
## 10 HUDSON ISD                       11.9      10.3
## # ℹ 1,192 more rows
#1202 observations remain
ggplot(data = hwdata, aes(x = DPETSPEP, y = DPFPASPEP)) +
  geom_point()
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

cor(hwdata$DPETSPEP,hwdata$DPFPASPEP)
## [1] NA
#the math data didnt produce a result, but it looks to me a positive correlation