Regression analysis

To do this part of the process, we will repeat the steps and code from Chapter 2, Linear Regression - The Blocking and Tackling of Machine Learning. If you haven't done so, please look at Chapter 2, Linear Regression - The Blocking and Tackling of Machine Learning for some insight on how to interpret the following output.

We will use the following lm() function to create our linear model with all the factors as inputs and then summarize the results:

    > nhl.lm <- lm(ppg ~ ., data = pca.scores)    > summary(nhl.lm)    Call:    lm(formula = ppg ~ ., data = pca.scores)    Residuals:          Min        1Q   Median       3Q      Max     -0.163274 -0.048189 0.003718 0.038723 0.165905     Coefficients:          Estimate       Std. Error t value Pr(>|t|)  (Intercept) 1.111333 0.015752 70.551 ...

Get Mastering Machine Learning with R - Second Edition 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.