dcsimg
 

Why Is There No R-Squared for Nonlinear Regression?

Plot of nonlinear regression modelNonlinear regression is a very powerful analysis that can fit virtually any curve. However, it's not possible to calculate a valid R-squared for nonlinear regression. This topic gets complicated because, while Minitab statistical software doesn’t calculate R-squared for nonlinear regression, some other packages do.

So, what’s going on?

Minitab doesn't calculate R-squared for nonlinear models because the research literature shows that it is an invalid goodness-of-fit statistic for this type of model. There are bad consequences if you use it in this context.

Why Is It Impossible to Calculate a Valid R-squared for Nonlinear Regression?

R-squared is based on the underlying assumption that you are fitting a linear model. If you aren’t fitting a linear model, you shouldn’t use it. The reason why is actually very easy to understand.

For linear models, the sums of the squared errors always add up in a specific manner: SS Regression + SS Error = SS Total.

This seems quite logical. The variance that the regression model accounts for plus the error variance adds up to equal the total variance. Further, R-squared equals SS Regression / SS Total, which mathematically must produce a value between 0 and 100%.

In nonlinear regression, SS Regression + SS Error do not equal SS Total! This completely invalidates R-squared for nonlinear models, and it no longer has to be between 0 and 100%.

What is the difference between linear and nonlinear regression equations?

Why Shouldn't You Use R-squared to Evaluate the Fit of Nonlinear Models?

As you can see, the underlying assumptions for R-squared aren’t true for nonlinear regression. Yet, most statistical software packages still calculate R-squared for nonlinear regression. Calculating this statistic in this context is a dubious practice that produces bad outcomes.

Spiess and Neumeyer* performed thousands of simulations for their study that show how using R-squared to evaluate the fit of nonlinear models leads you to incorrect conclusions. You don't want this!

That's why Minitab doesn't offer R-squared for nonlinear regression.

Specifically, this study found the following about using R-squared with nonlinear regression:

  • R-squared tends to be uniformly high for both very bad and very good models.
  • R-squared and adjusted R-squared do not always increase for better nonlinear models.
  • Using R-squared and adjusted R-squared to choose the final model led to the correct model only 28-43% of the time.

Clearly, using R-squared to evaluate and choose a nonlinear model is a bad idea. Additionally, the authors lament the persistence of this practice in some fields of study:

In the field of biochemical and pharmacological literature there is a reasonably high occurrence in the use of R2 as the basis of arguing against or in favor of a certain model. . . . Additionally, almost all of the commercially available statistical software packages calculate R2 values for nonlinear fits, which is bound to unintentionally corroborate its frequent use. . . . As a result from this work, we would like to advocate that R2 should not be reported or demanded in pharmacological and biochemical literature when discussing nonlinear data analysis.
  

If you're already using Minitab, great. However, if you use statistical software that calculates R-squared for nonlinear regression, don’t trust that statistic!

Instead, compare the standard error of the regression (S), and go with the smaller values.

Learn why there are no P values for the variables in nonlinear regression!

________________________________

Spiess, Andrej-Nikolai, Natalie Neumeyer. An evaluation of R2 as an inadequate measure for nonlinear models in pharmacological and biochemical research: a Monte Carlo approach. BMC Pharmacology. 2010; 10: 6.

Comments

Name: Alex • Tuesday, March 11, 2014

"If you use statistical software that calculates R-squared for nonlinear regression, don’t trust that statistic!"
Should I trust MINITAB16, if Assistant for Regression can make me Linear, Nonlinear models using R squared?
That is why I prefer free R, where I can find cool tool for any tough problem. Best wishes, guys!


Name: Eston • Thursday, March 13, 2014

Thanks for the comment, Alex. Jim, who wrote this post, may weigh in as well. You may be conflating nonlinear regression with the Assistant's ability to create linear regression models that include quadratic terms. They are not the same, and the Assistant does not perform the nonlinear regression Jim discusses in his post. We hope you get good results with whatever tools you use, Alex!


Name: Jim Frost • Sunday, March 16, 2014

Hi Alex, Eston is correct. What you're referring to is a linear model that uses polynomial terms to fit a curve. R-squared is valid for this type of model.

The Assistant in Minitab 16 and 17 does not perform nonlinear regression.

Thanks for reading!
Jim


Name: Jack Tanner • Friday, March 21, 2014

I don't know much about nonlinear regression. Could you explain why "in nonlinear regression, SS Regression + SS Error do not equal SS Total"?

Also, is it still inappropriate to calculate R^2 for nonlinear regression if one uses these alternative definitions:

a. R^2 = 1 - (SS res / SS tot)

b. Nagelkerke (1991) generalized R^2


blog comments powered by Disqus