Step 2: Creating the model on the training data

Like we did earlier in this chapter, we can use the R function lm to create our regression model with ourtrainingData chunk:

# --- Build the model on training data  
lmMod <- lm(ProjectManagement ~ Profit, data=trainingData)  

Get Statistics for Data Science now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.