delta {DeltaMAN} | R Documentation |
Compute the Delta coefficient
Description
delta()
computes Delta coefficient, or proportion of agreements that are not due to chance,
which is used to measure nominal agreement between two raters.
delta()
and Delta()
are synonyms.
Usage
delta(
data,
standard = FALSE,
fixedRows = FALSE,
rawdata = NULL,
tol = 1e-07,
mxits = 100
)
Delta(
data,
standard = FALSE,
fixedRows = FALSE,
rawdata = NULL,
tol = 1e-07,
mxits = 100
)
Arguments
data |
either a contingency table or raw data. |
standard |
a logical value indicating whether the observer on the rows of the contingency table (or first column of raw data) is a goldstandard (i.e., gives the correct responses). |
fixedRows |
a logical value indicating whether the row marginals are fixed in advance (sampling type II) or not (sampling type I). |
rawdata |
a logical value indicating whether the data is raw (TRUE) or a contingency table (FALSE). If not specified, the function will try to guess the data type. |
tol |
the desired tolerance applied to find the root of the unknown constant B, needed to estimate the model parameters. |
mxits |
the maximum numer of iterations applied to find the root of the unknown constant B, needed to estimate the model parameters. |
Details
The allowed input data type are (1) contingency tables (of class "table"
or "matrix"
) or (2) raw data (of class "data.frame"
).
If the data is of type (1), the empty classes (if any) are removed. If the data is of class (2), the function checks the number of columns (n) and throws an
error if n < 2 or n > 3. If n = 2, a frequency table is computed. If n = 3, it is assumed that one column represents the row index (normally, it is expected to be the first one).
Once the row index column is identified, it is removed and a frequency table is computed using the remaining two columns.
In all cases, the result is always a squared matrix, which will be used in the subsequent computation of the Delta coefficient.
The observer on the rows will be referred to as observer (or rater) R and the one on the columns will be referred to as observer (or rater) C.
The function returns a list of 9 elements (if the number of classes is >2):
Delta: This is a list of 2 elements: (1) the estimates of the model: overall delta (Delta), partial delta for class j (partial_delta) and the distribution of responses made at random by observer C (proportions); and the agreement measurements: agreement, conformity, predictivity and consistency (only some of the are shown, depending on the model assumed) (2) the standard error of the estimates under the model assumed (sampling type I or II).
Kappa: The estimate and standard error of the Cohen's Kappa coffiecient.
Data: Input data and analyzed data (may be the same)
GOF: Goodness of Fit for the Delta model. The chi squares statistic is computed. If the performed test is significative (p-value < alpha), the model Delta is not suitable for the data.
fixedRows: logical value that matches the "fixedRows" argument.
standard: logical value that matches the "standard" argument.
all.measures: This is a list including all the estimates and standard errors (disregarding the model assumed by the user).
problem.parameters: This list contains information about the estimation of the auxiliary constant B, needed to estimate the model parameters.
cov: This list contains 3 elements: the covariance matrix of the partial delta estimates; the covariance matrix of the proportion estimates; and the covariance matrix of the partial delta and proportion estimates.
If the number of classes is k = 2, another element is added to the aforementioned list, including the asymptotic analysis (asymptoticDelta).
Value
An object of class "delta"
, which is a list of 9 elements (or 10 if the dimension of the contingency table is 2x2). See details.
References
Andrés, A. M., & Marzo, P. F. (2004). Delta: A new measure of agreement between two raters. British journal of mathematical and statistical psychology, 57(1), 1-19.
Andrés, A. M., & Marzo, P. F. (2005). Chance-corrected measures of reliability and validity in KK tables. Statistical methods in medical research, 14(5), 473-492.
See Also
summary.delta()
for the summary method created for objects of class delta, and print.deltaMAN()
for the print method.
Examples
# Create a 3x3 matrix
m = matrix(c(15, 5, 0, 4, 21, 1, 3, 4, 25), ncol = 3)
# Compute the Delta coefficient assuming the rater on the rows
# is a goldstandard and type II sampling.
obj = delta(m, standard = TRUE, fixedRows = TRUE)
# Get the complete report
summary(obj, fullReport = TRUE)
# Create a 2x2 matrix
m = matrix(c(15, 7, 3, 21), ncol = 2)
# Compute the Delta coefficient assuming no one is a goldstandard
# and type I sampling.
obj = delta(m, standard = FALSE, fixedRows = FALSE)
# Get the report
summary(obj, fullReport = FALSE)