weighted.corr.cov.n: Multivariate correlation and covariance

View source: R/pv_rrepest_correlation.R View source: R/weighted_multivariate_corr_cov.R

weighted.corr.cov.nR Documentation

Multivariate correlation and covariance

Description

Computes multivariate correlation and covariance for the variables of interest.

Usage

weighted.corr.cov.n(
  data,
  x,
  w = rep(1, length(data[x[1]])),
  corr = TRUE,
  na.rm = TRUE
)

Arguments

data

(data frame) Data to analyse

x

(string vector) Variables of interest for which to compute the correlation/covariance

w

(string) Name of the numeric variable representing the weights

corr

(bool) if TRUE: Computes correlation; if FALSE: Computes covariance

na.rm

(bool) if TRUE: Excludes missing values before computing the correlation/covariance.

Value

Data frame containing each pairwise bivariate correlation/covariance

Examples

data(df_talis18)

weighted.corr.cov.n(df_talis18,c("t3stake","t3team","t3stud"),"tchwgt")


Rrepest documentation built on April 4, 2025, 2:07 a.m.