R-squared computation in R

How could we compute this in R?

Well, to be honest, you are probably not going to compute it by yourself for the models you will estimate, since the basic lm() function already computes this summary statistic for you. All you have to remember is how to retrieve it when you need it. Two main possible ways arise, you are able to:

  • Retireve it through the summary function
  • Retrieve it as a component of the object resulting from the application of the lm function or the other available regression functions

Let's try both on our multiple_regression_new object:

multiple_regression_new %>% summary()

Can you spot in the output our R-squared? You should actually find two of them in your output, the multiple R-squared and the adjusted R-squared. We are going to look at the difference between them in a second; for now let's just take note of their value and think about them:

Multiple R-squared: 0.08393, adjusted R-squared: 0.08297

Once again, we find that our model is able to explain little about the observed default events since our R-squared is just equal to a very low 8%. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset