weighted.corr.cov.n {Rrepest} | R 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")
[Package Rrepest version 1.5.4 Index]