Description Usage Arguments Details Value Note References Examples
Methods for computation of the pvalue, midpvalue, pvalue interval and test size.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  ## S4 method for signature 'PValue'
pvalue(object, q, ...)
## S4 method for signature 'NullDistribution'
pvalue(object, q, ...)
## S4 method for signature 'ApproxNullDistribution'
pvalue(object, q, ...)
## S4 method for signature 'IndependenceTest'
pvalue(object, ...)
## S4 method for signature 'MaxTypeIndependenceTest'
pvalue(object, method = c("global", "singlestep",
"stepdown", "unadjusted"),
distribution = c("joint", "marginal"),
type = c("Bonferroni", "Sidak"), ...)
## S4 method for signature 'NullDistribution'
midpvalue(object, q, ...)
## S4 method for signature 'ApproxNullDistribution'
midpvalue(object, q, ...)
## S4 method for signature 'IndependenceTest'
midpvalue(object, ...)
## S4 method for signature 'NullDistribution'
pvalue_interval(object, q, ...)
## S4 method for signature 'IndependenceTest'
pvalue_interval(object, ...)
## S4 method for signature 'NullDistribution'
size(object, alpha, type = c("pvalue", "midpvalue"), ...)
## S4 method for signature 'IndependenceTest'
size(object, alpha, type = c("pvalue", "midpvalue"), ...)

object 
an object from which the pvalue, midpvalue, pvalue interval or test size can be computed. 
q 
a numeric, the quantile for which the pvalue, midpvalue or pvalue interval is computed. 
method 
a character, the method used for the pvalue computation: either

distribution 
a character, the distribution used for the computation of adjusted
pvalues: either 
type 

alpha 
a numeric, the nominal significance level α at which the test size is computed. 
... 
further arguments (currently ignored). 
The methods pvalue
, midpvalue
, pvalue_interval
and
size
compute the pvalue, midpvalue, pvalue
interval and test size respectively.
For pvalue
, the global pvalue (method = "global"
) is
returned by default and is given with an associated 99% confidence interval
when resampling is used to determine the null distribution (which for maximum
statistics may be true even in the asymptotic case).
The familywise error rate (FWER) is always controlled under the global null hypothesis, i.e., in the weak sense, implying that the smallest adjusted pvalue is valid without further assumptions. Control of the FWER under any partial configuration of the null hypotheses, i.e., in the strong sense, as is typically desired for multiple tests and comparisons, requires that the subset pivotality condition holds (Westfall and Young, 1993, pp. 42–43; Bretz, Hothorn and Westfall, 2011, pp. 136–137). In addition, for methods based on the joint distribution of the test statistics, failure of the joint exchangeability assumption (Westfall and Troendle, 2008; Bretz, Hothorn and Westfall, 2011, pp. 129–130) may cause excess Type I errors.
Assuming subset pivotality, singlestep or free stepdown
adjusted pvalues using maxT procedures are obtained by setting
method
to "singlestep"
or "stepdown"
respectively. In
both cases, the distribution
argument specifies whether the adjustment
is based on the joint distribution ("joint"
) or the marginal
distributions ("marginal"
) of the test statistics. For procedures
based on the marginal distributions, Bonferroni or Šidáktype
adjustment can be specified through the type
argument by setting it to
"Bonferroni"
or "Sidak"
respectively.
The pvalue adjustment procedures based on the joint distribution of the test statistics fully utilizes distributional characteristics, such as discreteness and dependence structure, whereas procedures using the marginal distributions only incorporate discreteness. Hence, the joint distributionbased procedures are typically more powerful. Details regarding the singlestep and free stepdown procedures based on the joint distribution can be found in Westfall and Young (1993); in particular, this implementation uses Equation 2.8 with Algorithm 2.5 and 2.8 respectively. Westfall and Wolfinger (1997) provide details of the marginal distributionsbased singlestep and free stepdown procedures. The generalization of Westfall and Wolfinger (1997) to arbitrary test statistics, as implemented here, is given by Westfall and Troendle (2008).
Unadjusted pvalues are obtained using method = "unadjusted"
.
For midpvalue
, the global midpvalue is given with an associated
99% midp confidence interval when resampling is used to determine the
null distribution. The twosided midpvalue is computed according to
the minimum likelihood method (Hirji et al., 1991).
The pvalue interval (p_0, p_1] obtained by pvalue_interval
was proposed by Berger (2000, 2001), where the upper endpoint p_1 is the
conventional pvalue and the midpoint, i.e., p_0.5, is
the midpvalue. The lower endpoint p_0 is the smallest
pvalue attainable if no conservatism attributable to the discreteness
of the null distribution is present. The length of the pvalue interval
is the null probability of the observed outcome and provides a datadependent
measure of conservatism that is completely independent of the nominal
significance level.
For size
, the test size, i.e., the actual significance level, at the
nominal significance level α is computed using either the rejection
region corresponding to the pvalue (type = "pvalue"
, default)
or the midpvalue (type = "midpvalue"
). The test size is, in
contrast to the pvalue interval, a dataindependent measure of
conservatism that depends on the nominal significance level. A test size
smaller or larger than the nominal significance level indicates that the test
procedure is conservative or anticonservative, respectively, at that
particular nominal significance level. However, as pointed out by Berger
(2001), even when the actual and nominal significance levels are identical,
conservatism may still affect the pvalue.
The pvalue, midpvalue, pvalue interval or test size
computed from object
. A numeric vector or matrix.
The midpvalue, pvalue interval and test size of asymptotic
permutation distributions or exact permutation distributions obtained by the
splitup algoritm is reported as NA
.
In versions of coin prior to 1.10, a minP procedure computing
Šidák singlestep adjusted pvalues accounting for
discreteness was available when specifying method = "discrete"
.
This is now deprecated and will be removed in a future release due to
the introduction of a more general maxT version of the same algorithm.
Berger, V. W. (2000). Pros and cons of permutation tests in clinical trials. Statistics in Medicine 19(10), 1319–1328. doi: 10.1002/(SICI)10970258(20000530)19:10<1319::AIDSIM490>3.0.CO;20
Berger, V. W. (2001). The pvalue interval as an inferential tool. The Statistician 50(1), 79–85. doi: 10.1111/14679884.00262
Bretz, F., Hothorn, T. and Westfall, P. (2011). Multiple Comparisons Using R. Boca Raton: CRC Press.
Hirji, K. F., Tan, S.J. and Elashoff, R. M. (1991). A quasiexact test for comparing two binomial proportions. Statistics in Medicine 10(7), 1137–1153. doi: 10.1002/sim.4780100713
Westfall, P. H. and Troendle, J. F. (2008). Multiple testing with minimal assumptions. Biometrical Journal 50(5), 745–755. doi: 10.1002/bimj.200710456
Westfall, P. H. and Wolfinger, R. D. (1997). Multiple tests with discrete distributions. The American Statistician 51(1), 3–8. doi: 10.1080/00031305.1997.10473577
Westfall, P. H. and Young, S. S. (1993). ResamplingBased Multiple Testing: Examples and Methods for pValue Adjustment. New York: John Wiley & Sons.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59  ## Twosample problem
dta < data.frame(
y = rnorm(20),
x = gl(2, 10)
)
## Exact AnsariBradley test
(at < ansari_test(y ~ x, data = dta, distribution = "exact"))
pvalue(at)
midpvalue(at)
pvalue_interval(at)
size(at, alpha = 0.05)
size(at, alpha = 0.05, type = "midpvalue")
## Bivariate twosample problem
dta2 < data.frame(
y1 = rnorm(20) + rep(0:1, each = 10),
y2 = rnorm(20),
x = gl(2, 10)
)
## Approximative (Monte Carlo) bivariate FisherPitman test
(it < independence_test(y1 + y2 ~ x, data = dta2,
distribution = approximate(nresample = 10000)))
## Global pvalue
pvalue(it)
## Joint distribution singlestep pvalues
pvalue(it, method = "singlestep")
## Joint distribution stepdown pvalues
pvalue(it, method = "stepdown")
## Sidak stepdown pvalues
pvalue(it, method = "stepdown", distribution = "marginal", type = "Sidak")
## Unadjusted pvalues
pvalue(it, method = "unadjusted")
## Length of YOY Gizzard Shad (Hollander and Wolfe, 1999, p. 200, Tab. 6.3)
yoy < data.frame(
length = c(46, 28, 46, 37, 32, 41, 42, 45, 38, 44,
42, 60, 32, 42, 45, 58, 27, 51, 42, 52,
38, 33, 26, 25, 28, 28, 26, 27, 27, 27,
31, 30, 27, 29, 30, 25, 25, 24, 27, 30),
site = gl(4, 10, labels = as.roman(1:4))
)
## Approximative (Monte Carlo) FisherPitman test with contrasts
## Note: all pairwise comparisons
(it < independence_test(length ~ site, data = yoy,
distribution = approximate(nresample = 10000),
xtrafo = mcp_trafo(site = "Tukey")))
## Joint distribution stepdown pvalues
pvalue(it, method = "stepdown") # subset pivotality is violated

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.