Weighted Pearson Correlation
Calculates weighted Pearson correlation coefficient between observed 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 missing values in |
... |
Further arguments passed to |
A length-one numeric vector.
weighted_cor(1:10, c(1, 1:9)) cor(1:10, c(1, 1:9)) weighted_cor(1:10, c(1, 1:9), w = rep(1, 10)) weighted_cor(1:10, c(1, 1:9), w = 1:10)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.