% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assoc.R
\name{assoc_measures}
\alias{assoc_measures}
\title{Association measures summary table}
\usage{
assoc_measures(
  x,
  type = c("all", "nominal", "ordinal"),
  conf_level = 0.95,
  digits = 3L
)
}
\arguments{
\item{x}{A contingency table (of class \code{table}).}

\item{type}{Which family of measures to compute:
\code{"all"} (default), \code{"nominal"}, or \code{"ordinal"}.}

\item{conf_level}{A number between 0 and 1 giving the confidence
level (default \code{0.95}). Set to \code{NULL} to omit the confidence
interval.}

\item{digits}{Number of decimal places used when printing the
result (default \code{3}).}
}
\value{
A data frame with columns \code{measure}, \code{estimate}, \code{se},
\code{ci_lower}, \code{ci_upper}, and \code{p_value}. For nominal measures
(Cramer's V, Phi, Contingency Coef.), the p-value comes from
the Pearson chi-squared test of independence. For all other
measures, it is a Wald z-test of H0: measure = 0.
}
\description{
\code{assoc_measures()} computes a range of association measures for a
two-way contingency table and returns them in a tidy data frame.
}
\details{
\code{type = "all"} (the default) returns all nominal and ordinal
measures. Use \code{type = "nominal"} or \code{type = "ordinal"} to
restrict the output to a single family.

The nominal family includes \code{\link[=cramer_v]{cramer_v()}}, \code{\link[=contingency_coef]{contingency_coef()}},
\code{\link[=lambda_gk]{lambda_gk()}}, \code{\link[=goodman_kruskal_tau]{goodman_kruskal_tau()}}, \code{\link[=uncertainty_coef]{uncertainty_coef()}},
and (for 2x2 tables) \code{\link[=phi]{phi()}} and \code{\link[=yule_q]{yule_q()}}.

The ordinal family includes \code{\link[=gamma_gk]{gamma_gk()}}, \code{\link[=kendall_tau_b]{kendall_tau_b()}},
\code{\link[=kendall_tau_c]{kendall_tau_c()}}, and \code{\link[=somers_d]{somers_d()}}.

Standard error formulas follow the DescTools implementations
(Signorell et al., 2024).
}
\examples{
tab <- table(sochealth$smoking, sochealth$education)
assoc_measures(tab)
assoc_measures(tab, type = "nominal")
assoc_measures(tab, type = "ordinal")

}
\references{
Agresti, A. (2002). \emph{Categorical Data Analysis} (2nd ed.). Wiley.

Liebetrau, A. M. (1983). \emph{Measures of Association}. Sage.

Signorell, A. et al. (2024). \emph{DescTools: Tools for Descriptive
Statistics}. R package.
}
\seealso{
\code{\link[=cramer_v]{cramer_v()}}, \code{\link[=gamma_gk]{gamma_gk()}}, \code{\link[=kendall_tau_b]{kendall_tau_b()}}
}
