corrlate: Matrix of Correlations, P-values and confidence intervals

Description Usage Arguments Details Value Author(s) See Also Examples

Description

correlate uses cor to find the correlations and use cor.test to find the p values, confidence intervals for all possible pairs of columns ofmatrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
correlate(
  x,
  y = NULL,
  cor.test = FALSE,
  method = "pearson",
  use = "everything",
  p.adjust = FALSE,
  p.adjust.method = "holm",
  ...
)

fast_correlate(
  x,
  y = NULL,
  p.adjust = FALSE,
  p.adjust.method = "holm",
  use = "everything",
  ...
)

fast_correlate2(
  x,
  method = "pearson",
  p.adjust = FALSE,
  p.adjust.method = "holm",
  ...
)

Arguments

x, y

a matrix object or NULL.

cor.test

logical, if TRUE (default) will test for correlation.

method

a character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman".

use

an optional character string giving a method for computing covariances in the presence of missing values.

p.adjust

logical, if TRUE (default) will adjust p value for multiple comparisons.

p.adjust.method

correction method.

...

extra params, see Details.

Details

The columns of 'x' will be tested for each pair when y is NULL(the default), otherwise each column in 'x' and each column in 'y' is tested for each pair.

Value

a list with correlation matrix, P values matrix, confidence intervals matrix.

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

See Also

cor, cor.test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
correlate(mtcars)
m1 <- matrix(rnorm(100), nrow = 10)
m2 <- matrix(rnorm(60), nrow = 10)

## not test for correlation matrix
correlate(m1, m2)

## test for correlation matrix
correlate(m1, m2, cor.test = TRUE)

## adjust p value
correlate(m1, m2, cor.test = TRUE, p.adjust = TRUE)

## fast compute correlation
## Not run: 
require(WGCNA)
fast_correlate(m1, m2)

require(picante)
  fast_correlate2(m1)

## End(Not run)

houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.