dfcor {simba} | R Documentation |
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.
dfcor(ox, y, method = "pearson", permutations = 1000, ...)
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 ). |
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
.
A list with the following:
call |
The function call |
method |
P-value obtained by testing the initial correlation against the permuted correlation values. |
out |
A table with statistics. See details below. |
gesN |
The included number of cases. |
strata |
The number of variables against which x was tested. |
permutations |
The 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. |
corr |
Correlation value (regarding to method ). |
sig |
P-value obtained by testing the initial correlation against the permuted correlation values. |
nop |
Number of included pairs. The function tests for complete cases before calculation starts. Pairs containing NA's are not included. |
miss |
Number of missing pairs. |
Maybe pcol
will get this functionality in future releases.
Gerald Jurasinski
Legendre, P, & Legendre, L. (1998) Numerical Ecology. 2nd English Edition. Elsevier.
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.