getTestStats: A function to calculate observed and permuation z-statistics...

View source: R/F_getTestStats.R

getTestStatsR Documentation

A function to calculate observed and permuation z-statistics on a n-by-p matrix of observations

Description

A function to calculate observed and permuation z-statistics on a n-by-p matrix of observations

Usage

getTestStats(
  Y,
  center,
  test = "wilcox.test",
  x,
  B,
  argList,
  tieBreakRan,
  replace,
  scale
)

Arguments

Y

The nxp data matrix

center

a boolean, should data be centered prior to permuation

test

A function name, possibly user defined. See details.

x

A vector defining the groups. Will be coerced to factor.

B

an integer, the number of permuations

argList

A list of further arguments passed on to the test function

tieBreakRan

A boolean, should ties of permutation test statistics be broken randomly? If not, midranks are used

replace

A boolean. If FALSE, samples are permuted (resampled without replacement), if TRUE the samples are bootstrapped (resampled with replacement)

scale

a boolean, should data be scaled prior to resampling

Details

For test "wilcox.test" and "t.test", fast custom implementations are used. Other functions can be supplied but must accept a y outcome variable, a x as grouping variable, and possibly a list of other arguments. It must return all arguments needed to evaluate its quantile function if z-values are to be used.

Value

A list with components

statObs

A vector of length p of observed test statistics

statsPerm

A p-by-B matrix of permutation test statistics

resamDesign

The resampling design


CenterForStatistics-UGent/rransi documentation built on Nov. 13, 2023, 2:07 a.m.