Challenge

Project 1 : Analysis of Medical Insurance Data

All the questions are answered and all required files are attached at the end, here is just the brief and short answer for the question.

1. Explain the data. Check It is supervised or Unsupervised. Demonstrate?

Ans.

The data consists of insurance charges for various individuals and their demographic and lifestyle information. The variables in the dataset are:

  • age: age of the primary beneficiary
  • sex: gender of the primary beneficiary (male or female)
  • bmi: body mass index of the primary beneficiary
  • children: number of children covered by the insurance plan
  • smoker: whether the primary beneficiary is a smoker or not (yes or no)
  • region: the beneficiary's residential area in the US (northeast, northwest, southeast, southwest)
  • charges: individual medical costs billed by health insurance

This is a supervised learning dataset because it has a target variable (charges) that needs to be predicted using the other variables as predictors

2. Estimate the minimum sample size n to get the 99% accurate predictions. (precision = 0.02)

Ans.

Therefore, the minimum sample size required to get 99% accurate predictions with a precision of 0.02 is 505

3. Check the data is cleaned or not. If not then clean it (Null values, Row/Column Duplicates, Outliers, Change the string into numbers)

Ans.

Check for null values: There are no null values in the dataset

Check for duplicates: There is only one duplicate row and it was deleted from the dataset.

Check for outliers: There are some outliers they were removed

Change the string into numbers : 'smoker','sex','region' columns are converted

4. Check that sex and smoking are statistically independent or not.

Ans.

The two variables are dependent.

5. Check that all regressor variables (independent variable) are independent of each other or not

6. Check the dependency between response and regressors.

7. Predict the regression Line to predict the charges for insurance using independent variables.

Ans.

So the regression line is:
charges = (255.206) * age + (-102.617) * sex + (316.841) * bmi + (504.761) * children + (23259.551) * smoker + (264.395) * region

8. Predict the accuracy of the regression Model.

Ans.

R-squared score: 0.7270533980679406

9. Predict insurance charge for Age = 29, Sex = F, bmi = 28, children = 1, Smoke = Yes, region = southeast.

Ans.

The insurance charge for Age = 29, Sex = F, bmi = 28, children = 1, Smoke = Yes, region = southeast is [28080.10896832]

10. Give the percentage of error in regression model.

Ans.

Root Mean Squared Error: 6169.209728918002
Percentage Error: 45.46161576213809

11. Give the 95% confidence interval for average charge insurance.

Ans.

The 95% confidence interval for the average insurance charges is: (12416.00,13674.69)

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.