powered by
Calculates weighted Pearson correlation coefficient between observed and predicted values by the help of stats::cov.wt.
stats::cov.wt
weighted_cor(actual, predicted, w = NULL, na.rm = FALSE, ...)
A length-one numeric vector.
Observed values.
Predicted values.
Optional case weights.
Should missing values in observed or predicted be removed? Default is FALSE.
observed
predicted
FALSE
Further arguments passed to stats::cov.wt.
weighted_mean.
weighted_mean
weighted_cor(1:10, c(1, 1:9)) weighted_cor(1:10, c(1, 1:9), w = 1:10)
Run the code above in your browser using DataLab