Methods
This page documents the generic confint
, pvalue
and testname
methods which are supported by most tests. Some particular tests support additional arguments: see the documentation for the relevant methods provided in sections covering these tests.
Confidence interval
StatsAPI.confint
— Functionconfint(test::BinomialTest; level = 0.95, tail = :both, method = :clopper_pearson)
Compute a confidence interval with coverage level
for a binomial proportion using one of the following methods. Possible values for method
are:
:clopper_pearson
(default): Clopper-Pearson interval is based on the binomial distribution. The empirical coverage is never less than the nominal coverage oflevel
; it is usually too conservative.:wald
: Wald (or normal approximation) interval relies on the standard approximation of the actual binomial distribution by a normal distribution. Coverage can be erratically poor for success probabilities close to zero or one.:waldcc
: Wald interval with a continuity correction that extends the interval by1/2n
on both ends.:wilson
: Wilson score interval relies on a normal approximation. In contrast to:wald
, the standard deviation is not approximated by an empirical estimate, resulting in good empirical coverages even for small numbers of draws and extreme success probabilities.:jeffrey
: Jeffreys interval is a Bayesian credible interval obtained by using a non-informative Jeffreys prior. The interval is very similar to the Wilson interval.:agresti_coull
: Agresti-Coull interval is a simplified version of the Wilson interval; both are centered around the same value. The Agresti Coull interval has higher or equal coverage.:arcsine
: Confidence interval computed using the arcsine transformation to make $var(p)$ independent of the probability $p$.
References
- Brown, L.D., Cai, T.T., and DasGupta, A. Interval estimation for a binomial proportion. Statistical Science, 16(2):101–117, 2001.
- Pires, Ana & Amado, Conceição. (2008). Interval Estimators for a Binomial Proportion: Comparison of Twenty Methods. REVSTAT. 6. 10.57805/revstat.v6i2.63.
External links
confint(x::FisherExactTest; level::Float64=0.95, tail=:both, method=:central)
Compute a confidence interval with coverage level
. One-sided intervals are based on Fisher's non-central hypergeometric distribution. For tail = :both
, the only method
implemented yet is the central interval (:central
).
Since the p-value is not necessarily unimodal, the corresponding confidence region might not be an interval.
References
- Gibbons, J.D, Pratt, J.W. P-values: Interpretation and Methodology, American Statistican, 29(1):20-25, 1975.
- Fay, M.P., Supplementary material to "Confidence intervals that match Fisher’s exact or Blaker’s exact tests". Biostatistics, Volume 11, Issue 2, 1 April 2010, Pages 373–374, link
confint(test::PowerDivergenceTest; level = 0.95, tail = :both, method = :auto)
Compute a confidence interval with coverage level
for multinomial proportions using one of the following methods. Possible values for method
are:
:auto
(default): If the minimum of the expected cell counts exceeds 100, Quesenberry-Hurst intervals are used, otherwise Sison-Glaz.:sison_glaz
: Sison-Glaz intervals:bootstrap
: Bootstrap intervals:quesenberry_hurst
: Quesenberry-Hurst intervals:gold
: Gold intervals (asymptotic simultaneous intervals)
References
- Agresti, Alan. Categorical Data Analysis, 3rd Edition. Wiley, 2013.
- Sison, C.P and Glaz, J. Simultaneous confidence intervals and sample size determination for multinomial proportions. Journal of the American Statistical Association, 90:366-369, 1995.
- Quesensberry, C.P. and Hurst, D.C. Large Sample Simultaneous Confidence Intervals for Multinational Proportions. Technometrics, 6:191-195, 1964.
- Gold, R. Z. Tests Auxiliary to $χ^2$ Tests in a Markov Chain. Annals of Mathematical Statistics, 30:56-74, 1963.
p-value
StatsAPI.pvalue
— Functionpvalue(x::FisherExactTest; tail = :both, method = :central)
Compute the p-value for a given Fisher exact test.
The one-sided p-values are based on Fisher's non-central hypergeometric distribution $f_ω(i)$ with odds ratio $ω$:
\[ \begin{align*} p_ω^{(\text{left})} &=\sum_{i ≤ a} f_ω(i)\\ p_ω^{(\text{right})} &=\sum_{i ≥ a} f_ω(i) \end{align*}\]
For tail = :both
, possible values for method
are:
:central
(default): Central interval, i.e. the p-value is two times the minimum of the one-sided p-values.:minlike
: Minimum likelihood interval, i.e. the p-value is computed by summing all tables with the same marginals that are equally or less probable:\[ p_ω = \sum_{f_ω(i)≤ f_ω(a)} f_ω(i)\]
References
- Gibbons, J.D., Pratt, J.W., P-values: Interpretation and Methodology, American Statistican, 29(1):20-25, 1975.
- Fay, M.P., Supplementary material to "Confidence intervals that match Fisher’s exact or Blaker’s exact tests". Biostatistics, Volume 11, Issue 2, 1 April 2010, Pages 373–374, link
Test name
HypothesisTests.testname
— Functiontestname(::HypothesisTest)
Returns the string value, e.g. "Binomial test" or "Sign Test".