Model Assessment

  1. Load the James Bond data set
library(jroreillyregression)
data(bond)
head(bond)
  1. Create a trainControl object to set up for cross validation estimates of test error of a model
library(caret)
tc = trainControl(method = "cv", number = 10)
  1. Train a model using Alcohol_Units and Relationships to predict number of kills using the train function from caret to estimate test error
m = train(Kills~Alcohol_Units + Relationships, data = bond, method = "lm")
  1. Fit a new model that also includes Nationality as a predictor. Does this improve the predictive ability of the model?

  2. If you have time, create bootstrapped estimates of the regression coefficients to determine the variance of them.



jr-packages/jroreillyregression documentation built on Dec. 23, 2019, 8:20 p.m.