Perform Bartlett's test for equality of variances
performBartlettTest.RdUses bartlett.test on model residuals grouped by a factor.
Details
The test statistic compares the pooled variance to the individual group variances. It is computed as \(\chi^2 = (N - k) \ln S_p^2 - \sum (n_i - 1) \ln s_i^2\), where \(S_p^2\) is the pooled variance and \(s_i^2\) the group variances. Under the null it approximates a chi-square distribution with \(k-1\) degrees of freedom.
Value
An object of class htest containing the chi-squared statistic, p-value and degrees of freedom.
References
Bartlett, M. S. (1937). Properties of sufficiency and statistical tests. Proceedings of the Royal Society of London, 160(901), 268–282. doi:10.1098/rspa.1937.0109
Hartley, H. O. (1950). The maximum F-ratio as a short-cut test for heterogeneity of variance. Biometrika, 37(3/4), 308–312. doi:10.2307/2332383