lnested.test: Test for a Monotonic Trend in Variances

View source: R/lnested.test.R

lnested.testR Documentation

Test for a Monotonic Trend in Variances

Description

The test statistic is based on the finite intersection approach.

Usage

lnested.test(
  y,
  group,
  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.

location

the default option is "median" corresponding to the robust Brown–Forsythe Levene-type procedure \insertCiteBrown_Forsythe_1974lawstat; "mean" corresponds to the classical Levene's procedure \insertCiteLevene_1960lawstat, 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 \insertCiteLim_Loh_1996;textuallawstat 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 \insertCiteOBrien_1978;textuallawstat and \insertCiteKeyes_Levy_1997;textuallawstat; "zero.removal" performs the structural zero removal method by \insertCiteHines_Hines_2000;textuallawstat; "zero.correction" performs a combination of the O'Brien's correction factor and the Hines–Hines structural zero removal method \insertCiteNoguchi_Gel_2010lawstat. 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 with the following elements:

T

the statistic and p-value of the test based on the Tippett p-value combination.

F

the statistic and p-value of the test based on the Fisher p-value combination.

N

the statistic and p-value of the test based on the Liptak p-value combination.

L

the statistic and p-value of the test based on the Mudholkar–George p-value combination.

Each of the list elements is a list of class "htest" with the following elements:

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.

non.bootstrap.statistic

the statistic of the test without bootstrap method.

non.bootstrap.p.value

the p-value of the test without bootstrap method.

Author(s)

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

References

\insertAllCited

See Also

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

Examples

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

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


lawstat documentation built on April 6, 2023, 1:06 a.m.