Correlation: 'Correlation'

View source: R/covariancecorrelation.R

CorrelationR Documentation

Correlation

Description

Computes the correlation between two vectors, using weights if provided.

Usage

Correlation(x, y, weights = NULL, correlation = TRUE)

Arguments

x

A numeric vector.

y

A numeric vector.

weights

A numeric vector containing the value of the weight for each row of data. If weights is NULL then this function is just a wrapper for the base functions cov and cor.

correlation

If FALSE, returns the covariance.

Examples

x <- 1:10
y <- c(2, 2:10)
w <- rep(1, 10)
Correlation(x, y, w)

NumbersInternational/flipStatistics documentation built on April 12, 2024, 9:25 a.m.