preprocess_data: Preprocess data for the robust two sample tests

View source: R/helpers.R

preprocess_dataR Documentation

Preprocess data for the robust two sample tests

Description

preprocess_data is a helper function that performs several preprocessing steps on the data before performing the two-sample tests.

Usage

preprocess_data(x, y, delta, na.rm, wobble, wobble.seed, scale.test)

Arguments

x

a (non-empty) numeric vector of data values.

y

a (non-empty) numeric vector of data values.

delta

a numeric value indicating the true difference in the location or scale parameter, depending on whether the test should be performed for a difference in location or in scale.

na.rm

a logical value indicating whether NA values in x and y should be stripped before the computation proceeds.

wobble

a logical value indicating whether the sample should be checked for duplicated values that can cause the scale estimate to be zero. If such values are present, uniform noise is added to the sample, see wobble.

wobble.seed

an integer value used as a seed for the random number generation in case of wobble = TRUE or when scale.test = TRUE with one of the vectors x and y containing zeros. When no seed is specified, it is chosen randomly and printed in a message. The argument is ignored if scale.test = FALSE and/or wobble = FALSE.

scale.test

a logical value to specify if the samples should be compared for a difference in scale.

Details

The preprocessing steps include the removal of missing values and, if specified, wobbling and a transformation of the observations to test for differences in scale.

Value

A named list containing the following components:

x

the (possibly transformed) input vector x.

y

the (possibly transformed) input vector y.

delta

the (possibly transformed) input value delta.


robnptests documentation built on Feb. 16, 2023, 7:10 p.m.