assoc: Association and Correlation Measures

nom.ccR Documentation

Association and Correlation Measures

Description

Compute association and correlation measures for categorical and ordinal data.

The following measures are implemented:

  • nom.cc: Corrected contingency coefficient for nominal data.

  • nom.cramer: Cramer's V (or Phi) for nominal data.

  • ord.spearman: Spearman's rank correlation for ordinal data.

  • ord.kendall: Kendall's rank correlation for ordinal data.

Usage

nom.cc(tab, correct = FALSE)

nom.cramer(tab, ...)

ord.spearman(tab, ...)

ord.kendall(tab, ...)

cc_coef(tab, correct = FALSE)

cramer_vf(tab, ...)

cramer_coef(tab, ...)

kendall_corr(tab, ...)

spearman_corr(tab, ...)

rs_corr(tab, ...)

Arguments

tab

A contingency table (matrix or table) with absolute frequencies.

correct

Logical, whether to apply a correction (default: FALSE). Only used for nom.cc.

...

Additional parameters passed to correlation functions.

Details

These functions provide common measures of association:

  • Nominal data: nom.cc, nom.cramer.

  • Ordinal data: ord.spearman, ord.kendall.

Value

A numeric value representing the association or correlation measure.

Examples

# Create a random contingency table
tab <- matrix(round(10 * runif(15)), ncol = 5)

# Nominal association
nom.cc(tab)
nom.cc(tab, correct = TRUE)
nom.cramer(tab)

# Ordinal correlation
ord.spearman(tab)
ord.kendall(tab)

# Using aliases
cc_coef(tab)
cramer_vf(tab)
spearman_corr(tab)
kendall_corr(tab)
rs_corr(tab)

exams.forge documentation built on Aug. 21, 2025, 5:41 p.m.