mixed_assoc: Mixed pairwise association

View source: R/mixed_assoc.R

mixed_assocR Documentation

Mixed pairwise association

Description

Calculate a pairwise association between all variables in a data-frame. In particular nominal vs nominal with Chi-square, numeric vs numeric with Pearson correlation, and nominal vs numeric with ANOVA. Adapted from https://stackoverflow.com/a/52557631/590437

Usage

mixed_assoc(df, cor_method = "spearman", adjust_cramersv_bias = TRUE)

Arguments

df

a data.frame

cor_method

the method to use, one of c("pearson", "kendall", "spearman"); (Default: spearman)

adjust_cramersv_bias

Use bias corrected Cramer's V as described in rcompanion::cramerV(); (Default: TRUE)

Value

a list with two elements:

  • associations a data.frame with the pairwise association between each variable

  • assoc_matrix a square matrix of association scores between each variable, with dimensions equal to the number of variables.


drejom/helpeRs documentation built on Aug. 26, 2022, 4:52 a.m.