Learn R Programming

simba (version 0.2-5)

dfcor: Calculate permuted (Mantel) correlations between one and many variables

Description

The function uses permcor2 to calculate permuted correlation on vectors. One vector is compared to various vectors of the same length. Useful e.g. if one variable has to be tested against various variables.

Usage

dfcor(ox, y, method = "pearson", permutations = 1000, ...)

Arguments

ox
Numeric vector. If it is a similarity matrix (i.e. a dist object, extract vector via as.vector(x) beforehand).
y
A data.frame containing numeric vectors to correlate x with. Number of rows has to equal the length of x
method
Method for correlation. Defaults to "pearson". See cor for other possibilities.
permutations
Number of permutations. Defaults to 1000, which gives reasonable results and allows to test against alpha = 0.001.
...
Further arguments passed to internal functions (i.e. to cor).

Value

  • A list with the following:
  • callThe function call
  • methodP-value obtained by testing the initial correlation against the permuted correlation values.
  • outA table with statistics. See details below.
  • gesNThe included number of cases.
  • strataThe number of variables against which x was tested.
  • permutationsThe number of permutations.
  • The included printing method gives nice output (where information appears in a slightly different order) ending with the table of out. It is based on a data.frame with nrow = ncol(y) giving the statistics for the correlation between x and each column of y as follows.
  • corrCorrelation value (regarding to method).
  • sigP-value obtained by testing the initial correlation against the permuted correlation values.
  • nopNumber of included pairs. The function tests for complete cases before calculation starts. Pairs containing NA's are not included.
  • missNumber of missing pairs.

Details

dfcor is a wrapper for permcor2, which is usually called as a part of pcol. Here, the numeric vector in x is compared to each column vector of y.

References

Legendre, P, & Legendre, L. (1998) Numerical Ecology. 2nd English Edition. Elsevier.

See Also

For related functions of simba permcor, permcor2, mancor, pcol. Further see mantel of package vegan for a different implementation of permuted correlation on distance matrices.