Learn R Programming

rel (version 1.4.2)

gac: Gwet's AC1 and AC2

Description

Calculates Gwet's AC as index of agreement for two observations of nominal, ordinal, or ratio scale data.

Usage

gac(data = NULL, kat = NULL, weight = c("unweighted","linear","quadratic","ratio"),
    conf.level = 0.95)

Arguments

data

A matrix with n subjects and two observations (n*2 matrix)

kat

Number of possible categories

weight

A character string specifying "unweighted", "linear", "quadratic" or "ratio", or a numeric kat*kat matrix with custom weights (see details).

conf.level

Confidence level of the interval.

Value

method

Analysis name

obs

Number of observations

sample

Sample size

est

Point estimate

se

Standard error

lb

Lower confidence boundary

ub

Upper confidence boundary

cont.table

contingency table

data

analyzed data

Details

Gwet's AC has the advantage of not relying on independence between observations (Gwet, 2008), making it suitable for data with dependent measurements. Weights are based on weighted dissimilarities (diagonal = 1, off-diagonal < 1). Linear weights decrease equally with distance from the diagonal and quadratic weights decrease exponentially with distance from the diagonal. Custom weights should be specified as a kat*kat matrix with values <= 1. Incomplete cases are omitted listwise and the confidence interval is based on a t distribution.

References

Gwet, K. L. (2008). Computing inter-rater reliability and its variance in the presence of high agreement. British Journal of Mathematical and Statistical Psychology 61, 29-48.

Examples

Run this code
# NOT RUN {
#Sample data: 200 subjects and one 5-category item.
data <- cbind(sample(1:5,200, replace=TRUE),sample(1:5,200, replace=TRUE))

#A numeric kat*kat matrix with custom weights 
cw <- diag(ncol(matrix(0,5,5)))
cw[cw!=diag(cw)] <- runif(20,0,1)

#AC1
gac(data=data, kat=5, weight="unweighted", conf.level = 0.95)

#AC2 with custom weights
gac(data=data, kat=5, weight=cw, conf.level = 0.95)
# }

Run the code above in your browser using DataLab