I am not sure if this is the right site, I hope so! But it is half coding half econometric so I guess the answer can only be given from finance professional.

In matlab it is possible to run robust regressions by putting the option 'RobustOpts','on' in fitlm.

In the output there is also the $R^2$ and adjusted-$R^2$. However, my question is: $R^2$ is a typical concept of min squared residuals, does this apply to robust regressions?

And what is exactly the $R^2$ in that specific context?

  • 2
    $\begingroup$ I'm voting to close this question as off-topic because it belongs on "Cross Validated. $\endgroup$ Jan 10, 2017 at 19:46
  • $\begingroup$ Probably you have not read my first line of considerations, in any case - more or less - I have an idea of the answer so if you think this question is to close you can vote for closing it, nothing changes for me $\endgroup$
    – Klapaucius
    Jan 11, 2017 at 12:58
  • $\begingroup$ The idea is to migrate it to a proper place, not to hinder you in asking statistical questions. Your question is a valuable contribution (as evidenced by upvotes), but it is misplaced – that's it. $\endgroup$ Jan 11, 2017 at 16:20

2 Answers 2


$R^{2}$ is a measure of goodness of fit. You can calculate it regardless of the type of linear regression model.

However, it may not always have value. For instance, if you have an extreme outlier in your data, then a classic $R^{2}$ will typically be lower than you expect (because there is variation in the data that your model is not picking up).

Alternately, you can calculate a weighted $R^{2}$ based on how the robust regression is performed. Assuming Matlab chooses weights to effectively ignore the outlier and treat the other data the same, then a weighted $R^{2}$ would be higher. That being said, I don't know if that's how Matlab calculates it or not. It would be simple enough to verify.

You might also find the discussion here informative (and how to calculated weighted $R^{2}$).

  • $\begingroup$ Not 100% correct. Logistic regression doesn't have R2. $\endgroup$
    – SmallChess
    Jan 10, 2017 at 0:32
  • $\begingroup$ @StudentT I consider that a nitpick, but I've made an edit to address it. Most people use a pseudo R2 in a logistic regression. Some of the formula look a lot like R2, even if it's not exactly the same formula. $\endgroup$
    – John
    Jan 10, 2017 at 1:10
  • $\begingroup$ I think an outlier can not only decrease but also increase $R^2$ in general. $\endgroup$ Jan 10, 2017 at 19:47
  • $\begingroup$ @RichardHardy Removing an outlier typically leads to an increase in $R^{2}$. I suppose in general it is possible for it to lead to a decrease. I will edit. $\endgroup$
    – John
    Jan 10, 2017 at 20:44

R-squared is a statistical measure of how close the data are to the fitted regression line. It is also known as the coefficient of determination, or the coefficient of multiple determination for multiple regression.

It is also a statistical tool which measures the goodness of fit for a linear model.

R2=1−SSE/SST, where SSE is the sum of squared error (residuals or deviations from the regression line) and SST is the sum of squared deviations from the dependent's Y mean.

And yes you may apply it to robust regression but there are limitations to it as it doesn't indicate whether a regression model is adequate. You can have a low R-squared value for a good model, or a high R-squared value for a model that does not fit the data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.