MATLAB: How is the adjusted R-square statistic computed by the REGSTATS function in the Statistics Toolbox

adjustedequationformular squareregstatsstatisticsStatistics and Machine Learning Toolboxtoolbox

According to the R14SP3 documentation for the REGSTATS function, the adjusted R-square statistic is computed from the R-square statistic using the formula:
adjrsquare = 1 - (1-rsquare)*(n/(n-p))
In fact, the code for the REGSTATS function computes the adjusted R-square statistic from the R-square statistic using the formula:
adjrsquare = 1 - (1-rsquare)*((n-1)/(n-p))

Best Answer

This is an error in the documentation.
The REGSTATS function in R14SP3 uses the ratio (n-1)/(n-p) to compute the adjusted R-square statistic, not the ratio n/(n-p) given in the documentation. Previous versions of the REGSTATS function did use the ratio n/(n-p), as documented. The documentation was not updated for R14SP3.
The documentation was updated for R2006a.