n statistics, the coefficient of determination, denoted R2 and pronounced R squared, indicates how well data points fits a statistical model – sometimes simply a line or curve. It is a statistic used in the context of statistical models whose main purpose is either the prediction of future outcomes or the testing of hypotheses, on the basis of other related information. It provides a measure of how well observed outcomes are replicated by the model, as the proportion of total variation of outcomes explained by the model.[1]
There are several different definitions of R2 which are only sometimes equivalent. One class of such cases includes that of simple linear regression. In this case, if an intercept is included then R2 is simply the square of the sample correlation coefficient between the outcomes and their predicted values; in the case of simple linear regression, it is the square of the correlation between the outcomes and the values of the single regressor being used for prediction. If an intercept is included and the number of explanators is more than one, R2 is the square of the coefficient of multiple correlation. In such cases, the coefficient of determination ranges from 0 to 1. Important cases where the computational definition of R2 can yield negative values, depending on the definition used, arise where the predictions which are being compared to the corresponding outcomes have not been derived from a model-fitting procedure using those data, and where linear regression is conducted without including an intercept. Additionally, negative values of R2 may occur when fitting non-linear functions to data.[2] In cases where negative values arise, the mean of the data provides a better fit to the outcomes than do the fitted function values, according to this particular criterion.[3]