Description Usage Arguments Details Value Note Examples
Calculates Cohen's κ (kappa) coefficient for two equal length vectors.
1 | cohensKappa(x, y, adjusted = TRUE)
|
x |
vector, coerced to factor. |
y |
vector, coerced to factor. |
adjusted |
logical. If |
Cohen's kappa coefficient measures the agreement between two categorical vectors. Zero indicates that the agreement is no better than expected by chance, while a value of one indicates perfect correspondence.
If adjusted=TRUE, returns the kappa coefficient [-1,1]. If adjusted=FALSE, returns ordinary accuracy [0,1].
Cases with NA in either input vector are ignored.
1 2 3 4 | x <- crcTCGAsubset$CMS
cohensKappa(x, x) # equals 1
replicate(10, cohensKappa(x, sample(x))) # expectation = 0
replicate(10, cohensKappa(x, sample(x), adjusted=FALSE)) # expectation > 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.