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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.