knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyr)
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v tibble 3.0.4 v stringr 1.4.0
## v readr 1.4.0 v forcats 0.5.0
## v purrr 0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(knitr)
#reading in merged Chemistry File -- with only the columns needed
setwd("C:/Users/BlaiseSevier/Desktop/R Work")
fileChem <- "Chemistry.csv"
getwd()
## [1] "C:/Users/BlaiseSevier/Desktop/R Work"
Chem.sch <- read.csv(fileChem)
### How to set your working directory
## In quotation marks, ("C: /Users/BlaiseSevier/Desktop/R Work")
setwd("C:/Users/BlaiseSevier/Desktop/R Work")
###NEW Enrol Numbers
els.k12 <- 5296951
nonel.k12 <- 45625450
#Total Number of Students in HS
tot_enrol_hs <- 14183488
#Total Number of Non-Els in HS
non.el.hs <- 13108063
#Total Number of LEP in HS
tot_lep_hs <- 1075425
# Reserve code value
# Definition
# -3 | Skip Logic Failure
# -5 | Action Plan
# -6 | Force Certified
# -8 | EDFacts Missing Data
# -9 | Not Applicable / Skipped
# -11 | Suppressed Data
For more information about the school form see: https://www2.ed.gov/about/offices/list/ocr/docs/2017-18-crdc-school-form.pdf.
TOT_SCIENR_CHEM_M Students Enrolled in Chemistry: Calculated Male Total TOT_SCIENR_CHEM_F Students Enrolled in Chemistry: Calculated Female Total SCH_SCIENR_CHEM_LEP_M Students Enrolled in Chemistry: LEP Male SCH_SCIENR_CHEM_LEP_F Students Enrolled in Chemistry: LEP Female
#Code to change the -9s to 0s
Chem.sch[Chem.sch==-9]<-0
#Computes the total number of a non-English Learner male students in Chemistry courses
#dat$NonELM<- (dat$TOT_ENR_M - dat$TOT_LEPENR_M)
Chem.sch$NonELM <- (Chem.sch$TOT_SCIENR_CHEM_M - Chem.sch$SCH_SCIENR_CHEM_LEP_M)
sum(Chem.sch$NonELM)
## [1] 1334787
#There are 1,334,787 Non-English Learner Male Students Enrolled in Chemistry
#Total female non-EL
#dat$NonELF <-dat$TOT_ENR_F-dat$TOT_LEPENR_F
Chem.sch$NonELF <- (Chem.sch$TOT_SCIENR_CHEM_F - Chem.sch$SCH_SCIENR_CHEM_LEP_F)
sum(Chem.sch$NonELF)
## [1] 1445363
#There are 1,445,363 Non-English Learner Females Enrolled in Chemistry courses.
#total non EL
#dat$NonEL<-dat$NonELF + dat$NonELM
Chem.sch$NonEL <- Chem.sch$NonELF + Chem.sch$NonELM
non.el.Chem <- sum(Chem.sch$NonEL)
non.el.Chem
## [1] 2780150
#There are 2,780,150 Non-English Learners Enrolled in Chemistry
#Total Lep Male in Chemistry
#dat$ELMGT <- dat$SCH_GTENR_LEP_M
Chem.sch$ELM.Chem <- Chem.sch$SCH_SCIENR_CHEM_LEP_M
sum(Chem.sch$SCH_SCIENR_CHEM_LEP_M)
## [1] 71852
sum(Chem.sch$ELM.Chem)
## [1] 71852
## There is 71,852 English Learner Males in Chemistry
#Total LEP Female in GT
#dat$ELFGT <- dat$SCH_GTENR_LEP_F
Chem.sch$ELF.Chem <- Chem.sch$SCH_SCIENR_CHEM_LEP_F
sum(Chem.sch$ELF.Chem)
## [1] 61048
## There are 61,048 EL Females in Chemistry Classes
#dat$ELEnrol <- dat$TOT_LEPENR_M + dat$TOT_LEPENR_F
Chem.sch$ELEnrolChem<- Chem.sch$ELM.Chem + Chem.sch$ELF.Chem
els.Chem <- sum(Chem.sch$ELEnrolChem)
sum(els.Chem)
## [1] 132900
## There is 132,900 English learners in Chemistry
#Percetage of ELs in Chemistry in HS is 12%
round(els.Chem/tot_lep_hs*100,2)
## [1] 12.36
#Percentage of ELs in Chem in K-12 3%
round(els.Chem/els.k12*100,2)
## [1] 2.51
#Percentage of non-ELs in Chem is 21% in HS
round(non.el.Chem/non.el.hs*100,2)
## [1] 21.21
#Percentage of non-ELs in Chem in K-12 is 6%
round(non.el.Chem/nonel.k12*100,2)
## [1] 6.09