16 Multiple regression & model fitting

16.1 MLR

This is very similar to simple regression, but you can add in extra predictors:

For example, this will predict sepal length, using TWO predictors (width and petal length). See the MLR lecture for interpretation.

MLRmodel <- lm(Sepal.Length ~ Sepal.Width + Petal.Length ,data=iris)

ols_regress(MLRmodel)
##                          Model Summary                          
## ---------------------------------------------------------------
## R                       0.917       RMSE                 0.330 
## R-Squared               0.840       MSE                  0.111 
## Adj. R-Squared          0.838       Coef. Var            5.704 
## Pred R-Squared          0.834       AIC                101.025 
## MAE                     0.266       SBC                113.068 
## ---------------------------------------------------------------
##  RMSE: Root Mean Square Error 
##  MSE: Mean Square Error 
##  MAE: Mean Absolute Error 
##  AIC: Akaike Information Criteria 
##  SBC: Schwarz Bayesian Criteria 
## 
##                                 ANOVA                                 
## ---------------------------------------------------------------------
##                Sum of                                                
##               Squares         DF    Mean Square       F         Sig. 
## ---------------------------------------------------------------------
## Regression     85.840          2         42.920    386.386    0.0000 
## Residual       16.329        147          0.111                      
## Total         102.168        149                                     
## ---------------------------------------------------------------------
## 
##                                  Parameter Estimates                                   
## --------------------------------------------------------------------------------------
##        model     Beta    Std. Error    Std. Beta      t        Sig     lower    upper 
## --------------------------------------------------------------------------------------
##  (Intercept)    2.249         0.248                  9.070    0.000    1.759    2.739 
##  Sepal.Width    0.596         0.069        0.313     8.590    0.000    0.459    0.733 
## Petal.Length    0.472         0.017        1.006    27.569    0.000    0.438    0.506 
## --------------------------------------------------------------------------------------