% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assoc.R
\name{yule_q}
\alias{yule_q}
\title{Yule's Q}
\usage{
yule_q(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 H0: Q = 0 (Wald z-test).
}
\description{
\code{yule_q()} computes Yule's Q coefficient of association for a 2x2
contingency table.
}
\details{
For a 2x2 table with cells \eqn{a, b, c, d}, Yule's Q is
\eqn{Q = (ad - bc) / (ad + bc)}.
It is equivalent to the Goodman-Kruskal Gamma for 2x2 tables.
The asymptotic standard error is
\eqn{SE = 0.5 (1 - Q^2) \sqrt{1/a + 1/b + 1/c + 1/d}}.
Standard error formulas follow the DescTools implementations
(Signorell et al., 2024); see \code{\link[=cramer_v]{cramer_v()}} for full references.
}
\examples{
tab <- table(sochealth$smoking, sochealth$sex)
yule_q(tab)

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