The function performs a test for a monotonic trend in variances. The test statistic suggested by Neuhauser and Hothorn (2000) is based on the classical Levene procedure (using the group means), the modified Brown-Forsythe Levene-type procedure (using the group medians) or the modified Levene-type procedure (using the group trimmed means). More robust versions of the test using the correction factor or structural zero removal method are also available. Two options for calculating critical values, namely, approximated and bootstrapped, are available. By default, NAs from the data are omitted. This function requires the mvtnorm package.

1 2 3 4 |

`y` |
a numeric vector of data values. |

`group` |
factor of the data. |

`location` |
the default option is "median" corresponding to the robust Brown-Forsythe Levene-type procedure; "mean" corresponds to the classical Levene's procedure, and "trim.mean" corresponds to the robust Levene-type procedure using the group trimmed means. |

`tail` |
the default option is "right", corresponding to an increasing trend in variances as the one-sided alternatives; "left" corresponds to a decreasing trend in variances, and "both" corresponds to any (increasing or decreasing) monotonic trend in variances as the two-sided alternatves. |

`trim.alpha` |
the fraction (0 to 0.5) of observations to be trimmed from each end of 'x' before the mean is computed. |

`bootstrap` |
the default option is FALSE, i.e., no bootstrap; if the option is set to TRUE, the function performs the bootstrap method described in Lim and Loh (1996) for Levene's test. |

`num.bootstrap` |
number of bootstrap samples to be drawn when the bootstrap option is set to TRUE; the default value is 1000. |

`correction.method` |
procedures to make the ltrend test more robust; the default option is "none"; "correction.factor" applies the correction factor described by O'Brien (1978) and Keyes and Levy (1997); "zero.removal" performs the structural zero removal method by Hines and Hines (2000); "zero.correction" performs a combination of O'Brien's correction factor and the Hines-Hines structural zero removal method (Noguchi and Gel, 2009); note that the options "zero.removal" and "zero.correction" are only applicable when the location is set to "median"; otherwise, "none" is applied. |

A list with the following numeric components.

`statistic` |
the value of the test statistic. |

`p.value` |
the p-value of the test. |

`method` |
type of test performed. |

`data.name` |
a character string giving the name of the data. |

`non.bootstrap.p.value` |
the p-value of the test without bootstrap method. |

Kimihiro Noguchi, Yulia R. Gel

Boos, D. D. and Brownie, C. (1989). *Bootstrap methods for testing homogeneity
of variances.* Technometrics 31, 69-82.

Brown, M. B. and Forsythe, A. B. (1974). *Robust tests for equality of
variances.* Journal of the American Statistical Association, 69, 364-367.

Hines, W. G. S. and Hines, R. J. O. (2000). *Increased power with modified forms of the
Levene (med) test for heterogeneity of variance*. Biometrics 56, 451-454.

Keyes, T. K. and Levy, M. S. (1997). *Analysis of Levenes test under design imbalance*.
Journal of Educational and Behavioral Statistics 22, 845-858.

Levene, H. (1960). *Robust Tests for Equality of Variances*, in Contributions
to Probability and Statistics, ed. I. Olkin, Palo Alto, CA: Stanford Univ. Press.

Neuhauser, M. and Hothorn, L. A. (2000). *Location-scale and scale trend tests based on
Levene's transformation*. Computational Statistics and Data Analysis 33, 189-200.

Noguchi, K. and Gel, Y. R. (2009) *Combination of Levene-type tests and a finite-intersection
method for testing equality of variances against ordered alternatives*. Working paper,
Department of Statistics and Actuarial Science, University of Waterloo.

O'Brien, R. G. (1978). *Robust techniques for testing heterogeneity of variance effects
in factorial designs*. Psychometrika 43, 327-344.

`levene.test`

, `lnested.test`

, `ltrend.test`

,
`mma.test`

, `robust.mmm.test`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
library(mvtnorm)
data(pot)
neuhauser.hothorn.test(pot[,"obs"], pot[,"type"], location="median", tail="left",
correction.method="zero.correction")
## double contrast test based on the absolute deviations from the median with
## group medians with modified structural zero removal method and correction factor
## (left-tailed)
##
## data: pot[, "obs"]
## Test Statistic = -3.6051, p-value = 0.0003021
## Bootstrap version of the test. The calculation may take up a few minutes
## depending on the number of bootstrap sampling.
neuhauser.hothorn.test(pot[,"obs"], pot[,"type"], location="median", tail="left",
correction.method="zero.correction", bootstrap=TRUE, num.bootstrap=500)
## bootstrap double contrast test based on the absolute deviations from the median with
## modified structural zero removal method and correction factor
## (left-tailed)
##
## data: pot[, "obs"]
## Test Statistic = -3.6051, p-value = 0.0001
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.