Permutation: Two Sample Exact Permutation Test

Description Usage Arguments Details Value Note Author(s) References Examples

Description

This function performs a two sample permutation test of data locations by returning a p value. It is a wrapper function for C level computations. Users are not expected to use this function directly because there is no error checking mechanisms. However, for purpose of performance testing and other demands, this function is visible in this package.

Usage

1
2
3
Permutation(data, factor)
## S3 method for class 'Permutation'
print(x,...)

Arguments

x

The Permutation class to be printed.

data

The set of all data to be permuted

factor

The set of indices, indicating group assignments of values in vector data. This parameter should be in factor type..

...

Reserved for future.

Details

Details about implementations are located in Permutation.c.

Value

Statistics

The observed test statistics for input data. It is the sum of all elements in first group.

Permutations

The total number of permutations can be performed on input groups.

pvalue

The p value of this two sample permutation test.

Note

Although the return value uses a group mean value as test statistics, the actual computation uses the group sum to speed up computation.

Author(s)

Qiao Kang

References

Fisher, R. A. 1925, 'Statistical Methods for Research Workers', Oliver and Boyd, Edinburgh

Examples

1
2
3
value<-c(0,190,0,0,10,0,0,0,0,0,0,110,0,0,52,0,8,0,50,0,0,137,965,110)
label<-as.factor(c(1,1,1,2,2,2,1,1,1,2,2,2,1,1,1,2,2,2,1,1,1,2,2,2))
print(Permutation(value,label))

Example output

Total permutations
[1] 2704156
Observed statistics
[1] 24.33333
P value
[1] 0.3257024

treeperm documentation built on May 2, 2019, 10:23 a.m.