The data are from the National Center for Education Statistics (NCES), Common Core of Data. They are a random sample of 700 public schools in the eastern portion of Pennsylvania. We focus on Speciality schools (Magnet & Charter) in this assignment.

Part 1: Data Processing

Load all the libraries relevant for generating maps.

library(rgdal)
## Warning: package 'rgdal' was built under R version 3.4.4
## Loading required package: sp
## Warning: package 'sp' was built under R version 3.4.4
## rgdal: version: 1.3-3, (SVN revision 759)
##  Geospatial Data Abstraction Library extensions to R successfully loaded
##  Loaded GDAL runtime: GDAL 2.2.3, released 2017/11/20
##  Path to GDAL shared files: C:/Users/Ravindra/Documents/R/win-library/3.4/rgdal/gdal
##  GDAL binary built with GEOS: TRUE 
##  Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
##  Path to PROJ.4 shared files: C:/Users/Ravindra/Documents/R/win-library/3.4/rgdal/proj
##  Linking to sp version: 1.3-1
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.4.4
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.4.4
## 
## 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(mapview)
## Warning: package 'mapview' was built under R version 3.4.4
## 
## Attaching package: 'mapview'
## The following object is masked from 'package:leaflet':
## 
##     addMapPane
counties<- readOGR(dsn = ".", layer = "cb_2016_us_county_500k")
## OGR data source with driver: ESRI Shapefile 
## Source: "F:\THESIS\Tanya\R-Folder\data", layer: "cb_2016_us_county_500k"
## with 3233 features
## It has 15 fields
## Integer64 fields read as strings:  awater aland
#since the scope is limited to Eastern Pennsylvania
counties = subset(counties,statefp =="42")

Reading the Eastern Schools dataset for further analysis

EasternSchools<-read.csv("./EasternSchools.csv")

Part 2: Analysis

a<-EasternSchools %>% filter(magnetSchoolStatus == "Yes")
## Warning: package 'bindrcpp' was built under R version 3.4.4
b<-EasternSchools %>% filter(isCHARTER == "Yes")
c<-EasternSchools %>% filter(magnetSchoolStatus == "No")
d<-EasternSchools %>% filter(isCHARTER == "No")

Map#1 - Spread of Non-Speciality Public Schools and Speciality Public Schools Across Eastern Pennsylvania

allschools = leaflet(counties) %>% addTiles() %>%
        addPolygons(weight=1,color="blue",fillOpacity = .1) %>%
  addCircleMarkers(data = a, radius = 3, color = "red", weight = 3, opacity = 1, fill = TRUE, fillColor = "red", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = b, radius = 3, color = "red", weight = 3, opacity = 1, fill = TRUE, fillColor = "red", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = c, radius = 3, color = "green", weight = 3, opacity = 0.2, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = 3, color = "green", weight = 3, opacity = 0.2, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~city) %>%
  addLegend("topright", colors = c("red", "green"), labels = c("Speciality School", "Not A Speciality School"), title = "Type of School", opacity = 1)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
specialityschools= leaflet() %>% addTiles() %>%
  addCircleMarkers(data = a, radius = 3, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = b, radius = 3, color = "yellow", weight = 3, opacity = 0.5, fill = TRUE, fillColor = "red", fillOpacity = 0.2, label = ~city) %>%
  addRectangles(lng1 = -75.00000, lat1 = 39.90000, lng2 = -75.30000, lat2 = 40.10000, color = "red", weight = 5,
    fillColor = "transparent") %>%
  addLabelOnlyMarkers(lng = -75.1652, lat = 39.9526, label = "Philadelphia", 
             labelOptions = labelOptions(noHide = T, textsize = "10px")) %>%
  addLegend("topright", colors = c("blue", "yellow"), labels = c("Magnet School", "Charter School"), title = "Type of Speciality School", opacity = 1)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
sync(allschools, specialityschools)

Analysis:

From this figure, we see two map diagrams. The left one is primarily to underline the specialty and non-specialty schools in the Eastern Philadelphia. The polygons represent each district in the state. We can infer that a good proportion of public schools are concentrated close to the philadelphia city due to the high population density. On the other hand, from the right map we see lot of magnet and charter schools near by philadelphia city. One observation is that there are no magnet school outside philadelphia with no blue dot outside the box.

Map2: Spread of Races Across Non-Speciality Public Schools and Spread of Various Races Across Speciality Public Schools

allschools_race_white = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = c, radius = ~raceWHITE/200, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = ~raceWHITE/200, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addLegend("topright", colors = c("blue"), labels = c("White"), title = "Races", opacity = 1)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
allschools_race_black = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = c, radius = ~raceBLACK/200, color = "yellow", weight = 3, opacity = 1, fill = TRUE, fillColor = "yellow", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = ~raceBLACK/200, color = "yellow", weight = 3, opacity = 1, fill = TRUE, fillColor = "yellow", fillOpacity = 0.2, label = ~city) %>%
  addLegend("topright", colors = c("yellow"), labels = c("Black"), title = "Races", opacity = 1)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
allschools_race_others = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = c, radius = ~EasternSchools$raceAsianAmerindHI/200, color = "green", weight = 3, opacity = 1, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = ~EasternSchools$raceAsianAmerindHI/200, color = "green", weight = 3, opacity = 1, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~city) %>%
  addLegend("topright", colors = c("green"), labels = c("American Indians, <br>Asians & Hispanics"), title = "Races", opacity = 1)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
specialityschools_race = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = a, radius = ~raceWHITE/200, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = b, radius = ~raceWHITE/200, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = a, radius = ~raceBLACK/200, color = "yellow", weight = 3, opacity = 1, fill = TRUE, fillColor = "yellow", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = b, radius = ~raceBLACK/200, color = "yellow", weight = 3, opacity = 1, fill = TRUE, fillColor = "yellow", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = a, radius = ~EasternSchools$raceAsianAmerindHI/200, color = "green", weight = 3, opacity = 1, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = b, radius = ~EasternSchools$raceAsianAmerindHI/200, color = "green", weight = 3, opacity = 1, fill = TRUE, fillColor = "green", fillOpacity = 0.2, label = ~city) %>%
  addLegend("topright", colors = c("blue", "yellow", "green"), labels = c("White", "Black", "American Indians, <br>Asians & Hispanics"), title = "Races", opacity = 1)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
latticeView(allschools_race_white, allschools_race_black, allschools_race_others, specialityschools_race)

Analysis:

There are four maps created to analyze the diversity spread across non-specialty and specialty schools in the Eastern Philadelphia. The individual maps showed that the white and black race is spread across the public schools in the region with negligible population of American indians, hispanics and asians. The left bottom map showed the race spread in the specialty schools. We can infer that a good black population study in such schools in this region and also have diversity of thought with other races primarily in the philadelphia city limits.

Map#3 : Number of Students in Grade4 Across Non-Speciality Public Schools and Number of Students in Grade10 Across Non-Speciality Public Schools

allschools_grade4 = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = c, radius = ~G04/10, color = "red", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = ~G04/10, color = "red", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
allschools_grade10 = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = c, radius = ~G10/10, color = "green", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = ~G10/10, color = "green", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
latticeView(allschools_grade4, allschools_grade10)

Analysis:

The left map represent the students from the public schools studying grade4 in the Eastern Philadelphia. The right map showed the students studying grade10 in the public schools. From this findings, we can conclude that proportion of students are higher in grade10 showing that students continued to pursue higher education in the region.Reading and Drexel Hill are two areas that have the highest number of grade10 students in the Eastern Philadelphia.

Map#4 : Attendance rate Across Non Speciality Public Schools and Attendance rate Across Speciality Public Schools

allschools_attendance = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = c, radius = ~AttendRate/10, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = d, radius = ~AttendRate/10, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
specialityschools_attendance = leaflet() %>% addTiles() %>%
  addCircleMarkers(data = a, radius = ~AttendRate/5, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city) %>%
  addCircleMarkers(data = b, radius = ~AttendRate/5, color = "blue", weight = 3, opacity = 1, fill = TRUE, fillColor = "blue", fillOpacity = 0.2, label = ~city)
## Assuming "LON" and "LAT" are longitude and latitude, respectively
## Assuming "LON" and "LAT" are longitude and latitude, respectively
latticeView(allschools_attendance, specialityschools_attendance)

Analysis

To find the attendance rate at public and specialty schools in Eastern Philadelphia, I plotted the graph for all the schools and this showed that majority of the students are good across the Eastern Philadelphia. Similarly, the right side map highlighted that students located in philadelphia attend regularly when this comes to specialty schools in the region.

Part 3: Results

We can conclude that there are significant number of public schools compared to the concentrated specialty schools near philadelphia. The student race diversity is very mixed with black & while in public schools and other races were only found in specialty schools near philadelphia. Some magnet schools recorded a large proportion of white population accordingly. We can conclude from the map#3 that students number improved in public schools with rise in concentration from grade4 to grade10. Similarly, the attendance rate across majority of the Eastern Philadelphia across all the schools in my view.

Part 4: Conclusion

This exercise provided good opportunity to study the scope of exploratory datasets to generate key insights about the student diversity, proficiency and socio-economic condition at specialty and non-specialty schools in Eastern Philadelphia.