R Tutorial : Basic 2 variable Linear Regression

In this tutorial we will try our hands on a very basic 2 variable linear regression using R. We will also learn how to interpret output given by R and tryout various visualizations required for interpreting simple Linear regression.

Please also read though following Tutorials to get more familiarity on R and Linear regression background.

Step 5 : Interpretation of output

The Model that is generated for us is ( Numbers in RED are coefficients of variables in our Linear regression equation )

SAVINGS = -10990 + 0.297 * INCOME

Please notice that the p-value for INCOME ( values in GREEN) i.e Pr(>|t|) is significant ( i.e less than 0.05 ) and hence the variable is significant in predicting the SAVINGS. If we do not have significant p-value corresponding to the variable we may choose to ignore that variable.

Next number that we have to be aware of is R-squared . In our case Adj R Squared is 0.9915 which implies that the model is able to explain 99% variation in our data . The ideal R-squared value is domain specific. But typically anything above 70% is assumed to be very good and the model is supposed to be a good model for prediction.

We will delve into details of R Squared , t value , residuals and F statistic in subsequent tutorial. For this discussion we can safely ignore them.

The model can be interpreted as – ” When Income rises by 1 unit , the Savings rise by 0.297 units”

Now whenever we have any value of INCOME we can calculate SAVINGS using the equation –

SAVINGS = -10990 + 0.297 * INCOME

I sincerely hope you enjoyed the tutorial , please post your feedback and comments and share other articles on the site.