The coefficient of determination, R squared, is used in linear regression theory in statistics as a measure of how well the regression equation fits the data. It is the square of R, the correlation coefficient, that provides us with the degree of correlation between the dependent variable, Y, and the independent variable X. R ranges from -1 to +1. If R equals +1, then Y is perfectly proportional to X, if the value of X increases by a certain degree, then the value of Y increases by the same degree. If R equals -1, then there is a perfect negative correlation between Y and X. If X increases, then Y will decrease by the same proportion. On the other hand if R=0, then there is no linear relationship between X and Y. R squared varies from 0 to 1. This gives us an idea of how well our regression equation fits the data. If R squared equals 1, then our best fit line passes through all the points in the data, and all of the variation in the observed values of Y is explained by its relationship with the values of X. For example if we get an R squared value of .80 then 80% of the variation in the values of Y is explained by its linear relationship with the observed values of X.
Calculate the sum of the products of the values of X and Y, and multiply this by \"n.\" Subtract this value from the product of the sums of the values of X and Y. Denoting this value by S1: S1 = n(?XY) - (?X)(?Y)
Calculate the sum of the squares of the values of X, multiply this by \"n,\" and subtract this value from the square of the sum of the values of X. Denote this by P1: P1 = n(?X2) – (?X)2 Take the square root of P1, which we will denote by P1’.
Calculate the sum of the squares of the values of Y, multiply this by \"n,\" and subtract this value from the square of the sum of the values of Y. Denote this by Q1: Q1 = n(?Y2) – (?Y)2 Take the square root of Q1, which we will denote by Q1’
Calculate R, the correlation coefficient, by dividing S1 by the product of P1’ and Q1’: R = S1 / (P1’ * Q1’)
Take the square of R to obtain R2, the coefficient of determination.