% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/23_Chatterjee.R
\name{chatterjee_xi}
\alias{chatterjee_xi}
\title{Chatterjee's xi correlation coefficient}
\usage{
chatterjee_xi(x, y, ties_method = "random")
}
\arguments{
\item{x}{Numeric or ordered factor (predictor)}

\item{y}{Numeric or ordered factor (response)}

\item{ties_method}{How to break ties in x. Default "random".}
}
\value{
Numeric scalar: Chatterjee's xi value.
}
\description{
Computes Chatterjee's (2021) rank-based correlation coefficient xi.
Unlike Pearson or Spearman, xi is asymmetric: xi(x, y) and xi(y, x)
may differ. This asymmetry is the basis for direction-detection in
graphical models.
}
\details{
For tied x values, ranks are broken using \code{ties_method}. With
\code{"random"} (the default), each call may produce a slightly
different value due to random tie-breaking. Use \code{xi_stable()}
to average over many randomizations.
}
\examples{
\donttest{
x <- rnorm(100)
y <- x^2 + rnorm(100, sd = 0.1)
chatterjee_xi(x, y) # near 1, since y is determined by x
chatterjee_xi(y, x) # smaller, since x is not determined by y
}
}
\references{
Chatterjee, S. (2021). A new coefficient of correlation. Journal of
the American Statistical Association, 116(536), 2009-2022.
}
