get_denom_corr {COINr} | R Documentation |
Correlations between indicators and denominators
Description
Get a data frame containing any correlations between indicators and denominators that exceed a given threshold. This can be useful when whether to denominate an indicator and by what may not be obvious. If an indicator is strongly correlated with a denominator, this may suggest to denominate it by that denominator.
Usage
get_denom_corr(
coin,
dset,
cor_thresh = 0.6,
cortype = "pearson",
nround = 2,
use_directions = FALSE
)
Arguments
coin |
A coin class object. |
dset |
The name of the data set to apply the function to, which should be accessible in |
cor_thresh |
A correlation threshold: the absolute value of any correlations between indicator-denominator pairs above this threshold will be flagged. |
cortype |
The type of correlation: to be passed to the |
nround |
Optional number of decimal places to round correlation values to. Default 2, set |
use_directions |
Logical: if |
Value
A data frame of pairwise correlations that exceed the threshold.
Examples
# build example coin
coin <- build_example_coin(up_to = "new_coin", quietly = TRUE)
# get correlations >0.7 of any indicator with denominators
get_denom_corr(coin, dset = "Raw", cor_thresh = 0.7)