Skip to contents

This is one of the main worker functions behind get_corr(). It calculates weighted correlations and outputs the data as a one row tibble.

Usage

wtd_corr(data, x, y, wt)

Arguments

data

An object of type data.frame or tibble. If piping the data into the function, this is not required.

x, y

Can be either character strings or symbols. Name of two variables in the data you want to calculate the correlation between.

wt

Can be either character strings or symbols. Weights. Add if you have a weighting variable and want to get weighted correlations

Value

A one row tibble showing correlations (correlation), number of observations (n), low and high confidence intervals (conf.low, conf.high), the p-value (p.value), and stars indicating it's statistical significance.