Hospital Wait Times in The U.S.

McCauley Peters

As an EMT I have spent numerous times waiting in hospitals for the hospital to accept the patient. This made me start thinking about how wait times around the U.S. are. I began to think that maybe population size and/or density would have something to do with it. So with that I started to look around for datasets that I could use. If you would like to see from where I got my data: Census

The Centers for Medicare & Medicaid Services (CMS)

These two websites provided all the information I would need to complete this analysis.

These are the imports I used

I used this dictionary to simplify converting State Codes to Statenames.

Data Scraping

First things first, I had to read in the data from the wehsites I was using. For CMS it was simply a matter of downloading the csv. For the Census Bureau, however, I had to request an API key, and used that to request the data point I was interested in. You can take a look at some of the other variables here. I then was able to get the data in a json file that I could convert into a python dataframe.

Data Tidying

Next I only wanted to look at a subset of these values. And the Id code OP_18b corresponds with the average (median) time patients spent in the emergency department before leaving from the visit, where a lower number of minutes is better. I then replaced any not available values with NaN to not interfere with processing. Next to help with future merging I renamed a few columns and dropped others that contained extraneous information.

I then had to do the same to the census data. Now if you notice from hopital times, it was from the year 2019. So I decided to use the Bureau's 7/1/2019 population estimate which has the Date_Code set to 12. After that I then had to separate County and State values and rename them for future merging. I then also only wanted data from the continental U.S.

Here is where the last of the data tidying, and we can merge the two dataframes from before. We perform an inner join on County names since they are the most unique, and then we filter out any of the rows that have different state names since that is a mismatch. Next we drop a lot of values to be left with the data that we want, namely county and population and density. And we also need to drop any of the NaN values sicne they will mess with any modeling.

Data Analysis

First I wanted to take a look at the number hospitals in a state and the population of that state. One thing to note about this however is that state lines are not impenetrable. This means that if someone is on the border of a state, but is closer to a hospital in a state they do not live, then that will throw this off slightly. I will be assuming that this is minimal and barely affects the overrall trend. Then I will also be able to analyze things like the average score and density to help pinpoint positive and negative correlations between these variables.

Based on the linear fit, it is easy to see that a larger population results in more hospitals. While this seems like an obvious statement, I had to start somewhere.

Looking at the ratio of hospitals to population vs population however yield different results. There looks to be a negative correlation to the number of hospitals per person as population increases. There are any number of reasons for this, but one explanation could be that States with larger populations, have more cities, and therefore since the concentration of population is greater, you get larger hospitals, but less.

So based on this graph I can see that as the number of hospitals increases, the amount of hospitals per person decreases. This is inline with what was boserved with the previous two graphs. A positive correlation between population size and hospital count, but a negative ratio between ratio and population would indicate that there would be negative correlation between ration and hopsital count. Nothing surprising here.

It does seem that the higher a population is, the longer it takes to wait in an emergancy room. That would start to make sense, considering there are also less hospitals to admit people, even if they are larger.

Here we can see that as the number of hospitals increases, the score tends to decrease. That would mean more hospitals is a good thing. More hospitals means more options and less waiting around to get admitted.

This graph shows a stronger slope for the score vs ratio. Thism eans that a better hospital per person ratio results in shorter wait times. This again makes sense. If there are more options per person, then they can be moved through faster.

This graph starts by showing that a high population density has a lower hospital ratio. That is not what you want. It seems that my earlier assumption about high density states, having larger and fewer hospitals would be correct.

This graph also tells a good story about how a higher population dnesity tends to result in a higher average score. That definitely indicates that higher population density results in longer wait times.

Conclusion:

Based on all of this we can safely say that a greater number of hospitals is more beneficial for people. This means that even smaller hospitals will help people. None of this accounts for severity, but if we assume an equal distribution of high to low severity, then lower severity patients would go to the smaller hospitals, freeing up the larger hospitals for the more serious conditions. So my recommendation would be that going to larger population densities and increasing the number of smaller hopsitals would help reduce wait times.