kTest: kTest

Description Usage Arguments Value Examples

Description

Performs a hypothesis test for equality of distributions based on the estimated kernel densities and the permutation test.

Usage

1
2
3
kTest(data, classes = NULL, perm = TRUE, B = 5000,
  pairwise = FALSE, bw = bw.nrd0, npoints = 512,
  threads = detectCores() - 1)

Arguments

data

Either a list of numeric vectors, a numeric vector (with classes parameter defined), or a stacked data frame (first column with numeric values and second column with classes).

classes

Classes relative to data parameter, should be used only when data is a numeric vector.

perm

Boolean indicating weather to obtain the p-value trough the permutation test or just return return the common area between densities.

B

Number of permutations.

pairwise

Boolean indicating weather to obtain pairwise p-values (valid only if > 2 groups). If the number of groups is big, this will make the execution much slower.

bw

The bandwidth used to estimate the kernel densities.

npoints

The number of points used to estimate the kernel densities.

threads

Number of cores to be used for parallel computing.

Value

A list containing:

- densities: The estimated densities for each group.

- labels: The group labels.

- ca: Common area between the kernel densities.

- pvalue: The p-value generated by the permutation test (if perm = TRUE).

- pairwiseca: Groups pairwise common area triangular matrix (just if >= 3 groups).

- pairwisepvalue: Groups pairwise p-value triangular matrix generated by the permutation test (if perm = TRUE, pairwise = TRUE and >= 3 groups).

Examples

1
2
3
4
5
data = list(x = rnorm(30), y = rexp(50), z = rpois(70, 1))
test = kTest(data)
print(test)
plot(test)
pairs(test)

vcoscrato/ktest documentation built on May 9, 2019, 10:01 p.m.