The given data is:
x = {0.04, 0.06, 0.04, 0.08, 0.08, 0.05, 0.05, 0.07, 0.07, 0.06};
y = {0.25, 0.4, 0.22, 0.54, 0.51, 0.34, 0.36, 0.46, 0.42, 0.4};
Is there a quicker method to calculate the coefficient of determination for this dataset? The approach I used involved step-by-step computation using the formula for the coefficient of determination.
x = {0.04, 0.06, 0.04, 0.08, 0.08, 0.05, 0.05, 0.07, 0.07, 0.06};
y = {0.25, 0.4, 0.22, 0.54, 0.51, 0.34, 0.36, 0.46, 0.42, 0.4};
data = Thread@{x, y};
meanY = Mean[y];
SST = Total[(y - meanY)^2];
lm = LinearModelFit[data, t, t]
residuals = lm["FitResiduals"]
SSE = Total[residuals^2]
rSquared = 1 - SSE/SST
lm["RSquared"]
? $\endgroup$Correlation[x, y]^2
. For linear models with more than one predictor use @ydd 's suggestion. $\endgroup$