This code was put together to see if there is a relationship between chronic absenteeism among K-12 public and charter school students and opioid prescription rates. Chronic absenteeism is shockingly high among kindergartners and 1st graders. At that age, the reasons that young students do not show up at school at that age is often a reflection of parental issues, lack of transportation, homelessness, etc. Adults in severe pain taking prescription opioid medicine may also be less engaged in their childrenbs academic lives. According to the NIH Medline Plus about 5% of those who use opioid medicines over a year will develop a physical addiction to opioids and babuse the drugs, or give them to others. Long-term daily use of opioids leads to physical dependence, which is not to be confused with addiction disorder.b
This research is to see if there is a statistical relationship between these two important crises.
The data comes from the Department of Education Office for Civil Rights which for the 2013-2014 school year asked about chronic absenteeism for the first time. In this data set, chronic absenteeism was defined as a student absent for 15 or more school days. The Centers for Disease Control produce data on prescription opioid data annually. The data comes from the most recent year available, 2016. The author wants to thank Reuben Levy-Myers, graduate student at Johns Hopkins University for his review and suggestions
The Code
##
## 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
This blog includes two charts looking at this relationship. The CDC publishes its prescription data by county and FIPS and the Department of Education has its data by district and individual school, NCES ID and their complete street address. A separate education data file has individual schools with NCES IS, FIPS and a LOCALE indicator, to identify if a school area is in a city, suburb, town or rural community, with three subdivisions of the four larger categories. Using NCES IDs, categorical data was added to the OCR data which has information on chronic absenteeism.
In many parts of the country, school districts and county lines are not the same. Chronic absenteeism by county was calculated using a weighted average. School districts are allowed to not submit data if there are too few students for privacy concerns and there data is flagged in the system with negative chronic absenteeism number. All of these schools were filtered out. In addition, since chronic absenteeism data was first collected for the 2013-14 school year, many schools previously collect the data or had a different standard than the 15 days of this report and thus did not report any data, or zero chronic absent students. These schools were also filtered out.
#calculate absenteeism by county - use weighted average
countyName1 <- group_by(OCRdata, LEA_STATE) %>% group_by(CONAME, FIPS)
countyName1 <- mutate(countyName1, countyEnroll = sum(TOT_ENR_M + TOT_ENR_F))
countyName1 <- mutate(countyName1, schoolAbsent = sum(TOT_ABSENT_M + TOT_ABSENT_F))
countyName1 <- filter(countyName1, schoolAbsent > 0)
countyName1 <- mutate(countyName1, countyAbsentPer = schoolAbsent/countyEnroll)
countyName3 <-unique(countyName1[c("LEA_STATE", "CONAME", "FIPS", "countyEnroll", "schoolAbsent", "countyAbsentPer", "LOCALE")], na.rm= TRUE)
OpioidData <- read_xlsx("OpioidCountyData.xlsx")
OpioidData1 <- select(OpioidData, State, FIPS, FullCountyName, PrescribingRate)
OpioidData1$PrescribingRate <- as.numeric(OpioidData1$PrescribingRate)
## Warning: NAs introduced by coercion
OpioidData1 <- na.omit(OpioidData1)
OpioidData1 <- filter(OpioidData1, OpioidData1$PrescribingRate > 0)
The opioid data was added to OCR data. There were 273 counties with NA values and another two counties with a zero reported prescription rate. Both categories were filtered out. The entire country was graphed. As you can see there is a positive trend line indicating there is a relationship between the two crises.
countyName3 <- merge(countyName3, OpioidData1, by.x = "FIPS", by.y = "FIPS")
The entire country was graphed. As you can see there is a positive trend line indicating there is a relationship between the two crises.
It was then decided to look at the national data broken down by individual state.
#graph data by state
graphColors <- brewer.pal(6, "Paired")
g <- ggplot(countyName3, aes(x = PrescribingRate, y = countyAbsentPer))
g + geom_point(alpha = .10, color = "steelblue") +
facet_wrap(~State, nrow = 5) +
xlim(0, 300) +
ylim(0, .7) +
geom_smooth(method ="lm", color = "red", na.rm = TRUE, se = FALSE) +
xlab("2016 Opioid Prescribing Rate by County (per hundred people)") +
ylab("2013-14 Student Absentee Rate by County (weighted average)") +
theme(axis.text.x = element_text(color="black", size=6, angle=45)) +
ggtitle("Comparison of Student Chronic Absenteeism & Opioid Prescription Rates")
## Warning: Removed 3 rows containing missing values (geom_point).
In conclusion, this preliminary data indicates that the opioid prescription crisis and school chronic absenteeism crises are related and have unfortunately, a positive relationship. However, more research will be needed to understand this relationship. Future blog posts will continue to study this topic in greater detail and with other variables.