% LMcs100403_4th.m
% Written by Eugene.Gallagher@umb.edu 11/21/10
DATA=[7.2 6.2 3.0 2.7 2.8 -2.7 2.4
6.8 3.6 9.2 -1.2 -0.2 -6.4 -0.8
-0.8 -14.8 -13.4 -13.6 14.1 2.6 -10.8
-2.1 15.4 -2.1 8.6 -5.4 5.3 10.2
3.1 -8.6 -0.4 2.6 1.6 9.3 -1.5
4.5 6.9 5.2 4.4 -4.0 5.5 -0.6
-3.1 -4.4 -0.9 -3.8 -1.5 -0.7 9.5
2.0 -0.3 6.8 -1.1 -4.2 4.6 4.5
2.7 4.0 -1.2 -5.0 -0.6 4.1 0.2
8.0 -2.2 -3.0 -2.8 -5.6 -0.9 4.6
13.6 -1.2 7.5 7.9 4.9 10.1 -3.5
6.7 2.1 -1.4 9.7 8.2 3.3 2.4];
DATA=DATA(:);[MUHAT,SIGMAHAT,MUCI,SIGMACI] = normfit(DATA,0.05)
[h,p,stats] = chi2gof(DATA)
df=length(stats.E)-1-2
histfit(DATA);figure(gcf)
criticalval=chi2inv(1-alpha,df);
fprintf('The critical value for alpha=%4.2f is %5.3f\n',alpha,criticalval)