wtd.cors: Produces weighted correlations quickly using C.
Description
wtd.cors produces a Pearsons correlation coefficient comparing two variables or matrices.
Usage
wtd.cors(x, y=NULL, weight=NULL)
Value
A matrix of the estimated correlation coefficients.
Arguments
x
x should be a matrix or vector which the researcher wishes to correlate with y.
y
y should be a numerical vector or matrix which the researcher wishes to correlate with x. If y is NULL, x will be used instead
weight
weight is an optional vector of weights to be used to determining the weighted mean and variance for calculation of the correlations.
Author
Marcus Schwemmle at GfK programmed the C code, R wrapper by Josh Pasek, Professor of Communication & Media and Political Science at the University of Michigan (www.joshpasek.com).