weighted_cor | R Documentation |
Calculates weighted Pearson correlation coefficient between actual and predicted
values by the help of stats::cov.wt()
.
weighted_cor(actual, predicted, w = NULL, na.rm = FALSE, ...)
actual |
Observed values. |
predicted |
Predicted values. |
w |
Optional case weights. |
na.rm |
Should observations with missing values in |
... |
Further arguments passed to |
A length-one numeric vector.
weighted_cor(1:10, c(1, 1:9))
weighted_cor(1:10, c(1, 1:9), w = 1:10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.