ptest: Correlation permutation test

View source: R/ptest.R

ptestR Documentation

Correlation permutation test

Description

Execute one-sample permutation test on two numeric vector. Its keep one vector constant and ‘shuffle’ the other by resampling. This approximates the null hypothesis — that there is no dependency/difference between the variables.

Usage

ptest(
  x,
  y,
  FUN,
  rk = F,
  alternative = c("two.sided", "less", "greater"),
  num.s = 1000,
  ...
)

Arguments

x

\[numeric(1)]
a numeric vector.

y

\[numeric(1)]
a numeric vector.

FUN

\[function(1)]
the function to be applied

rk

\[logical(1)]
if its TRUE transform x, y numeric vectors with samples ranks.

alternative

\[character(1)]
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

num.s

\[numeric(1)]
number of samples with replacement created with y numeric vector.

...

Additional arguments (TODO).

Examples

## Not run: 

x = iris[[1]]; y = iris[[2]]
ptest(x,y,FUN = function(x,y) cor(x,y) ,alternative = 't')


## End(Not run)

meantrix/corrP documentation built on Oct. 22, 2024, 10:16 a.m.