G 't Lam's test for variance outliers.
Updated 22 Aug 2015

View License

Returns the final table resulting of a process that in the repeated cycles identifies and removes variance outliers. Before excluding a standard deviation from the calculation of the pooled repeatability standard deviation, a deviant is decided by a hypothesis testing.
In 1941, William G. Cochran presented a one-sided upper limit variance outlier test to check homoscedasticity. The called C test is used to decide if a single variance estimation is significantly larger than a group of variances and accounts for all variances within the range.
However, as 't Lam (2010) pointed out, the C test has limitations. It only applies to data sets of equal size. It uses critical values that are only available for the upper tail of the variance distribution, at selected numbers of data sets, selected numbers of replicates per set and only at two significance levels. Also, it will not identify an outlying low variance, but may mistake a high variance for an outlier instead. 't Lam (2010) transforms the C test into a more general 'G test'. It allows us to calculate upper limit as well as lower limit critical values for data sets of equal and unequal size at any significance level. The G test appears superior to the C test in detecting effects from low variances. The G test allows positive identification of exceptionally low variances.
Another great utility of this m-function is that not only by using the one-sided option one can found the classical alpha-value 0.01 and 0.05 upper Cochran's C critical values, but also for any other alpha-value or degrees of freedom.

Here a m-file analytical procedure is developed as an alternative to the homogeinity of variances test.

*It calls the m-file gtlaminv [Inverse of the G 't Lam's one and two-sided cumulative distribution function (cdf)] you must downloading from the MCFEX:

Syntax: function x = gtlamtest(x,alpha,type)
X - kx2 matrix data (k samples; column 1-sample size, column 2-variance
alpha - significance value
Type – 1 (=one lower-sided test), 2 [=two sides (by default)], 3 (=one upper-sided test)
Complete table of the realized hypothesis test

Cite As

Antonio Trujillo-Ortiz (2024). gtlamtest (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Text was improved
An output text was improved.

Code was updated.
Text was improved.
It was added an appropriate format to cite this file.
Code and text were improved.
Text was improved.