This function performs an agreement analysis including intra-class correlation coefficients, group-related variance, and related diagnostics for items with a nominal or ordinal scale. The function outputs a data.frame or a HTML table giving the results.

nice_agreement_table(
  data,
  vars = names(data),
  grouping,
  rv,
  crit = 0.7,
  min_group_size = 0,
  auto_labels = TRUE,
  labels = NULL,
  n_sim = 10000
)

agreement_analysis(
  data,
  vars = names(data),
  grouping,
  rv,
  crit = 0.7,
  min_group_size = 0,
  auto_labels = TRUE,
  labels = NULL,
  n_sim = 10000
)

Arguments

data

A data-frame

vars

Vector of character strings with names of variables to be analyzed.

grouping

Grouping variable. Either as a character string or a vector.

rv

Number of response options for calculating random variance.

crit

Critical agreement level.

min_group_size

Minimal group size. Smaller groups are excluded.

auto_labels

If TRUE, variable names are taken from a label attribute.

labels

Character vector with new variable labels.

n_sim

Number of simulations for the agreement analyses.

Value

A Data-frame

Examples


vars <- c("Norm_Pop_academic", "Norm_Pop_conform", "Norm_Pop_sporty",
  "Norm_Pop_cool_clothes", "Norm_Pop_helpful", "Norm_Unpop_academic",
  "Norm_Unpop_nonconform", "Norm_Unpop_sporty", "Norm_Unpop_cool_clothes",
  "Norm_Unpop_language", "Norm_LM_academic", "Norm_LM_conform",
  "Norm_LM_sporty", "Norm_LM_cool_clothes", "Norm_LM_helpful",
  "Norm_LL_academic", "Norm_LL_nonconform", "Norm_LL_sporty", "Norm_LL_cool_clothes",
  "Norm_LL_language")

nice_agreement_table(
    data = wmisc:::ex_agreement,
    vars = vars,
    grouping = "id_class_teacher",
    rv = 4,
    crit = 0.6,
    n_sim = 100)
Table
Within group agreement analysis
Label
N
Class size
Rwg
ICC(1)
ICC(2)
Ratings Classes Min Max Min Max Mean ≥ 0.6 CI > CI ICC L icc p icc
Academic + 1702 114 1 27 0 1.00 0.13 6.1% 0.45 10.5% 0.10 69.7 0.000 0.62
Conform 1695 114 1 27 0 1.00 0.10 2.6% 0.43 7% 0.09 53.3 0.000 0.59
Sporty + 1694 114 1 27 0 1.00 0.12 7.9% 0.38 10.5% 0.09 54.8 0.000 0.60
Clothes + 1691 114 1 27 0 0.94 0.09 4.4% 0.44 8.8% 0.08 48.7 0.000 0.57
Helpful 1692 114 1 27 0 1.00 0.16 11.4% 0.45 14% 0.10 64.5 0.000 0.62
Academic - 1146 87 1 27 0 1.00 0.23 13.8% 0.47 21.8% 0.03 4.2 0.039 0.27
Non-conform 1145 87 1 27 0 0.79 0.15 4.6% 0.42 14.9% 0.14 76.9 0.000 0.68
Sporty - 1143 87 1 27 0 1.00 0.14 5.7% 0.42 13.8% 0.05 14.5 0.000 0.42
Clothes - 1144 87 1 27 0 1.00 0.15 8% 0.41 16.1% 0.05 11.4 0.001 0.39
Language skills 1143 87 1 27 0 0.89 0.13 6.9% 0.52 10.3% 0.05 11.1 0.001 0.38
Academic + 1760 117 1 27 0 1.00 0.17 6.8% 0.43 13.7% 0.15 130.0 0.000 0.72
Conform 1765 117 1 27 0 0.89 0.09 1.7% 0.45 4.3% 0.10 73.0 0.000 0.62
Sporty + 1767 117 1 27 0 1.00 0.06 2.6% 0.33 5.1% 0.08 48.8 0.000 0.55
Clothes + 1761 117 1 27 0 1.00 0.18 11.1% 0.31 22.2% 0.11 82.8 0.000 0.65
Helpful 1761 117 1 27 0 1.00 0.23 16.2% 0.33 30.8% 0.08 56.2 0.000 0.58
Academic - 1142 87 1 27 0 1.00 0.30 19.5% 0.45 29.9% 0.05 11.5 0.001 0.38
Non-conform 1145 87 1 27 0 1.00 0.14 9.2% 0.52 10.3% 0.09 34.8 0.000 0.57
Sporty - 1142 87 1 27 0 1.00 0.16 10.3% 0.35 18.4% 0.05 13.2 0.000 0.42
Clothes - 1143 87 1 27 0 1.00 0.28 25.3% 0.45 29.9% 0.08 29.1 0.000 0.54
Language skills 1140 87 1 27 0 1.00 0.24 17.2% 0.49 23% 0.10 39.9 0.000 0.60
Note. Rwg is the within group agreement. CI is the upper bound of a 95% inteval of rwg. ICC(1) is the intra-class correlation (i.e. the amount of individual-level variance that can be explained by group membership). L is the likelihood ratio. ICC(2) is the reliability of the group means. Groups with less than 0 cases were removed from the analysis.