SPARCS 2022 Healthcare Inpatient Discharge Analytics
A Python and Pandas analysis of more than 2.1 million New York State hospital inpatient discharge records, exploring patient demographics, healthcare utilization, clinical patterns and financial indicators.
Project Overview
I worked with the 2022 New York State SPARCS Hospital Inpatient Discharges dataset. The dataset contained 2,103,433 records and 33 columns.
The project gave me an opportunity to practise working with a large healthcare dataset using Python and Pandas, from initial inspection and data preparation through descriptive analysis and visualization.
What I Analysed
- Patient demographics
- Hospital and geographic utilization
- Admission and emergency-care patterns
- Clinical severity and outcomes
- Diagnosis and procedure utilization
- Length of stay
- Total charges and total costs
- Primary payer mix
Data Preparation
The original Length of Stay field was stored as text. I created a separate numeric version for analysis and converted values recorded as 120 + or 120+ to 120.
I also created numeric versions of Total Charges and Total Costs rather than overwriting the original fields.
After preparation, the Length of Stay, Total Charges and Total Costs analytical fields contained no missing values.
Key Findings
Age distribution
Patients aged 70 or Older represented the largest age group, accounting for 30.63% of inpatient discharges. The 50 to 69 age group followed at 26.92%.
Healthcare utilization
I examined inpatient discharge patterns across hospital service areas, counties and facilities to explore geographic differences in hospital utilization.
Clinical patterns
I explored severity of illness, risk of mortality, medical/surgical classification and patient disposition to understand patterns within the inpatient population.
Financial indicators
I analysed Total Charges and Total Costs and calculated a charge-to-cost ratio to explore the relationship between reported hospital charges and costs.
Payer mix
I examined primary payment typology to understand the distribution of payer types across inpatient records.
My Analytics Workflow
Loaded the dataset and examined its structure, columns and data types.
Cleaned analytical variables and created numeric fields for length of stay and financial analysis.
Used Pandas to group, aggregate and explore healthcare utilization and financial patterns.
Created visualizations to communicate patterns found during the analysis.
What I Practised
- Working with a large healthcare dataset
- Data-quality assessment
- Investigating missing values
- Checking for duplicate records
- Cleaning analytical variables
- Creating descriptive statistics
- Calculating percentages and percentiles
- Grouping and aggregating healthcare data
- Creating data visualizations
- Interpreting healthcare utilization and financial indicators
Limitations
The Length of Stay field includes records reported as 120+. These values were converted to 120 for numerical analysis, so the actual length of stay for those records may be higher.
Total Charges and Total Costs are reported healthcare financial fields. They should not automatically be interpreted as actual reimbursement, collected revenue or hospital profit.
The analysis is descriptive and is intended to explore patterns in the dataset rather than establish causal relationships.
What I Learned
This project helped me practise working through a large healthcare dataset using Python and Pandas.
It strengthened my experience with data preparation, descriptive analysis, healthcare utilization analysis, financial data analysis and visualization.
It also gave me practical experience working with healthcare concepts such as inpatient discharges, length of stay, severity of illness, risk of mortality, diagnoses, procedures and payer types.
Project Repository
The complete Python notebook and project documentation are available on GitHub.
View on GitHub →