Learn R Programming

R2sample (version 5.1.0)

run.studies: Power Comparisons

Description

This function runs the case studies included in the package and compares the power of a new test to those included.

Usage

run.studies(
  studies = 1:40,
  types = 1:5,
  data_type = "cont",
  TS,
  TSextra,
  With.p.value = FALSE,
  n = 500,
  alpha = 0.05,
  B = 1000,
  seed = NULL,
  SuppressMessages = TRUE,
  RerunIncludedCases = FALSE,
  maxProcessor = 1,
  Null = FALSE,
  ShowProgress = FALSE
)

Value

A matrix of power values.

Arguments

studies

=1:40, 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.

TSextra

list passed to TS.

With.p.value

=FALSE does user supplied routine return p values?

n

= 500, desired sample size.

alpha

=0.05 type I error

B

= 1000

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.

SuppressMessages

= TRUE

RerunIncludedCases

=FALSE, recompute the powers of the included methods even if n=500 and alpha=0.05, instead of using the stored results in power_study

maxProcessor

=1, number of processors used in twosample_power. Results with a given seed are reproducible only with the same number of processors.

Null

=FALSE, if TRUE both data sets are generated under the null hypothesis (by rnull), so the result is the type I error. The type "Null" does the same for case studies 1-20.

ShowProgress

=FALSE, if TRUE a message with the elapsed time and an estimate of the remaining time is shown after each case study.

Details

For details consult vignette("R2sample","R2sample")

Examples

Run this code
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=100)

Run the code above in your browser using DataLab