ltrend.test {lawstat}R Documentation

Test for a Linear Trend in Variances

Description

Test for a linear trend in variances.

Usage

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 an 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 (Brown and Forsythe 1974); "mean" corresponds to the classical Levene's procedure (Levene 1960), 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 alternative; "left" corresponds to a decreasing trend in variances, and "both" corresponds to any (increasing or decreasing) monotonic trend in variances as the two-sided alternative.

trim.alpha

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

bootstrap

a logical value identifying whether to implement bootstrap. The default is FALSE, i.e., no bootstrap; if set to TRUE, the bootstrap method described in Lim and Loh (1996) for Levene's test is applied.

num.bootstrap

number of bootstrap samples to be drawn when the bootstrap argument is set to TRUE. The default value is 1000.

correction.method

procedures to make the 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 the O'Brien's correction factor and the Hines–Hines structural zero removal method (Noguchi and Gel 2010). 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 linear correlation coefficient that 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.

Details

The test statistic is based on the classical Levene's 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 are omitted from the data.

Value

A list of class "htest" containing the following 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

Brown MB, Forsythe AB (1974). “Robust tests for the equality of variances.” Journal of the American Statistical Association, 69(346), 364–367. doi:10.1080/01621459.1974.10482955.

Hines WGS, Hines RJO (2000). “Increased power with modified forms of the Levene (Med) test for heterogeneity of variance.” Biometrics, 56(2), 451–454. doi:10.1111/j.0006-341X.2000.00451.x.

Keyes TK, Levy MS (1997). “Analysis of Levene's test under design imbalance.” Journal of Educational and Behavioral Statistics, 22(2), 227–236. doi:10.3102/10769986022002227.

Levene H (1960). “Robust Tests for Equality of Variances.” In Olkin I, others (eds.), Contributions to Probability and Statistics: Essays in Honor of Harold Hotelling. Stanford University Press, Palo Alto, CA.

Lim T, Loh W (1996). “A comparison of tests of equality of variances.” Computational Statistics & Data Analysis, 22(3), 287–301. doi:10.1016/0167-9473(95)00054-2.

Noguchi K, Gel YR (2010). “Combination of Levene-type tests and a finite-intersection method for testing equality of variances against ordered alternatives.” Journal of Nonparametric Statistics, 22(7), 897–913. doi:10.1080/10485251003698505.

O'Brien RG (1978). “Robust techniques for testing heterogeneity of variance effects in factorial designs.” Psychometrika, 43(3), 327–342. doi:10.1007/BF02293643.

See Also

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

Examples

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

## Bootstrap version of the test. The calculation may take up a few minutes 
## depending on the number of bootstrap samples.
ltrend.test(pot[, "obs"], pot[, "type"], location = "median", tail = "left", 
             correction.method = "zero.correction", 
             bootstrap = TRUE, num.bootstrap = 500)
             

[Package lawstat version 3.6 Index]