Description Usage Arguments Value Author(s) References See Also Examples
This function generates a sample of n
observations from the law
specified in law.index
. It then computes the value of each test
statistic specified in stat.indices
and use it to obtain the
corresponding p-value under the null. The computation of these p-values
can be done using a Monte-Carlo simulation.
1 2 3 4 |
stat.indices |
vector of test statistic indices as given by
function |
law.index |
index of the distribution from which to generate
observations used to compute the values of the test statistics specified with |
n |
integer. Size of the samples from which to compute the value of the test statistics. |
M |
integer. Number of Monte-Carlo repetitions. Only used when |
N |
integer. Number of p-values to compute for each test statistic. |
alter |
integer value in 0,1,2,3,4. Type of test. See function |
law.pars |
vector of the parameter values for the law specified in |
parstats |
named-list of vectors of parameters for the test statistics specified in
|
null.dist |
used only if |
null.pars |
vector of parameters for the null distribution |
method |
character. Either 'direct' to compute the p-value under the null using
for example the asymptotic distribution of the test statistic under the
null. This is not possible for all test statistics; or 'MC' to use a
Monte-Carlo simulation to approximate the distribution of the test
statistic under the null (specified by |
Rlaw.index |
If 'law.index' is set to 0 then 'Rlaw.index' should be a (random generating) function. |
Rnull.dist |
If 'null.dist' is set to 0 then 'Rnull.dist' should be a (random generating) function. |
Rstats |
A list of same length as |
center |
Logical. Should we center the data generated |
scale |
Logical. Should we center the data generated |
pvals |
the |
stat.indices |
same as input. |
n |
same as input. |
M |
same as input. |
alter |
same as input. |
parstats |
same as input. |
null.dist |
same as input. |
method |
same as input. |
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 | stind <- c(43,44,42) # Indices of test statistics.
alter <-list(stat43=3,stat44=3,stat42=3) # Type for each test.
# Several p-values computed under the null.
# You can increase the values of M and N for better results.
matrix.pval <- many.pval(stat.indices=stind,law.index=1,
n=100,M=10,N=10,alter=alter,null.dist=1,
method="direct")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.