pvalueMC {PoweR} | R Documentation |
Monte-Carlo computation of a p-value for one single test statistic.
Description
This function can compute the p-value associated with a test statistic value from a sample of observations.
Usage
pvalueMC(data, stat.index, null.law.index, M = 10^5, alter, null.law.pars = NULL,
stat.pars = NULL, list.stat = NULL, method = c("Fisher"),
center = FALSE, scale = FALSE)
Arguments
data |
sample of observations. |
stat.index |
index of a test statistic as given by function |
null.law.index |
index of the distribution to be tested (the
null hypothesis distribution),
as given by function |
M |
number of Monte-Carlo repetitions to use. |
alter |
value (in {0,1,2,3,4}) giving the the type of test (See Section 3.3 in Lafaye de Micheaux, P. and Tran, V. A. (2014)). |
null.law.pars |
vector of parameters for the law. The length of this
parameter should not exceed 4. If not provided, the default values
are taken using |
stat.pars |
a vector of parameters.
If |
list.stat |
if not |
method |
method to use for the computation of the |
center |
Logical. Should we center the data generated |
scale |
Logical. Should we center the data generated |
Value
The Monte-Carlo p-value of the test.
Author(s)
P. Lafaye de Micheaux, V. A. Tran
References
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
See Also
See statcompute
.
Examples
x <- rnorm(100)
statcompute(1,x,level = c(0.05),alter = 3)$pvalue
pvalueMC(x,stat.index = 1,null.law.index = 2,M = 10^5,alter = 3)