ltrend.test: Test for a linear trend in variances

Description Usage Arguments Value Author(s) References See Also Examples

Description

The function performs a test for a linear trend in variances. The test statistic 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.

Usage

1
2
3
4
5
ltrend.test(y, group, score=NULL, location = c("median", "mean", "trim.mean"), 
tail = c("right","left","both"), trim.alpha = 0.25,
bootstrap = FALSE, num.bootstrap = 1000, 
correction.method = c("none","correction.factor","zero.removal","zero.correction"), 
correlation.method = c("pearson","kendall","spearman"))

Arguments

y

a numeric vector of data values.

group

factor of the data.

score

weights to be used in testing increasing/decreasing trend in group variances, "score" coincides by default with "group"; it can be chosen as a linear, quadratic or any other monotone function.

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.

correlation.method

measures of correlation; the default option is "pearson", the usual correlation coefficient which is equivalent to the t-test; nonparametric measures of correlation such as "kendall" (Kendall's tau) or "spearman" (Spearman's rho) may also be chosen, in which case, two libraries, Hmisc and Kendall, are required.

Value

A list with the following numeric components.

statistic

the value of the test statistic expressed in terms of correlation (Pearson, Kendall, or Spearman).

p.value

the p-value of the test.

method

type of test performed.

data.name

a character string giving the name of the data.

t.statistic

the value of the test statistic from Student's t-test.

non.bootstrap.p.value

the p-value of the test without bootstrap method.

log.p.value

the log of the p-value

log.q.value

the log of the (one minus the p-value).

Author(s)

Kimihiro Noguchi, W. Wallace Hui, Yulia R. Gel, Joseph L. Gastwirth, Weiwen Miao

References

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.

Gastwirth, J. L., Gel, Y. R., and Miao, W. (2008). The Impact of Levene's Test of Equality of Variances on Statistical Theory and Practice. Working paper, Department of Statistics, George Washington University.

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.

Hui, W., Gel, Y. R., and Gastwirth, J. L. (2008). lawstat: an R package for law, public policy and biostatistics. Journal of Statistical Software 28, Issue 3.

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.

Lim,T.-S., Loh, W.-Y. (1996) A comparison of tests of equality of variances Computational Statistical \& Data Analysis 22, 287-301.

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.

See Also

neuhauser.hothorn.test, levene.test, lnested.test, mma.test, robust.mmm.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(pot)
ltrend.test(pot[,"obs"], pot[,"type"], location="median", tail="left", 
correction.method="zero.correction")

##   ltrend test based on the modified Brown-Forsythe Levene-type procedure using the 
##   group medians with modified structural zero removal method and correction factor 
##   (left-tailed with Pearson correlation coefficient)
##
## data:  pot[, "obs"] 
## Test Statistic (Correlation) = -0.1929, p-value = 0.0001735

##   Bootstrap version of the test. The calculation may take up a few minutes 
##   depending on the number of bootstrap sampling.

ltrend.test(pot[,"obs"], pot[,"type"], location="median", tail="left", 
correction.method="zero.correction",bootstrap=TRUE,num.bootstrap=500)

##   bootstrap ltrend test based on the modified Brown-Forsythe Levene-type procedure 
##   using the group medians with modified structural zero removal method and correction factor
##   (left-tailed with Pearson correlation coefficient)
##
## data:  pot[, "obs"] 
## Test Statistic (Correlation) = -0.1929, p-value = 0.0002

lawstat documentation built on Nov. 23, 2017, 5:05 p.m.