Description Usage Arguments Details Value Author(s)
Fast Computation of Pearson and Spearman Correlation Coefficient
1 2 3 4 5 6 7 8 |
x |
a matrix or data.frame. Data is internally coerced to numeric representation. |
y |
vector (numeric or factor). Internally coerced to numeric representation. |
method |
a character stating the method to used. Default is "pearson". |
partial |
a logical stating if correlation among x should be account for y. Default is T. |
weights |
a numeric vector of weights used to computed weighted correlations. |
digits |
an integer defining the precision of round function. Default is 3 |
This implementation uses matrix operations for fast computation of correlation coefficients. A drawback of this approach is that the data must be complete, that is no NA values. This function implements a fast mean imputation step where the NA values are substituted by 0 after the data been scaled as part of the algorithm for fast computation of the correlation.
a list with two components, x and y, storing the inter-correlations among x and the correlations of x with y respectively. The component x is a symmetric squared matrix and the component y is a numeric vector.
David Senhora Navega
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.