


LEVENETEST(X,alpha,display) runs Levene's Test for Homogeneity of Variance.
ARGUMENTS
X ... data matrix (Size of matrix must be n-by-2; data=column 1, sample=column 2).
alpha ... significance level (default = 0.05).
display ... choice to display results in command window. Default 'off'
RETURNS
P ... Probability associated with F-statistic
NOTES
- In the Levene's test the data are transforming to yij = abs[xij - mean(xj)]
and uses the F distribution performing an one-way ANOVA using y as the
dependent variable (Brownlee, 1965; Miller, 1986)].
Example: From the example 10.1 of Zar (1999, p.180), to test the Levene's
homoscedasticity of data with a significance level = 0.05.
Diet
---------------------------------
1 2 3 4
---------------------------------
60.8 68.7 102.6 87.9
57.0 67.7 102.1 84.2
65.0 74.0 100.2 83.1
58.6 66.3 96.5 85.7
61.7 69.8 90.3
---------------------------------
Data matrix must be:
X=[60.8 1;57.0 1;65.0 1;58.6 1;61.7 1;68.7 2;67.7 2;74.0 2;66.3 2;69.8 2;
102.6 3;102.1 3;100.2 3;96.5 3;87.9 4;84.2 4;83.1 4;85.7 4;90.3 4];
Calling on Matlab the function:
alpha = 0.01;
display = 'on';
Levenetest(X,alpha,display)
Answer is:
The number of samples are: 4
----------------------------
Sample Size Variance
----------------------------
1 5 9.3920
2 5 8.5650
3 4 7.6567
4 5 8.3880
----------------------------
Levene's Test for Equality of Variances F=0.0335, df1= 3, df2=15
Probability associated to the F statistic = 0.9914
The associated probability for the F test is larger than 0.05
So, the assumption of homoscedasticity was met.