Learn R Programming

ClusterSignificance (version 1.0.3)

PermutationResults-class: permutation test

Description

Test how the classification performs compared to random (eg. permuted) data.

Usage

"getData"(x, n = NULL)
"c"(x, ..., recursive = FALSE)
pvalue(x, ...)
"pvalue"(x, ...)
"initialize"(.Object, ..., scores.real, scores.vec)
permute(mat, ...)
"permute"(mat, groups, projmethod = "pcp", iter = 100, user.permutations = NULL, seed = 3, verbose = TRUE, ...)
"plot"(x, y, ...)
"show"(object)

Arguments

x
matrix for the function permute, otherwise it is a PermutationResults object
n
data to extract from ClassifiedPoints (NULL gives all)
...
arguments to pass on
recursive
dont use (belongs to default generic of combine 'c()')
.Object
internal object
scores.real
the real score
scores.vec
all permuted scores
mat
matrix with samples on rows, PCs in columns. Ordered PCs, with PC1 to the left.
groups
vector in same order as rows in matrix
projmethod
'pcp' or 'mlp'
iter
integer number of iterations to be performed.
user.permutations
user defined permutation matrix
seed
random seed to be used by the internal permutation
verbose
makes function more talkative
y
default plot param, which should be set to NULL
object
ClassifiedPoints Object

Value

The permute function returns an object of class PermutationResults

Details

This is a test suit and will return a summarized object. The default of the parameter 'iter' is set quite low, and in principle the more iterations the better, or until the pvalue converges to a specifc value. If no pre-permuted data has been supplied by the user, then the internal permutation method will perform a sampling without replacement within each dimension.

Examples

Run this code

#use pcp method
data(pcpMatrix)
groups <- rownames(pcpMatrix)

#run function
iterations <- 10
pe <- permute(
    mat=pcpMatrix,
    groups=groups,
    iter=iterations,
    projmethod="pcp"
)

#use mlp method
data(mlpMatrix)
groups <- rownames(mlpMatrix)
pe <- permute(
    mat=mlpMatrix,
    groups=groups,
    iter=iterations,
    projmethod="mlp"
)


#getData accessor
getData(pe)

#getData accessor specific
getData(pe, "scores.vec")

#get pvalue
pvalue(pe)

#plot result
plot(pe)

#combine three (parallell) jobs on the same matrix 
pe2 <- c(pe, pe, pe)

Run the code above in your browser using DataLab