Learn R Programming

flip (version 2.4.3)

flip.object-class: Class "flip.object" (and related functions) for storing the result of the function flip and flipMix

Description

The class flip.object is the output of a call to flip, flipMix, npc and flip.adjust. It stores the information needed for various diagnostic plots. Specific functions to deal with these objects are also documented here.

Usage

getFlip(obj, element)

cFlip(...)

Arguments

obj

Any flip-object

element

Character string of either slot names of obj (i.e. "res","call","permP","permT", "permSpace","permY","tail","data","call.env"), elements of slot obj@data (e.g. "Y","X","Z","Strata") or columns of obj@res (usually "Test","Stat", "tail","p-value"). Specific uses: "Adjust:" returns all columns of adjusted p-values in obj@res. Any among "nperms","perms","B" return the number of permutation used.

...

flip-objects to be concatenated.

Objects from the Class

Objects can be created by calls of the form new("flip.object", ...).

Slots

res:

Object of class flip.object

call:

Object of class "call"

permP:

A matrix p-values of size B x p (number of permutations x number of variables), first line representing the p-value computed on observed data.

permT:

A matrix test statistics of size B x p (number of permutations x number of variables), first line representing the test statistic computed on observed data.

permSpace:

A list that may contain B,n,rotFunct,permID. B is the number of permutations/rotations, n number of observations (possibly after orthogonalization of the residuals), rotFunct is the function used to resample the elements. permID is a matrix permutation of size B x n (number of permutations x sampel size), first line representing the p-value computed on observed data. This matrix is usually generated by make.permSpace or make.signSpace

permY:

Not implemented yet

tail:

tail of the alternative. 1 means right tail, -1 left tail and 0 is bidirectional alternative

Methods

[

Select tests from the flip.object. Tests can be selected by position of name. It also allow for grep-like selection.

[[

Same as [

hist

Produces a histogram to visualize the permutation test statistics (same as globaltest:gt.object)

length

Number of tests

names

signature(x = "flip.object"): ...

names<-

signature(x = "flip.object"): ...

p.value

Extracts p-values from the object.

p.adjust

Performs multiple testing correction and produces multiplicity-corrected p-values. See flip.adjust for details.

plot

signature(x = "flip.object", y = "missing"). It plots the permutation space and the observed test statistic. The plot is an histogram (see hist.flip.object) if there is only one test, while it is a biplot when there are more variables. In this case the arrows of the rotations are colored in red when the associated p-value(res)<=.05.

result

report table of results

show

report table of results

size

Returns the size of permT (i.e. number of permutations X number of tests)

sort

Sorts the tests to increasing p-values.

summary

Provides the call, the number of permutations. Option star.signif: =TRUE (default) set stars depending on the last column of p-values; =FALSE inhibits stars, ="p-value" or any other names indicates the column to which the stars refer.

Examples

Run this code
# NOT RUN {
showClass("flip.object")

y=matrix(rnorm(50),10,5)
colnames(y)=c("X1","X2","Y1","Y2","Y3")
res=flip(y)

## Sort by p-values
sort(res)

## Selecting tests
res[1:2]
#same as
res["X"]
#different from (it selects tests having "1" or "2" in the name)
res[c("1","2")]

## Concatenates two flip-objects
cFlip(res[1:2],res[5])


#plotting results
plot(flip(y))

#Get any slot of the flip-object. eg the permutation space:
head(getFlip(res,"permT"))
#Get any element of the list obj@data. eg Y:
getFlip(res,"Y")
#Get any columns of the results table: obj@res. eg Statistic (choose among colnames(obj@res) ):
getFlip(res,"Stat")
# }

Run the code above in your browser using DataLab