Learn R Programming

treeperm (version 1.6)

treeperm: Permutation Tests Using Tree Algorithms

Description

This function will perform a K samnple permutation test of data locations. Users may choose either asymptotic test or exact test.

Usage

"treeperm"(formula, frame = list(), type, size, ...) "treeperm"(x,data,factor, type, size, ...) "print"(x,...) "summary"(object,...)

Arguments

x
Generic argument, used only in print.treeperm to represent the treeperm class.
formula
The formula to perform permutation test. The form should be value~label, where value is the set of data and label classifies value into groups.
frame
The dataframe storing vectors used in formula.
data
The data set to be permuted
factor
The index set that classifies parameter data into groups.
type
Which type of permutation the user want to use, either 'exact' or 'approximate'.
size
If the type is 'approximate', user must specify the size of permutations they want.
object
The treeperm class to be summarised.
...
Reserved for future.

Value

result
A permutation object returned by a permutation function, either class Permutation or class KPermutation depending the levels of argument factor.
call
User's calling script to this function at highest level.
data
The input data set.
factor
The index set that classifies data into groups.

Details

This function calls KPermutation or Permutation depending on the levels of factor.

See Also

Permutation KPermutation

Examples

Run this code
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))
data<-data.frame(label,value)
exact<-treeperm(value~label,frame=data,type="exact")
summary(exact)
approximate<-treeperm(value~label,frame=data,type="approximate",size=999)
summary(approximate)

Run the code above in your browser using DataLab