Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Regression with categorical predictors The insurance.csv data base contains insurance information for 1338 people. The columns report the age, sex, BMI, number of children, smoker
Regression with categorical predictors The insurance.csv data base contains insurance information for 1338 people. The columns report the age, sex, BMI, number of children, smoker status, and geographical region of each individual, as well as the insurance charges. Load the data set into a data frame. Recode the categorical variable smoker into a dummy variable, smoke. Use the ols function to perform a multiple regression with charges as the response variable and age, bmi, and smoke, in that order, as the predictor variables Create an analysis of variance table using the results of the multiple regression. If the number of children is used instead of BMI, the output is: sum_sq df F PR(>F) age 1.963476e+10 1.0 483.557436 1.062319e-91 children 4.592837e+08 1.0 11.311064 7.923099e-04 smoker_yes 1.237765e+11 1.0 3048.320439 0.000000e+00 Residual 5.416683e+10 1334.0 NaN NaN
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started