Learn R Programming

coin (version 0.4-2)

pvalue-methods: Extract P-Values

Description

Extracts the p-value from objects representing null distributions of independence tests.

Usage

pvalue(object, ...)

Arguments

object
an object inheriting from class IndependenceTest-class.
...
additional arguments: method, a character specifying the type of adjustment (single-step, step-down or discrete) should be used. The default is global.

Details

Univariate p-values for maximum-type statistics come with associated 99% confidence interval when resampling was used to determine the null distribution (which may be the case even when distribution = "asypmtotic" was used).

By default, a global p-value is returned. When method = "single-step", adjusted p-values are obtained from a single-step max-T procedure (Westfall & Young, 1993, algorithm 2.5 and formula 2.8). Note that the minimum of the adjusted p-values always controls the familywise error rate (FWER) but the maximum type I error, i.e. the error for each of the individual tests, is only controlled when the subset pivotality condition holds.

When method = "step-down" the free step-down resampling method (algorithm 2.8 and formula 2.8 in Westfall & Young, 1993) is used, the above comments apply as well.

With method = "discrete", the Bonferroni adjustment as suggested by Westfall & Wolfinger (1997) with improvements for highly discrete permutation distributions is available, however, without taking correlations between the test statistics into account. Here, the p-values are valid even without assuming subset pivotality.

References

Peter H. Westfall & S. Stanley Young (1993), Resampling-based Multiple Testing. New York: John Wiley & Sons.

Peter H. Westfall & Russell D. Wolfinger (1997), Multiple tests with discrete distributions. The American Statistician 51, 3--8.

Examples

Run this code
### artificial 2-sample problem
df <- data.frame(y = rnorm(20), x = gl(2, 10))
 
### Ansari-Bradley test
at <- ansari_test(y ~ x, data = df, distribution = "exact")

at

pvalue(at)

### bivariate 2-sample problem
df <- data.frame(y1 = rnorm(20) + c(rep(0, 10), rep(1, 10)), 
                 y2 = rnorm(20), 
                 x = gl(2, 10))

it <- independence_test(y1 + y2 ~ x, data = df, 
                        distribution = approximate(B = 9999))
pvalue(it, method = "single-step")
pvalue(it, method = "step-down")
pvalue(it, method = "discrete")

Run the code above in your browser using DataLab