5%LMcs110402_4th.m
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Page 712
% Written by Eugene.Gallagher@umb.edu
X=[3508.9 5283.1 7557.1 11032.8 16009.5 24134.4 33785.7 44e3]';
Y=[12400 13500 13900 14300 14600 15300 16200 18000]';
plot(X,Y,'ok');xlabel('CellSubs','FontSize',16);
ylabel('Law$Rev','FontSize',16),Title('Figure 11.4.2','FontSize',20)
lsline
axis([-10 46000 11700 19100])
figure(gcf)
corrcoef(X,Y)
[r,c]=size(X)
[B,BINT,R,RINT,STATS] = regress(Y,[ones(r,1) X]);
fprintf('\nThe R^2 = %5.1f%%\n',STATS(1)*100)