| wtd.cors {weights} | R Documentation |
wtd.cors produces a Pearsons correlation coefficient comparing two variables or matrices.
wtd.cors(x, y=NULL, weight=NULL)
x |
|
y |
|
weight |
|
A matrix of the estimated correlation coefficients.
Marcus Schwemmle at GfK programmed the C code, R wrapper by Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).
wtd.cor
stdz
wtd.t.test
wtd.chi.sq
test <- c(1,1,1,1,1,1,2,2,2,3,3,3,4,4) t2 <- rev(test) weight <- c(.5,.5,.5,.5,.5,1,1,1,1,2,2,2,2,2) wtd.cors(test, t2) wtd.cors(test, t2, weight)