Learn R Programming

WGCNA (version 0.95)

corAndPvalue: Calculation of correlations and associated p-values

Description

A faster, one-step calculation of Student correlation p-values for multiple correlations, properly taking into account the actual number of observations.

Usage

corAndPvalue(x, y, 
             use = "pairwise.complete.obs", 
             alternative = c("two.sided", "less", "greater"),
             ...)

Arguments

x
a vector or a matrix
y
a vector or a matrix. If NULL, the correlation of columns of x will be calculated.
use
determines handling of missing data. See cor for details.
alternative
specifies the alternative hypothesis and must be (a unique abbreviation of) one of "two.sided", "greater" or "less". the initial letter. "greater" corresponds to positive a
...
other arguments to the function cor.

Value

  • A list with the following components
  • corthe calculated correlations
  • pthe Student p-values corresponding to the calculated correlations

Details

The function calculates correlations of a matrix or of two matrices and the corresponding Student p-values. The output is not as full-featured as cor.test, but can work with matrices as input.

See Also

cor for calculation of correlations only;

cor.test for another function for significance test of correlations