% LMcs090502_4th.m
% Larsen & Marx (2006,p. 585) Introduction to Mathematical Statistics, 4th
% Edition. Case Study 9.5.1 An example of CI's for a ratio of variances
% Examples of two sample tests
% Written by Eugene.Gallagher@umb.edu 11/14/10, revised 11/17/10
X=[0.73 0.76 0.75 0.77 0.73 0.75 0.74]';
Y=[0.72 0.74 0.74 0.72 0.72]';
boxplot([Y;X],[ones(length(Y),1);zeros(length(X),1)],...
    'labels',{'Three-Year','Five-Year'});figure(gcf)
[H,P,CI,STATS] = vartest2(X,Y,0.05,'both')
fprintf('The variances were %7.5f %7.5f with ratio %6.4f\n',...
    var(X),var(Y),var(X)/var(Y))
fprintf('The 95%% CI for the observed ratio is [%6.4f %6.4f]\n',CI);
fprintf(...
'Prob of F >= %6.4f with %2.0f, %2.0f df is %6.4f\n',STATS.fstat,...
STATS.df1,STATS.df2,P)