% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/criterion.R
\name{spearman_sq}
\alias{spearman_sq}
\alias{spearman_sq.numeric}
\title{Spearman Correlation Squared}
\usage{
spearman_sq(r1, r2)

\method{spearman_sq}{numeric}(r1, r2)
}
\arguments{
\item{r1, r2}{Two vectors of paired ranks.}
}
\value{
The square of Spearman's rank correlation coefficient with NA values removed.
}
\description{
The square of Spearman's rank correlation coefficient applied to two rankings \insertCite{spearman_proof_1904}{lakhesis}. Rows with \code{NA} values are automatically removed.
}
\examples{
# e.g., for two partial seriations:
x <- c(1, 2, 3, 4, NA, 5, 6, NA, 7.5, 7.5, 9)
y <- c(23, 17, 19, NA, 21, 22, 25, 26, 27, 36, 32)
spearman_sq(x, y)

}
\references{
\insertAllCited{}
}
