i

R Programming Complete Tutorial

Model Interpretation

We have already generated a model using three predictors and one target variable. This summary function will provide us detail statistical information.

First, we will examine F-statistics and the associated p-value of this specific model. Our p-value is extremely small, which is highly significant. This means that at least one of the predictors is significantly related to the target.

Now we will check the predictors individually. For a given predictor, the t-statistics evaluates whether or not there is a significant association between the predictor and the target. In this example, t-statistics is high for youtube and facebook, and the associated p-value is less than the significance level, so they are our important predictors. As the newspaper variable is not significant, it is possible to remove it from our model.

The overall quality of the model can be accessed by examining the R2and Residual Standard Error. In our case, R2 is .8956, meaning that more than 89% of the variance can be predicted by our predictors. RSE is 2.02, and the mean of sales is 16.827. We can calculate the error rate, dividing RSE by means of sales, and the result is around 12%.