%BENKA LAKE GARDEN BAY LAKE BIG LAKE
clear all
close all
disp('Dorsal Spines')
set(0, 'DefaultAxesFontSize', 16);
lw =2.5; fs = 16; msize = 10;
stickleback =[...
4.2 4.4 4.9; ...
4.1 4.6 4.6; ...
4.2 4.5 4.3; ...
4.3 4.2 4.9; ...
4.5 4.4 4.7; ...
4.4 4.2 4.4; ...
4.5 4.5 4.5; ...
4.3 4.7 4.4 ];
lakes = [1 1 1 1 1 1 1 1 ...
2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3];
[p table stats] = anova1(stickleback(:), lakes(:))
% p = 0.0267
%
%
% table =
%
% 'Source' 'SS' 'df' 'MS' 'F' 'Prob>F'
% 'Groups' [0.3033] [ 2] [0.1517] [4.3260] [0.0267]
% 'Error' [0.7363] [21] [0.0351] [] []
% 'Total' [1.0396] [23] [] [] []
%
%
% stats =
% gnames: {3x1 cell}
% n: [8 8 8]
% source: 'anova1'
% means: [4.3125 4.4375 4.5875]
% df: 21
% s: 0.1872
% (a) Hypothesis $H_0$ stating that the mean lengths of dorsal spines are the same for the three lakes
% is rejected at the level $\alpha = 0.05$ since the $p$-value is 0.0267.
%
% (b) If the significance level was $\alpha = 0.01$ the hypothesis $H_0$ would not be rejected.