| run.studies | R Documentation |
This function runs the case studies included in the package and compares the power of a new test to those included.
run.studies(
studies = 1:60,
types = 1:5,
data_type = "cont",
TS,
TSextra,
With.p.value = FALSE,
n,
alpha = 0.05,
B = 1000,
SuppressMessages = TRUE,
RerunIncludedCases = FALSE,
seed = NULL,
maxProcessor,
Null = FALSE,
Hybrid = FALSE,
nMC = 1
)
studies |
=1:60, either the names of the studies, or their numbers. If missing all the studies are run. |
types |
=1:5, either the types of studies, or their numbers. If missing all types are run. |
data_type |
="cont", continuous or discrete data |
TS |
routine to calculate test statistics. If Hybrid=TRUE it has to have the format required by R2sample (a two-sample test). |
TSextra |
list passed to TS. |
With.p.value |
=FALSE does user supplied routine return p values? |
n |
desired sample size. |
alpha |
=0.05 type I error |
B |
= 1000 |
SuppressMessages |
=TRUE |
RerunIncludedCases |
=FALSE, set to true to verify powers in Rgof::power_study (or power_study_hybrid, power_study_hybrid_nMC5) |
seed |
=NULL, optional seed for reproducibility. Case study i in the list of studies/types that are run uses the seed seed+i, both for the new test and (if they are recomputed) for the included methods. |
maxProcessor |
number of processors used in gof_power or hybrid_power. If missing it is chosen automatically. Results with a given seed are reproducible only with the same number of processors. |
Null |
=FALSE, if TRUE the data is generated under the null hypothesis (by rnull), so the result is the type I error. |
Hybrid |
=FALSE, if TRUE the goodness-of-fit/two-sample hybrid tests (hybrid_power, requires package R2sample) are run instead of the goodness-of-fit tests. |
nMC |
=1, size of the Monte Carlo data set for the hybrid tests, as a multiple of the sample size. Stored results exist for nMC=1 (power_study_hybrid) and nMC=5 (power_study_hybrid_nMC5). |
For details consult vignette("Rgof","Rgof")
A matrix of power values.
TSextra=list(nbins=5, statistic=FALSE) # Use 5 bins and calculate p values
run.studies(1:2, 1:2, TS=myTS_cont, TSextra=TSextra, With.p.value=TRUE, B=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.