nulldist.twosample: Two sample null distribution generator

View source: R/nulldist_twosample.R

nulldist.twosampleR Documentation

Two sample null distribution generator

Description

This function generates random samples and evaluates the test statistics for the two-sample covariance matrix test and reports a bootstrap random sample of average p-values. The generated values can be used to calculate the critical value for rejecting/accepting the null hypothesis

Usage

nulldist.twosample(
  n1,
  n2 = NULL,
  p,
  m = 1,
  nnull = 100,
  nrep = 100,
  mean1 = NULL,
  mean2 = NULL,
  parallel = TRUE,
  ncores = NULL
)

Arguments

n1

sample size of the data from the first group

n2

sample size of the data from the second group. If n2 = NULL (Default value), then n2 is set equal to n1

p

original dimension of your data

m

projected dimension of your data (Default value is 1)

nnull

number of repetitions of averages of pvalues

nrep

number of repetitions for each average of pvalues

mean1

(Optional) Mean vector of the first group for the null distribution

mean2

(Optional) Mean vector of the second group for the null distribution

parallel

Whether to parallelize or not (default is TRUE)

ncores

Number of cores to use (If NULL and parallel is TRUE, use 75% of all cores). If parallel = FALSE, this argument will be ignored.

Value

A list with three elements corresponding to different test statistics

Box-M

Box's M test statistic

Wald

Wald test statistic

Examples

## Not run: 
 nulldist.twosample(n = 20, p = 100, m = 5)

## End(Not run)

dnayyala/cramp documentation built on June 27, 2023, 1:34 p.m.