View source: R/gk_gamma_helpers.R
| gk_gamma_vec | R Documentation |
Computes the Goodman-Kruskal gamma coefficient directly from two
numeric vectors, bypassing table() for speed. Uses manual
tabulation with integer indexing and cumulative sums for efficient
concordant/discordant pair counting.
gk_gamma_vec(x, y)
x |
Integer or numeric vector (e.g., item scores). |
y |
Integer or numeric vector of the same length (e.g., rest scores). |
A scalar: the gamma coefficient in [-1, 1], or
NA_real_ if the table has fewer than 2 rows or 2 columns.
Goodman, L. A. & Kruskal, W. H. (1954). Measures of association for cross classifications. Journal of the American Statistical Association, 49(268), 732–764.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.