Data Analysis · Python

US Medical Insurance Costs

Codecademy Portfolio Project  ·  June 2024

↓ scroll

Overview

Project description

Source
Codecademy
Author
Krutarth Ghuge
Date
June 2024
Tool
Python — VS Code

An end-to-end analysis of a US medical insurance dataset using custom Python functions and data visualization. The dataset was sourced from Codecademy and Kaggle, containing 1,338 entries with no missing values.

The project investigates how patient attributes — smoking status, BMI, age, number of children, sex, and region — correlate with annual medical charges, surfacing patterns relevant to healthcare, finance, and policy.

Python Pandas Matplotlib Statistics VS Code
1,338
Dataset entries
7
Feature columns
4
Analyses run
0
Missing values
View on GitHub

Data

Dataset overview

Columns

  • agenumerical
  • sexcategorical
  • bminumerical
  • childrennumerical
  • smokercategorical
  • regioncategorical
  • chargestarget

Project goals

  • Evaluate how attributes drive medical charges
  • Quantify cost differences for health-related factors
  • Explore correlations between children count and charges
  • Assess regional and sex-based charge variation

Methodology

Analysis performed


Results

Key findings

Smoking

Smokers incur dramatically higher charges on average — the single strongest predictor of cost in the dataset.

Age

Charges increase consistently with age, reflecting higher healthcare utilization as patients grow older.

BMI

Higher BMI correlates with higher charges, particularly in southeastern regions where obesity rates tend to be elevated.

Children

The relationship between number of dependents and charges is non-linear — families with 3 children do not always pay more than those with 1.


Visuals

Outputs

Average medical charges by age
Analysis 02
Average medical charges by age group
BMI vs charges by region
Analysis 03
BMI across US regions vs medical charges
Charges vs number of children
Analysis 04
Average charges by number of children

Hover to View Enlarged Graphs


Next steps

Further study

Future work could include multi-variable analysis — combining smoking, BMI, and region simultaneously — or applying regression models to predict charges. These insights have applications across multiple sectors.

Healthcare

Identify high-risk patient cohorts based on smoking status, BMI, and age for preventive care targeting.

Finance & Insurance

Build cost estimation models that help insurers price premiums more accurately based on patient attributes.

Government & Policy

Track regional charge trends to inform resource allocation and public health spending decisions.


References

Resources & links