Description Usage Arguments Details Value Author(s) References Examples
Performs the hypothesis test for those added in the package.
1 2 |
stat.index |
one statistic index as given by function
|
data |
sample from which to compute the statistic. |
levels |
vector of desired significance levels for the test. |
critvalL |
|
critvalR |
|
alter |
0: two.sided=bilateral, 1: less=unilateral, 2: greater=unilateral, 3: bilateral test that rejects H0 only for large values of the test statistic, 4: bilateral test that rejects H0 only for small values of the test statistic. |
stat.pars |
a vector of parameters.
If |
check |
Logical. If |
The function statcompute() should not be used in simulations since it is
NOT fast. Consider instead using powcomp.easy
or
powcomp.fast
. Se also in the Example section below for a fast
approach using the .C
function (but be warned that giving wrong
values of arguments can crash your session!).
A list with components:
statistic |
the test statistic value |
pvalue |
the p-value |
decision |
the vector of decisions, same length as |
alter |
|
stat.pars |
|
symbol |
how the test is noted |
P. Lafaye de Micheaux, V. A. Tran
Pierre Lafaye de Micheaux, Viet Anh Tran (2016). PoweR: A Reproducible Research Tool to Ease Monte Carlo Power Simulation Studies for Studies for Goodness-of-fit Tests in R. Journal of Statistical Software, 69(3), 1–42. doi:10.18637/jss.v069.i03
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data <- rnorm(50)
# Shapiro-Wilk test:
statcompute(21, data, levels = c(0.05, 0.1), critvalL = NULL, critvalR = NULL,
alter = 0, stat.pars = NULL)
# Identical to:
shapiro.test(data)
# The function statcompute() should not be used in simulations since it
# is NOT fast. Consider instead the call below (but see the Details
# Section):
.C("stat21", data = data, n = 50L, levels = 0.05, nblevels = 1L, name =
rep(" ", 50), getname = 0L, statistic = 0, pvalcomp = 1L, pvalue = 0, cL = 0.0,
cR = 0.0, usecrit = 0L, alter = 4L, decision = 0L, stat.pars = 0.0,
nbparstat = 0L)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.