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