X=[1.7 1.6 2.8 5.6 1.3 2.2 1.3 1.1 3.2 1.5 5.2 4.6 5.8 3.0]
Y=[3.7 3.9 6.7 9.5 3.4 5.6 3.7 2.7 5.5 2.9 10.7 7.6 11.8 4.1]
Using Matlab/Octave we can calculate Coefficient of correlation (r) and Coefficient of determination (r2) in a following way:
c=corrcoef([X' Y']);
r=c(1,2);
r2=r^2;
In our example we get r=0.95088 and r2=0.90418.
Now what does it mean? Coefficient of determination measures the proportion of variation in Y that is explained by the X. In other words, we can say that 90.4% of the change in Y can be explained by the change in X. In our case we can conclude that 90.4% of change in annual sales is explained by the change in store size. The rest (9.6%) depends on the other factors like localization, staff, management, etc.
Bellow scatter plot of X and Y:
The above scatter plot can be generated in Matlab/Octave by:
figure;
plot(X,Y,'+r');
title('Scatter plot');