weighted.cor: Weighted correlation

Description Usage Arguments Value Examples

View source: R/Module1_code.R

Description

takes bivarate data and weights (g) and returns a weighted correlation

Usage

1

Arguments

data

a matrix or dataframe in which the first two columns contain the two vectors for which the weighted correlation is sought

g

a vector of weights

Value

the weighted correlation

Examples

1
2
3
df <- data.frame(norm = rnorm(10), unif = runif(10))
weights <- rep(1/10, 10)
weighted.cor(df, weights)

EllaKaye/Module1 documentation built on May 6, 2019, 3:25 p.m.