fcbw: Fast Computation of Pearson and Spearman Correlation...

Description Usage Arguments Details Value Author(s)

View source: R/fcbw.R

Description

Fast Computation of Pearson and Spearman Correlation Coefficient

Usage

1
2
3
4
5
6
7
8
fcbw(
  x,
  y,
  method = c("pearson", "spearman"),
  partial = T,
  weights = NULL,
  digits = 3
)

Arguments

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

Details

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.

Value

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.

Author(s)

David Senhora Navega


dsnavega/cbfsr documentation built on Jan. 1, 2021, 12:07 a.m.