% LMcs010202_4th.m
% p 13-15 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Written by E. Gallagher 9/16/2010
% Revised 3/18/2011
% Note that these data are used in problem 14.2.6 (p 810 as an application)
% of the sign test
DATA=[0.693 0.749 0.654 0.670
      0.662 0.672 0.615 0.606
      0.690 0.628 0.668 0.611
      0.606 0.609 0.601 0.553
      0.570 0.844 0.576 0.933];
DATA=DATA(:);
mn=mean(DATA)
expected=0.5*(5.^0.5-1)
hist(DATA);
xlabel('Width-to-Length Ratio of Shoshoni Rectangles')
ylabel('Frequency')
% plot a vertical line to the top of the graph
% to margins of the graph are contained in axis
v=axis;
ax1=gca; % get the identifier for the current graph, a histogram
h1=line([expected expected]',[0 v(4);]','Parent',gca);
set(h1,'linestyle','-.','color','r','linewidth',3)
h2=line([mn mn]',[0 v(4);]','Parent',gca);
set(h2,'linestyle','--','color','m','linewidth',3)
legend('Observed','Expected','Mean')
title('Case Study 1.2.2','FontSize',22)
figure(gcf)
pause
 

