Loading the Data

setwd("~/Documents/R Files/Project")
districts <- read_csv("district_info.csv", skip=1)

1) Summary

summary(districts$DPETALLC)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      9     339     887    4578    2912  176039 
summary(districts$DPETECOP)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00   46.27   61.15   59.56   75.92  100.00 
summary(districts$DPETRSKP)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00   32.77   45.25   46.23   57.25  100.00 
summary(districts$DPETLEPP)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00    3.60    8.90   14.16   19.10   89.70 
summary(districts$DPETSPEP)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
    0.0    13.3    16.0    16.2    18.7    87.3 

2) Histograms

hist(districts$DPETALLC,
     main = "Distribution of District Enrollment",
     xlab = "Total Student Enrollment",
     col = "lightblue",
     border = "navy")

hist(districts$DPETECOP,
     main = "Distribution of Economically Disadvantaged Students",
     xlab = "Economically Disadvantaged (%)",
     col = "lightblue",
     border = "navy")

hist(districts$DPETRSKP,
     main = "Distribution of At-Risk Students",
     xlab = "At-Risk Students (%)",
     col = "lightblue",
     border = "navy")

hist(districts$DPETLEPP,
     main = "Distribution of Emergent Bilingual / English Learner Students",
     xlab = "Emergent Bilingual / English Learner (%)",
     col = "lightblue",
     border = "navy")

hist(districts$DPETSPEP,
     main = "Distribution of Special Education Students",
     xlab = "Special Education (%)",
     col = "lightblue",
     border = "navy")

3) Compare Variables

ggplot(districts, aes(x = DPETECOP, y = DPETRSKP)) +
  geom_point(shape = 21, fill = "lightblue", color = "navyblue", size = 2.3) +
  labs(
    title = "Economically Disadvantaged vs. At-Risk Students",
    x = "Economically Disadvantaged (%)",
    y = "At-Risk Students (%)"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(hjust = 0.5)
  )

4) Correlation

cat(cor(districts$DPETECOP,
        districts$DPETRSKP,
        use = "complete.obs"))
0.6057746

The correlation between the percentage of economically disadvantaged students and the percentage of at-risk students is approximately 0.61. This indicates a moderate positive relationship between the two variables. In general, districts with higher percentages of economically disadvantaged students also tend to have higher percentages of students classified as at risk.