ww_agreement_coefficient {waywiser} | R Documentation |
Agreement coefficients and related methods
Description
These functions calculate the agreement coefficient and mean product difference (MPD), as well as their systematic and unsystematic components, from Ji and Gallo (2006). Agreement coefficients provides a useful measurement of agreement between two data sets which is bounded, symmetrical, and can be decomposed into systematic and unsystematic components; however, it assumes a linear relationship between the two data sets and treats both "truth" and "estimate" as being of equal quality, and as such may not be a useful metric in all scenarios.
Usage
ww_agreement_coefficient(data, ...)
## S3 method for class 'data.frame'
ww_agreement_coefficient(data, truth, estimate, na_rm = TRUE, ...)
ww_agreement_coefficient_vec(truth, estimate, na_rm = TRUE, ...)
ww_systematic_agreement_coefficient(data, ...)
## S3 method for class 'data.frame'
ww_systematic_agreement_coefficient(data, truth, estimate, na_rm = TRUE, ...)
ww_systematic_agreement_coefficient_vec(truth, estimate, na_rm = TRUE, ...)
ww_unsystematic_agreement_coefficient(data, ...)
## S3 method for class 'data.frame'
ww_unsystematic_agreement_coefficient(data, truth, estimate, na_rm = TRUE, ...)
ww_unsystematic_agreement_coefficient_vec(truth, estimate, na_rm = TRUE, ...)
ww_unsystematic_mpd(data, ...)
## S3 method for class 'data.frame'
ww_unsystematic_mpd(data, truth, estimate, na_rm = TRUE, ...)
ww_unsystematic_mpd_vec(truth, estimate, na_rm = TRUE, ...)
ww_systematic_mpd(data, ...)
## S3 method for class 'data.frame'
ww_systematic_mpd(data, truth, estimate, na_rm = TRUE, ...)
ww_systematic_mpd_vec(truth, estimate, na_rm = TRUE, ...)
ww_unsystematic_rmpd(data, ...)
## S3 method for class 'data.frame'
ww_unsystematic_rmpd(data, truth, estimate, na_rm = TRUE, ...)
ww_unsystematic_rmpd_vec(truth, estimate, na_rm = TRUE, ...)
ww_systematic_rmpd(data, ...)
## S3 method for class 'data.frame'
ww_systematic_rmpd(data, truth, estimate, na_rm = TRUE, ...)
ww_systematic_rmpd_vec(truth, estimate, na_rm = TRUE, ...)
Arguments
data |
A |
... |
Not currently used. |
truth |
The column identifier for the true results
(that is |
estimate |
The column identifier for the predicted
results (that is also |
na_rm |
A |
Details
Agreement coefficient values range from 0 to 1, with 1 indicating perfect
agreement. truth
and estimate
must be the same length. This function is
not explicitly spatial and as such can be applied to data with any number of
dimensions and any coordinate reference system.
Value
A tibble with columns .metric, .estimator, and .estimate and 1 row of values.
For grouped data frames, the number of rows returned will be the same as the number of groups.
For _vec()
functions, a single value (or NA).
References
Ji, L. and Gallo, K. 2006. "An Agreement Coefficient for Image Comparison." Photogrammetric Engineering & Remote Sensing 72(7), pp 823–833, doi: 10.14358/PERS.72.7.823.
See Also
Other agreement metrics:
ww_willmott_d()
Other yardstick metrics:
ww_global_geary_c()
,
ww_global_moran_i()
,
ww_local_geary_c()
,
ww_local_getis_ord_g()
,
ww_local_moran_i()
,
ww_willmott_d()
Examples
# Calculated values match Ji and Gallo 2006:
x <- c(6, 8, 9, 10, 11, 14)
y <- c(2, 3, 5, 5, 6, 8)
ww_agreement_coefficient_vec(x, y)
ww_systematic_agreement_coefficient_vec(x, y)
ww_unsystematic_agreement_coefficient_vec(x, y)
ww_systematic_mpd_vec(x, y)
ww_unsystematic_mpd_vec(x, y)
ww_systematic_rmpd_vec(x, y)
ww_unsystematic_rmpd_vec(x, y)
example_df <- data.frame(x = x, y = y)
ww_agreement_coefficient(example_df, x, y)
ww_systematic_agreement_coefficient(example_df, x, y)
ww_unsystematic_agreement_coefficient(example_df, x, y)
ww_systematic_mpd(example_df, x, y)
ww_unsystematic_mpd(example_df, x, y)
ww_systematic_rmpd(example_df, x, y)
ww_unsystematic_rmpd(example_df, x, y)