agreement | R Documentation |
The default function returns the proportion of overall agreement between two or more raters. Specific agreements can be obtained as well. Specific agreement (averages over discordant cells to correct for random rater combinations). When there are 2 categories, this is equal to the positive/negative agreement. When there are more than two categories, one can either look at the agreement for one category versus the others, for example very satisfied versus rest or for one category versus one specific other category, for example very satisfies versus not satisfied.
agreement(
data,
specific = NULL,
confint = FALSE,
alpha = 0.05,
n = nrow(data),
k = ncol(data),
b = 1000,
...
)
data |
A data frame or table with equal number of columns and rows. Or a data frame that contains the scores for each rater in each column. |
specific |
A character vector indicating the category for which specific
agreement should be calculated. If |
confint |
logical vector if confidence interval for agreements are computed. |
alpha |
the confidence interval level |
n |
sample size; default |
k |
number of raters; default |
b |
number of bootstrap iterations for bootstrapped CI |
... |
options for sumtable if |
De confidence intervals are obtained and adjusted with a Fleis continuity correction. For the specific agreements with polytomous data, the confidence intervals are bootstrapped.
An S3 object containing the proportion of overall agreement.
#dichotomous
df <- data.frame(r1=factor(c(1,0,1,0,0,1,1,0,0,0,1,1,0,1,1)),
r2=factor(c(1,1,1,1,0,1,1,0,0,0,1,1,0,1,0)),
r3=factor(c(1,1,1,0,0,0,1,1,1,0,0,1,0,1,1)),
r4=factor(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)))
table <- sumtable(df=df, ratings=c("r1", "r2", "r3", "r4"),
levels=c("0","1"))
agreement(table)
agreement(table, specific = "1")
agreement(table, specific = "1", confint = TRUE)
agreement(table, specific = "positive")
agreement(df)
agreement(df, specific = "1")
agreement(df, specific = "positive")
agreement(df, specific = "negative")
#polytomous
df <- data.frame(r1=factor(c(1,2,2,0,3,3,1,0,3,0,2,2,0,3,1)),
r2=factor(c(1,1,1,0,3,3,1,0,1,0,2,2,0,2,1)),
r3=factor(c(1,1,1,3,3,2,1,0,1,0,2,2,0,3,1)),
r4=factor(c(1,2,1,0,3,3,1,0,3,0,2,2,0,2,1)))
table <- sumtable(df=df, ratings=c("r1", "r2", "r3", "r4"),
levels=c("0","1", "2", "3"))
agreement(table, specific = c("3", "1"))
agreement(table, specific = c("3", "1", "2"))
agreement(table, specific = c(3))
agreement(table, specific = c("3", "1"), confint = TRUE)
agreement(df, specific = c("3", "1"), confint = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.