Learn R Programming

robnptests (version 1.1.0)

wobble: Add random noise to remove ties

Description

wobble adds noise from a continuous uniform distribution to the observations to remove ties.

Usage

wobble(x, y, check = TRUE)

Value

A named list of length two containing the modified input samples x and y.

Arguments

x

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

y

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

check

a logical value indicating whether the samples should be checked for bindings prior to adding uniform noise or not, defaults to TRUE.

Details

If check = TRUE the function checks whether all values in the two numeric input vectors are distinct. If so, it returns the original values, otherwise the ties are removed by adding noise from a continuous uniform distribution to all observations. If check = FALSE, it simply determines the number of digits and adds uniform noise.

More precisely, we determine the minimum number of digits d_min in the sample and then add random numbers from the U[-0.5 10^(-d_min), 0.5 10^(-d_min)] distribution to each of the observations.

References

FriGat07rankrobnptests

Examples

Run this code
x <- rnorm(20); y <- rnorm(20); x <- round(x)
wobble(x, y)

Run the code above in your browser using DataLab