Calculating the r-squared
The r-squared is the coefficient of determination that was calculated earlier. It tells us the factor of separation between the Y value (miles per gallon) of the dataset (the blue dots) and Y' (miles per gallon calculated by the model – the gray line) from the average of Y (the red line) as an origin line. Consult the chart to understand this relationship.
This is the explained variation (SSR) divided by the total variation (SST):
The coefficient of determination
The coefficient of determination is one of the indicators of the relationship strength between the variables:
r2 = Explained Variation Regression Sum of Squares SSR divided by Total Variation Sum of Squares SST
For our example, we calculated these variations: