corr: Calculates the weighted correlation given a data set and a...

Description Usage Arguments Value

View source: R/corr.R

Description

This is a copy of corr function from the boot package. It calculates the correlation coefficient in weighted form.

Usage

1
corr(d, w = rep(1, nrow(d))/nrow(d))

Arguments

d

a matrix with two columns corresponding to the two variables whose correlation we wish to calculate.

w

a vector of weights to be applied to each pair of observations. The default is equal weights for each pair. Normalization takes place within the function so sum(w) need not equal 1.

Value

the correlation coefficient between d[,1] and d[,2].


PResiduals documentation built on Nov. 12, 2018, 5:04 p.m.