1. create an Rmarkdown document with “district” data
  2. create a new data frame with “DISTNAME”, “DPETSPEP” (percent special education) and “DPFPASPEP” (money spent on special education). call the dataframe whatever you want
  3. give me “summary()” statistics for both DPETSPEP and DFPASPEP. You can summarize them separately if you want.
  4. Which variable has missing values?
  5. remove the missing observations. How many are left overall? (REMOVE WITH drop_na)
  6. Create a point graph (hint: ggplot + geom_point()) to compare DPFPASPEP and DPETSPEP. Are they correlated?
  7. Do a mathematical check (cor()) of DPFPASPEP and DPETSPEP. What is the result?
  8. How would you interpret these results? (No real right or wrong answer – just tell me what you see)
  9. Knit the Rmarkdown and submit to Rpubs for publishing
  10. submit the link to Rpubs on CANVAS
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)


district<-read_excel("district.xls")
data1<-district %>% select(DISTNAME,DPETSPEP, DPFPASPEP)
summary(data1)
##       DISTNAME       DPETSPEP       DPFPASPEP     
##  Length   :1207   Min.   : 0.00   Min.   : 0.000  
##  N.unique :1196   1st Qu.: 9.90   1st Qu.: 5.800  
##  N.blank  :   0   Median :12.10   Median : 8.900  
##  Min.nchar:   7   Mean   :12.27   Mean   : 9.711  
##  Max.nchar:  50   3rd Qu.:14.20   3rd Qu.:12.500  
##                   Max.   :51.70   Max.   :49.000  
##                                   NAs    :5

4.missing values DPFPASPEP 5. there are 1202 Observations : )

Dropping NAs

data2<-data1 %>% na.omit()
ggplot(data2, aes(x=DPFPASPEP, y=DPETSPEP)) + geom_point()

6. There is a weak correlation between the two from the points available

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

  2. I would say that this is not a significant relationship with districts spending on special education programs in relation to the percentage of students.