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 : 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 pts
CHARGES: Individual medical costs billed by health insurance
SMOKER: A binary variable Smoking Nonsmoking
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:
Check if there are any NA andor duplicate observationrow Ensure to tell number of duplicate observations.
Summarize the data and provide descriptive statistics.
Create two datasets : 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.
Estimate another model by dropping the insignificant variables from the model in Q Compare the performance using Rsq Adj, Rsq AIC, RMSE of the models in Q and Q
Check for the accuracy of the model in Q using QQ plot and fitted vs residual graph. Note your observations.
Estimate a model with logtransformed CHARGES as DV and age, bmi, smoker, children, smoker, region as independent variables. Compare the performance of the models from Q Q and Q
Are there any nonlinear 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
