Learn R Programming

scmamp (version 0.2.55)

customPost: Function to use custom tests to perform post hoc comparisons.

Description

This function computes the raw p-values for all vs. all or all vs. control comparisons using a custom function.

Usage

customPost(data, control = NULL, test, ...)

Arguments

data
Data set (matrix or data.frame) to apply the test. The column names are taken as the groups and the values in the matrix are the samples.
control
Either the number or the name of the column for the control algorithm. If this parameter is not provided, the all vs all comparison is performed.
test
Function to perform the test. It requires two parameters, x and y, the two samples to be compared, and it has to return a list that contains, at least, one element called p.value (as the htest objects that are usually returned by R's statistical test implementations).
...
Additional parameters for the test function.

Value

A matrix with all the pairwise raw p-values.

Examples

Run this code
data(data_gh_2008)
test <- function(x, y, ...) {
  t.test(x, y, paired=TRUE)
}
customPost(data.gh.2008, control=1, test=test)
customPost(data.gh.2008, test=test)

Run the code above in your browser using DataLab