nom.cc | R Documentation |
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.
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, ...)
tab |
A contingency table (matrix or table) with absolute frequencies. |
correct |
Logical, whether to apply a correction (default: |
... |
Additional parameters passed to correlation functions. |
These functions provide common measures of association:
Nominal data: nom.cc
, nom.cramer
.
Ordinal data: ord.spearman
, ord.kendall
.
A numeric value representing the association or correlation measure.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.