Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

smc

Simple Matching Coefficient and Cohen's Kappa


Description

Computes the values of (or the distance based on) the simple matching coefficient or Cohen's Kappa, respectively, for each pair of rows of a matrix.

Usage

smc(x, dist = FALSE)
cohen(x, dist = FALSE)

Arguments

x

a matrix consisting of integers between 1 and n.cat, where n.cat is the number of levels the variables in x can take. Missing values are allowed.

dist

should the distance based on the simple matching coefficient or Cohen's Kappa, respectively, be computed? Note that, e.g., smc(x, dist = TRUE) is equal to 1 - smc(x, dist = FALSE).

Value

A matrix with nrow(x) columns and rows containing the distances or similarities.

Author(s)

Holger Schwender, holger.schwender@udo.edu

See Also

Examples

## Not run: 
# Generate a data set consisting of 10 rows and 200 columns,
# where the values are randomly drawn from the integers 1, 2, and 3.

mat <- matrix(sample(3, 2000, TRUE), 10)

# For each pair of row, the value of the simple matching coefficient
# can be obtained by

smc(mat)

# and the distance based on the SMC by

smc(mat, dist = TRUE)


## End(Not run)

scrime

Analysis of High-Dimensional Categorical Data Such as SNP Data

v1.3.5
GPL-2
Authors
Holger Schwender, with a contribution of Arno Fritsch
Initial release
2018-12-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.