Coder Social home page Coder Social logo

us-medical-insurance's Introduction

Health Insurance Costs Analysis

This repository contains code and analysis for exploring the factors influencing health insurance costs using a dataset of 1,338 observations. Each observation represents an individual insurance policyholder with various attributes.

Overview

This study aims to determine the relationship between several predictors and the response variable (insurance charges) through exploratory data analysis and regression modeling.

Dataset

The dataset includes the following variables:

  • age (numeric)
  • sex (categorical: male, female)
  • BMI (numeric)
  • children (numeric)
  • smoker (categorical: yes, no)
  • region (categorical: northeast, northwest, southeast, southwest)
  • charges (numeric, representing insurance costs)

The data was sourced from an insurance company's database, reflecting policyholder characteristics and their associated charges.

Methods

Data Processing

  • Checking for missing values and data inconsistencies.
  • Encoding categorical variables as necessary for regression analysis.
  • Normalizing/standardizing numerical variables if required, depending on the analysis.

Exploratory Data Analysis (EDA)

  • Creating scatter plots to investigate linear relationships between insurance charges and several predictors (age, BMI).
  • Calculating summary statistics and distributions of variables.
  • Checking for normal distribution of variables.

Regression Modeling

Two models were fitted:

  1. Simple Linear Regression Model focusing on one predictor.
  2. Multiple Linear Regression Model incorporating all predictors.

Model Evaluation

  • Comparing coefficients, p-values, and R^2 values.
  • Residual plots to evaluate model assumptions.
  • Calculating a 95% prediction interval for insurance charges based on the average value of a selected predictor.

Code and Dependencies

The analysis is performed in a Jupyter notebook. The main libraries used are:

  • pandas
  • seaborn
  • matplotlib
  • scipy
  • sklearn
  • numpy

File Structure

  • Midterm_MAT326.ipynb: Jupyter notebook containing the analysis and code.
  • Midterm_MAT326.pdf: PDF report of the analysis.

Running the Code

To run the notebook, follow these steps:

  1. Ensure you have a Python environment set up with the necessary libraries installed. You can use the following command to install the required libraries:
pip install pandas seaborn matplotlib scipy scikit-learn numpy
  1. Open the Jupyter notebook and run the cells to reproduce the analysis.

Summary of Findings

  • Age and BMI were found to have significant linear relationships with insurance charges.
  • Smoking status was a major predictor of higher insurance charges.
  • The multiple linear regression model explained about 78.3% of the variability in insurance charges, compared to 12.4% by the simple linear regression model.
  • Residual plots indicated some non-linearity and heteroscedasticity, suggesting the need for further model refinement.

Future Work

  • Investigate non-linear models or transformations to improve model fit.
  • Explore additional predictors or interaction terms.
  • Conduct further analysis to address potential outliers and influential points.

Contact

For any questions or feedback, please contact Brandon Mocco at [email protected].


This README provides a comprehensive overview of the analysis and how to reproduce the results. Feel free to reach out if you have any questions or suggestions!

us-medical-insurance's People

Contributors

bmocc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.