Insulin or Inequity? Exploring Treatment Patterns in Diabetic Inpatients
- Tim Neill
- Apr 28
- 3 min read
Updated: Jun 27
Can data expose hidden truths in healthcare? That question drove me as I explored treatment patterns in over 70,000 diabetic inpatie nt records. Like a well-crafted documentary, the numbers began to tell a story - one of potential disparities, unexpected patterns, and deeper questions about equity in care. What started as a SQL project quickly became something more meaningful.
Why This Project?
My motivation for choosing this project came from a deep interest in both healthcare and data analysis. I’ve always believed that data has the power to uncover inequalities—especially in a field that touches so many lives. I wanted to explore whether patients from different backgrounds truly receive the same level of care. This project felt unique because it allowed me to combine technical skills with a socially meaningful question:
Do demographic factors influence the intensity of inpatient diabetes treatment, and are all patients being treated equally?
What You Will Gain:
By reading this article, you'll gain insight into:
The relationship between patient demographics and treatment intensity.
How the number of lab procedures influences hospital stays.
Variations in treatment across different medical specialties.
The efficiency of care provided to emergency patients.
Key Takeaways:
Racial disparities exist in treatment patterns.
More lab procedures lead to longer hospital stays.
Certain medical specialties perform more procedures than others.
The majority of patients have short hospital stays, but longer stays are often linked to higher care needs.
Dataset Details:
The dataset I used comes from Kaggle, containing over 70,000 clinical records of diabetic inpatients. Each record gives insight into patient demographics, admissions, procedures, and medications. Using this de-identified data is a great way to analyze real-world trends in healthcare, providing a solid foundation for my findings.
Analysis Process:
I began by cleaning the data to ensure accuracy. It was essential to transform the data into formats suitable for analysis. I used SQL to run queries that helped reveal patterns. I was surprised by how significant the findings were—especially regarding racial disparities in treatment and how treatment intensity correlates with longer hospital stays.
Visuals and Insights:
Average Lab Procedures by Race

This table shows African-American patients had more lab procedures, hinting at potential disparities in treatment intensity.
Lab Procedures vs. Hospital Stay Groups

The summary table categorizes patients based on lab procedures and average hospital stay, suggesting that more procedures often mean longer stays.
Medical Specialties with High Procedure Counts

This table demonstrates that specialties like Thoracic Surgery and Cardiology performed more procedures, indicating high resource use.
Distribution of Hospital Stay Lengths

The histogram illustrates most patients are discharged within 7 days, indicating efficient throughput for many cases.
Percentage of Patients Discharged Under 3 and 7 Days


The average stay amongst all inpatients was 4.4 days.
Treatment Intensity: Short vs. Long Stays

Main Takeaways:
This project highlighted how data can reveal important patterns in healthcare. I learned that understanding treatment intensity and its correlation with demographics is vital in addressing potential disparities among diabetic inpatients. By using SQL for real-world analysis, I was able to quantify differences in care that can lead to better decision-making in healthcare settings.
Conclusion and Personal Reflections:
This project taught me more than just technical skills—it showed me the power of data to surface hidden stories and challenge assumptions. From cleaning messy records to uncovering meaningful patterns, every step deepened my interest in using analytics to drive real-world impact. I'm excited to keep asking hard questions and using data to help shape a more equitable future in healthcare.
Call To Action:
I’d love to connect with like-minded individuals on LinkedIn. If you’re interested in data analysis or healthcare, let’s chat!




















