spearman | R Documentation |
Computes the Spearman's correlation.
spearman(x, y = x, remove_na = TRUE)
x |
( |
y |
( |
remove_na |
( |
Spearman's correlation coefficient is computed as:
where R is the rank of a variable, cov the covariance of two variables and sigma is the standard deviation.
A single numeric value with the Spearman's correlation.
Other numeric_metrics:
maape()
,
mae()
,
mse()
,
nrmse()
,
numeric_summary()
,
pearson()
,
r2()
,
rmse()
## Not run:
set.seed(1)
x <- rnorm(100)
spearman(x, x)
spearman(x, x + rnorm(100, 2))
spearman(x, x - 1)
spearman(x, x + 10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.