Health Indicators in Utah Counties

A Shiny App by Julia Silge


Exploring Health Indicators in Utah Counties

There are 29 counties in my current home state of Utah, and Utah's Open Data Catalog makes a variety of health indicators for the counties in 2014 publicly available here. My Shiny App explores these health indicators and how they may be related. Check out the app here.

The app first loads the data, then does some cleaning and formatting. After that, the app makes a plot of two of the health indicators as chosen by the user.

health <- read.csv("./Health_Care_Indicators_By_Counties_In_Utah_2014.csv",
                      stringsAsFactors = FALSE)
health <- health[c(-1),]
health[,3:67] <- lapply(health[,3:67], as.numeric)
health <- health[,c(2:5,17,18,22,24,27,31,34,38,42,44,48,51,55,60,63,64)]

Highlighting a County

The user can choose a certain county to highlight in the plot from a drop down box. This is only available if values have been reported for that county for both chosen health indicators. For example, many rural counties in Utah have zero HIV-positive people living in them so the HIV rate for these counties is not reported. Here is a plot of children eligible for free lunch versus median household income with Salt Lake County highlighted.

plot of chunk unnamed-chunk-2

Linear Regression

The user can use a widget to add a linear regression line to the plot. This line can aid the eye in seeing a relationship or lack thereof. For example, here are the health care costs per person versus the percent of the population under 18.

plot of chunk unnamed-chunk-3

Correlation Coefficient

The last widget on the app allows the user to calculate the correlation coefficient for the two health indicators chosen. The estimate for the correlation coefficient is reported, along with the 95% confidence interval.

myCor <- cor.test(health$Rural, health$Premature.Age.adjusted.Mortality)

For example, for these two indicators (the percentage of county population who live in a rural area and the premature mortality rate), the correlation coefficient is 0.205 with a 95% confidence interval from -0.189 to 0.543.