hicorrSP: Highly correlated indicators in the same aggregation group

Description Usage Arguments Value See Also Examples

View source: R/coin_rew8r.R

Description

This returns a data frame of any highly correlated indicators within the same aggregation group. The level of the aggregation group can be controlled by the grouplev argument.

Usage

1
2
3
4
5
6
7
hicorrSP(
  COIN,
  dset = "Normalised",
  hicorval = 0.9,
  cortype = "pearson",
  grouplev = NULL
)

Arguments

COIN

Data frame with first col indicator codes, second is weights, third is correlations

dset

The data set to use for correlations.

hicorval

A threshold to flag high correlation. Default 0.9.

cortype

The type of correlation, either "pearson" (default), "spearman" or "kendall". See stats::cor.

grouplev

The level to group indicators in. E.g. if grouplev = 2 it will look for high correlations between indicators that belong to the same group in Level 2.

Value

A data frame with one entry for every indicator pair that is highly correlated within the same group, at the specified level. Pairs are only reported once, i.e. only uses the upper triangle of the correlation matrix.

See Also

Examples

1
2
3
4
# Assemble ASEM COIN
ASEM <- assemble(IndData = ASEMIndData, IndMeta = ASEMIndMeta, AggMeta = ASEMAggMeta)
# check for any within-pillar correlations of > 0.7
hicorrSP(ASEM, dset = "Raw", hicorval = 0.7, , grouplev = 2)

COINr documentation built on Nov. 30, 2021, 9:06 a.m.