association_matrix: Mixed-type association matrix

View source: R/metrics.R

association_matrixR Documentation

Mixed-type association matrix

Description

Computes pairwise association for data with numeric and categorical variables: Spearman correlation for numeric–numeric pairs, bias-corrected Cramér's V for categorical–categorical pairs, and the correlation ratio \eta (on ranks) for numeric–categorical pairs. Pairwise complete observations are used.

Usage

association_matrix(data, vars = NULL)

Arguments

data

A data frame.

vars

Optional subset of variables.

Value

A symmetric matrix with ones on the diagonal.

References

Bergsma, W. (2013). A bias-correction for Cramér's V and Tschuprow's T. Journal of the Korean Statistical Society, 42(3), 323–328. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jkss.2012.10.002")}

Examples

round(association_matrix(iris), 2)

SynthesizerPlus documentation built on Oct. 16, 2026, 5:10 p.m.