% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assoc.R
\name{contingency_coef}
\alias{contingency_coef}
\title{Pearson's contingency coefficient}
\usage{
contingency_coef(
  x,
  detail = FALSE,
  conf_level = 0.95,
  digits = 3L,
  .include_se = FALSE
)
}
\arguments{
\item{x}{A contingency table (of class \code{table}).}

\item{detail}{Logical. If \code{FALSE} (default), return the estimate
as a numeric scalar. If \code{TRUE}, return a named numeric vector
including confidence interval and p-value.}

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

\item{digits}{Number of decimal places used when printing the
result (default \code{3}). Only affects the \code{detail = TRUE} output.}

\item{.include_se}{Internal parameter; do not use.}
}
\value{
Same structure as \code{\link[=cramer_v]{cramer_v()}}: a scalar when
\code{detail = FALSE}, a named vector when \code{detail = TRUE}.
The p-value tests the null hypothesis of no association
(Pearson chi-squared test). CI values are \code{NA} because no
standard asymptotic SE exists for C.
}
\description{
\code{contingency_coef()} computes Pearson's contingency coefficient C
for a two-way contingency table.
}
\details{
The contingency coefficient is
\eqn{C = \sqrt{\chi^2 / (\chi^2 + n)}}.
It ranges from 0 (independence) to a maximum that depends on
the table dimensions. No standard asymptotic standard error exists,
so the confidence interval is not computed.
}
\examples{
tab <- table(sochealth$smoking, sochealth$education)
contingency_coef(tab)

}
\seealso{
\code{\link[=cramer_v]{cramer_v()}}, \code{\link[=assoc_measures]{assoc_measures()}}
}
