Mortality Dashboard

I’m creating a public dashboard using Florida Department of Corrections Inmate Mortality data. This post details my project progress, aiming to ensure transparency and gain community support. Despite anticipated challenges, sharing this project should facilitate problem-solving and keep me accountable.

Dashboard Structure

I’ve had considerable success using Github Pages. Ideally, the finished dashboard would reside at a dedicated URL, like ‘fdocmortality.com’, and I believe I could relatively quickly and easily move my entire repository to a dedicated URL.

I will cross that bridge when I come to it — the final dashboard will consist of D3.js code embedded in an HTML document via the Distill package within RStudio. I should be able to host it anywhere.

Data Sources

I plan to use two data sources — the monthly OBIS and the fiscal-yearly inmate mortality tables.

I should be able to write an R script that connects directly and updates monthly from the OBIS database. I should also be able to concurrently scrape the ‘Inmate Mortality’ tables posted by the FDOC. This would allow for the dashboard to be updated monthly, in sync with the FDOC updates.

However, embedding this script within a Distill static website is beyond my current skills, if it’s even feasible at all.

Instead, I intend to manually update the data for the dashboard biannually: once at the start of the new year and once at the start of the fiscal year.

OBIS Data

Show code
x <- 10
base_dir <- "/Users/johnwise/Downloads/INMATE_RELEASE_TEXTFILES"
# Data Import
Root <- read_delim(paste0(base_dir, "/INMATE_RELEASE_ROOT.txt"))
obis_deaths <- Root  %>% filter(releasedateflag_descr == 'deceased') %>% select(DCNumber, releasedateflag_descr, PrisonReleaseDate, Sex, race_descr)
obis_deaths %>%
  head(x) %>%
  kable(caption = paste("Omitting", dim(obis_deaths)[1]-x, "rows for display")) %>%
  kable_styling(latex_options = "hold_position")
Table 1: Omitting 8350 rows for display
DCNumber releasedateflag_descr PrisonReleaseDate Sex race_descr
000001 deceased 04/24/2005 M WHITE
000062 deceased 12/09/2014 M WHITE
000198 deceased 06/27/2013 M BLACK
000329 deceased 08/29/2014 M BLACK
000418 deceased 05/13/2013 M WHITE
000517 deceased 12/12/2008 M WHITE
000645 deceased 08/14/2005 M BLACK
000741 deceased 05/14/2023 M BLACK
000791 deceased 05/30/2020 M BLACK
000828 deceased 10/17/2010 M BLACK

The OBIS data provides demographic information on those who perished within the FDOC, such as race and sex, even though it may not be as reliable for the date of death (see my addendum to the mortality investigation.) In addition, the OBIS database contains further details like incarceration and charge histories, which could be useful if we decide to include that information in the future.

Inmate Mortality Postings

I copied and pasted these tables from here: fiscal-yearly inmate mortality tables 2024-01-01

Data Table

And here we already have one component of our dashboard – a sortable and searchable table of counts tabulated by facility and type of death for the dates between the FYs 2015-2023, and last synced with FDOC data 2024-01-01.

Show code
# Creating the table utilizing the data imported and cleaned above
facilities <- deaths %>% 
  group_by(FACILITY_description, Manner_Death) %>% 
  summarise(count = n()) %>%
  pivot_wider(names_from = Manner_Death, values_from = count, values_fill = 0) %>%
  mutate(total = sum(Natural,Suicide, Accident,Homicide,Pending)) %>%
  arrange(desc(total))
datatable(facilities, options = list(scrollX = TRUE, pageLength = 10, lengthMenu = c(10, 20, 50)))

Bar Chart

The next component I’d like to create is a horizontal bar chart. It will represent the count of deaths for each facility, and it will be interactively filterable by type of death. This part might take a few days – I need to review quite a bit of D3 coding before I can begin to experiment.