The function calculates a weighted Pearson correlation coefficient between variable A and B using wtd.cor.

calculate_wgt_cor(d.sub, x, y)

Arguments

d.sub

a dataframe with data.

x

character string of the name of variable A.

y

character string of the name of variable B.

Value

the numeric value of the correlation coefficient.