spw: The Superwise function

Description Usage Arguments Details Value

View source: R/spw.R

Description

Pairwise statistical tests! Wiser than Supermatrix. This function allows you to perform multiple pairwise association tests between two sets of data, containing numeric/categorical and categorical data, respectively, and to adjust reulting p-values by different methods. See details for more information.

Usage

1
spw(x, v1, v2, fisher.method = "exact", correction = NULL, control = TRUE)

Arguments

x

A data frame containing your data. See details for more information.

v1

A range of columns containing phenotypic data in x. Data can be either quantitative (numeric) or qualitative (factor). Example: 1:20, for 20 columns of trait data, located in the first 20 columns.

v2

A range of columns containing genotypic data in x. Example: 20:40, for 20 sites located in columns 20 to 40.

fisher.method

Indicates which method should be used for Fisher's tests. "exact" is default. For big datasets with a high number of categories, other methods might be useful. "sim" simulates p-values using 20000 Monte Carlo iterations, and "hybrid" will use hybrid method (see fisher.test for more details on Fisher's methods).

correction

In case that p-value correction for multiple tests is required, use this parameter to specify which correction must be used. See ?p.adjust for details of available correction methods. It is possible to have more than one correction in one go, using a vector with correction names in the p.adjust function fashion (e.g. c("bonferroni", "fdr", "hochberg")). Each correction will add a column to the output.

control

Used as a internal control helper, to check that supermatrix performed the tests accordingly to variables' type.If TRUE, two columns indicating whether (1) the trait value was identified as numeric, and (2) the name of the test used for that column vs. genotypic data.

Details

Superwise function was designed to perform multiple pairwise association analyses between two sets of phenotypic vs genotypic data. Set1 must ideally contain phenotypic data (in columns), which can be quantitative (e.g. number of offspring, weight, etc) or categorical unordered (e.g. diurnal/nocturnal, herbivore/carnivore/omnivore) data. Set2 must ideally contain categorical unordered data, such as which amino-acid in a specific site in a proteic sequence Such data should be distributed in columns, using rows for each species to be included in the analyses. So far, superwise performs only Kruskal-Wallis test for numeric vs. categorical variables, and Fisher's Exact Test for categorical vs. categorical variables. The recommended format is a single data.frame containing the two sets of data to be compared pairwise. NOTE: Categorical data must be of factor class.

Value

A data frame with the results of each test, including P-values and adjusted P-values (if requested).


GRealesM/superwise documentation built on May 28, 2019, 12:38 p.m.