| h0plot | R Documentation |
The function visualizes the distribution of the test statistic.
h0plot(x, ...)
## Default S3 method:
h0plot(x, statistic, pval, alternative = "two.sided", sig.level = 0.05,
hist.alpha = 0.2, stat.col = "darkgreen", dens.col = "black",
dens.alpha = 0.5, cval.col = "darkred", lwd = 1,
breaks = NULL, digits = 3, ...)
## S3 method for class 'htest'
h0plot(x, sig.level = 0.05, hist.alpha = 0.2,
stat.col = "darkgreen", dens.col = "black",
dens.alpha = 0.5, cval.col = "darkred", lwd = 1,
breaks = NULL, digits = 3, qtail = 1e-3, n = 501, ...)
## S3 method for class 'perm.htest'
h0plot(x, sig.level = 0.05, hist.alpha = 0.2, stat.col = "darkgreen",
dens.col = "black", dens.alpha = 0.5,
cval.col = "darkred", lwd = 1, breaks = NULL,
digits = 3, ...)
## S3 method for class 'boot.htest'
h0plot(x, sig.level = 0.05, hist.alpha = 0.2, stat.col = "darkgreen",
dens.col = "black", dens.alpha = 0.5, cval.col = "darkred",
lwd = 1, breaks = NULL, digits = 3, ...)
x |
bootstrap/permuation results of the test statistic or result of
class |
statistic |
test statistic of the test on the original data. |
pval |
p value of the test. |
alternative |
a character string specifying the alternative
hypothesis, must be one of |
sig.level |
significance level of the test. |
hist.alpha |
opacity used for |
stat.col |
color used for line representing the (final) test statistic. |
dens.col |
color used for the density line. |
dens.alpha |
opacity used for |
cval.col |
color used for rejection region (area under the density beyond the critical value). |
lwd |
line width used for line representing the (final) test statistic
as well ase for |
breaks |
argument |
digits |
number of significant digits used for p values. |
qtail |
tail quantile to determine plot limits of x-axis. |
n |
integer; the number of x values at which to evaluate. |
... |
further arguments that may be passed through. |
The function can be used to plot the distribution of the test statistic under H0.
In case of class htest the implementation so far covers t.test,
oneway.test, and var.test. In principle, the function should
work for all tests of class htest returning a t or F statistic.
ggplot object
Matthias Kohl Matthias.Kohl@stamats.de
B. Efron, R.J. Tibshirani. An Introduction to the Bootstrap. Chapman and Hall/CRC 1993.
A. Janssen (1997). Studentized permutation tests for non-i.i.d, hypotheses and the generalized Behrens-Fisher problem. Statistics and Probability Letters, 36, 9-21.
E. Chung, J.P. Romano (2013). Exact and asymptotically robust permutation tests. The Annals of Statistics, 41(2), 484-507.
## Welch t-Test
h0plot(t.test(extra ~ group, data = sleep))
h0plot(t.test(extra ~ group, data = sleep, alternative = "less"))
## Hsu t-Test
h0plot(hsu.t.test(extra ~ group, data = sleep))
h0plot(hsu.t.test(extra ~ group, data = sleep, alternative = "less"))
## Welch 1-Way ANOVA
h0plot(oneway.test(extra ~ group, data = sleep))
## F test to compare two variances
h0plot(var.test(extra ~ group, data = sleep))
## Bootstrap based Welch t-Test
h0plot(boot.t.test(extra ~ group, data = sleep, bootStat = TRUE))
h0plot(boot.t.test(extra ~ group, data = sleep, bootStat = TRUE,
alternative = "less"))
## Permutation based Welch t-Test
h0plot(perm.t.test(extra ~ group, data = sleep, permStat = TRUE))
h0plot(perm.t.test(extra ~ group, data = sleep, permStat = TRUE,
alternative = "less"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.