Question: Part 2 : use the program R The dataset insurance prediction comes from the public domain. While the cost of treatment depends on tons of

Part 2: use the program R
The dataset insurance prediction comes from the public domain. While the cost of treatment depends on tons of factors, including diagnostics, age, genetic factors, getting all relevant factors could be a complex task. Here, the insurance company collected information on several factors that could help them explore factors responsible for an individuals medical costs billed by an insurance company. The dataset has the following variables (6 pts).
CHARGES: Individual medical costs billed by health insurance
SMOKER: A binary variable (Smoking/ Non-smoking)
REGION: The insured residential area in the USA (northeast, southeast, southwest, northwest);
AGE: age of primary insured
SEX: female or male
BMI: body mass index
CHILDREN: Number of children covered by health insurance.
Tasks are as follows. Please provide codes for each question:
1.Check if there are any "NA" and/or duplicate observation/row. Ensure to tell number of duplicate observations.
2.Summarize the data and provide descriptive statistics.
3.Create two datasets (80:20 split, name train and test, respectively). In the train dataset, estimate a linear regression model with Charges as the dependent variable (DV), and rest as independent variables. Interpret the results.
4.Estimate another model by dropping the insignificant variables from the model in Q7. Compare the performance (using R-sq, Adj, R-sq, AIC, RMSE) of the models in Q7 and Q8.
5.Check for the accuracy of the model in Q8 using QQ plot and fitted vs. residual graph. Note your observations.
6.Estimate a model with log-transformed CHARGES as DV, and age, bmi, smoker, children, smoker, region as independent variables. Compare the performance of the models from Q7, Q8, and Q10.
7.Are there any non-linear effects of Age and BMI on charges? Compute and Show

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!