AlterCorrM: Alternatives to the Pearson correlation with p-values for...

Description Usage Arguments Details Note Examples

View source: R/AlterCorrM.R

Description

This function returns the value of the correlation between two matrix and its corresponding p-value for four types of coefficients; Pearson correlation (r), Maximum information coefficient (MIC); Random dependency coefficient (RDC) and Correlation of distances (dCor).

Usage

1
2
3
AlterCorrM(X, Y, type = c("pearson", "MIC", "RDC", "dCor"),
  comparison = c("all", "pairs"), R = 100, method = c("holm", "hochberg",
  "hommel", "bonferroni", "BH", "BY", "fdr", "none"))

Arguments

type

Specifies the type of correlations to compute. "Pearson" for the Pearson Correlation, "MIC" for the Maximum Information Coefficient, "RDC" for the Random Dependency Coefficient and finally "dCor" for the Correlation of Distances.

comparison

Method with which the correlations will be calculated. The "pairs" option is to compare two matrices that share rows and columns but the values are of different variables and we want to make pairwise comparisons. The case of "alls" is for when you have two matrices with a common dimension (observations, individuals, samples), and you want to calculate the correlations of all the variables with all.

R

Number of permutations to be made for MIC and dCor to calculate the p-values

method

Correction method. Can be abbreviated. The possible values are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none".

x

A numeric vector or matrix or dataframe

y

A numeric matrix or dataframe, with the same number of rows as x

Details

Depending on the selected comparison option, the correlation between each value of the matrix will be calculated with respect to the other matrix or it will be calculated in pairs.

Note

It is not recommended to use the MIC coefficient for large matrix or with a large number of repetitions, since it requires a high computational time.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#Correlations using the "pair" comparison
x<-replicate(20,rnorm(20, sd=2.5))
y<-2*x+replicate(20,rnorm(20, sd=2.5))
AlterCorrM(x,y,type="pearson",comparison="pairs",method="fdr")
AlterCorrM(x,y,type="MIC",comparison="pairs",R=50,method="fdr")
AlterCorrM(x,y,type="RDC",comparison="pairs",method="fdr")
AlterCorrM(x,y,type="dCor",comparison="pairs",R=100,method="fdr")

#Correlations using the "all" comparison
x<-replicate(5,rnorm(10, sd=2.5))
colnames(x)<-letters[1:ncol(x)]
y<-replicate(7,rnorm(10, mean=1.5, sd =0.85))
colnames(y)<-letters[1:ncol(y)]

AlterCorrM(x,y,type="pearson",comparison="all",method="fdr")
AlterCorrM(x,y,type="MIC",comparison="all",R=50,method="fdr")
AlterCorrM(x,y,type="RDC",comparison="all",method="fdr")
AlterCorrM(x,y,type="dCor",comparison="all",R=50,method="fdr")

AnaBPazos/AlterCorr documentation built on May 20, 2019, 4:24 p.m.