Computes the O’Brien transform on input data (any number of arrays).
Used to test for homogeneity of variance prior to running one-way stats. Each array in *args is one level of a factor. If f_oneway is run on the transformed data and found significant, the variances are unequal. From Maxwell and Delaney [R255], p.112.
Parameters: | args : tuple of array_like
|
---|---|
Returns: | obrientransform : ndarray
|
References
[R255] | (1, 2) S. E. Maxwell and H. D. Delaney, “Designing Experiments and Analyzing Data: A Model Comparison Perspective”, Wadsworth, 1990. |
Examples
We’ll test the following data sets for differences in their variance.
>>> x = [10, 11, 13, 9, 7, 12, 12, 9, 10]
>>> y = [13, 21, 5, 10, 8, 14, 10, 12, 7, 15]
Apply the O’Brien transform to the data.
>>> tx, ty = obrientransform(x, y)
Use scipy.stats.f_oneway to apply a one-way ANOVA test to the transformed data.
>>> from scipy.stats import f_oneway
>>> F, p = f_oneway(tx, ty)
>>> p
0.1314139477040335
If we require that p < 0.05 for significance, we cannot conclude that the variances are different.