spearman_sq: Spearman Correlation Squared

View source: R/criterion.R

spearman_sqR Documentation

Spearman Correlation Squared

Description

The square of Spearman's rank correlation coefficient applied to two rankings \insertCitespearman_proof_1904lakhesis. Rows with NA values are automatically removed.

Usage

spearman_sq(r1, r2)

## S3 method for class 'numeric'
spearman_sq(r1, r2)

Arguments

r1, r2

Two vectors of paired ranks.

Value

The square of Spearman's rank correlation coefficient with NA values removed.

References

\insertAllCited

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)


lakhesis documentation built on April 25, 2026, 5:06 p.m.