-
Notifications
You must be signed in to change notification settings - Fork 84
Description
Hello! In the online version of the book published on O'Reilly's website this paragraph is outlining predicted expenses for the linear regression model to estimate insurance expenses when driving miles increases by 10000 additional miles. This is the paragraph:
"This illustrates the more general fact that the predicted expenses are a sum of each of the regression coefficients times their corresponding value in the prediction data frame. For instance, using the model’s regression coefficient of 0.118748 for the miles driven, we can predict that adding 10,000 additional miles will result in an increase in expenses of 10,000 * 0.118748 = 1187.48, which can be confirmed as follows:"
However - the code below is not changed to indicate the 10000 additional miles:
predict(ins_model2,
data.frame(age = 30, age2 = 30^2, geo_area = "rural",
vehicle_type = "truck", est_value = 25000,
miles_driven = 14000, college_grad_ind = 0,
speeding_ticket_ind = 0, hard_braking_ind = 0,
late_driving_ind = 0, clean_driving_ind = 0))
The github page that is listed under 'Chapter 6' for this exercise is correct,