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
)

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
N
Class size
Rwg
ICC(1)
p icc ICC(2)
Label Ratings Classes Min Max Min Max Mean ≥ 0.6 CI > CI ICC L icc
Norm_Pop_academic Academic + 1702 114 1 27 0 1.00 0.13 6.1% 0.44 10.5% 0.10 69.7 0.000 0.62
Norm_Pop_conform Conform 1695 114 1 27 0 1.00 0.10 2.6% 0.44 7% 0.09 53.3 0.000 0.59
Norm_Pop_sporty Sporty + 1694 114 1 27 0 1.00 0.12 7.9% 0.33 13.2% 0.09 54.8 0.000 0.60
Norm_Pop_cool_clothes Clothes + 1691 114 1 27 0 0.94 0.09 4.4% 0.35 10.5% 0.08 48.7 0.000 0.57
Norm_Pop_helpful Helpful 1692 114 1 27 0 1.00 0.16 11.4% 0.47 14% 0.10 64.5 0.000 0.62
Norm_Unpop_academic Academic - 1146 87 1 27 0 1.00 0.23 13.8% 0.42 23% 0.03 4.2 0.039 0.27
Norm_Unpop_nonconform Non-conform 1145 87 1 27 0 0.79 0.15 4.6% 0.33 23% 0.14 76.9 0.000 0.68
Norm_Unpop_sporty Sporty - 1143 87 1 27 0 1.00 0.14 5.7% 0.41 13.8% 0.05 14.5 0.000 0.42
Norm_Unpop_cool_clothes Clothes - 1144 87 1 27 0 1.00 0.15 8% 0.41 16.1% 0.05 11.4 0.001 0.39
Norm_Unpop_language Language skills 1143 87 1 27 0 0.89 0.13 6.9% 0.41 11.5% 0.05 11.1 0.001 0.38
Norm_LM_academic Academic + 1760 117 1 27 0 1.00 0.17 6.8% 0.49 12% 0.15 130.0 0.000 0.72
Norm_LM_conform Conform 1765 117 1 27 0 0.89 0.09 1.7% 0.34 6.8% 0.10 73.0 0.000 0.62
Norm_LM_sporty Sporty + 1767 117 1 27 0 1.00 0.06 2.6% 0.38 3.4% 0.08 48.8 0.000 0.55
Norm_LM_cool_clothes Clothes + 1761 117 1 27 0 1.00 0.18 11.1% 0.35 21.4% 0.11 82.8 0.000 0.65
Norm_LM_helpful Helpful 1761 117 1 27 0 1.00 0.23 16.2% 0.33 30.8% 0.08 56.2 0.000 0.58
Norm_LL_academic Academic - 1142 87 1 27 0 1.00 0.30 19.5% 0.53 23% 0.05 11.5 0.001 0.38
Norm_LL_nonconform 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
Norm_LL_sporty Sporty - 1142 87 1 27 0 1.00 0.16 10.3% 0.41 17.2% 0.05 13.2 0.000 0.42
Norm_LL_cool_clothes Clothes - 1143 87 1 27 0 1.00 0.28 25.3% 0.52 26.4% 0.08 29.1 0.000 0.54
Norm_LL_language Language skills 1140 87 1 27 0 1.00 0.24 17.2% 0.45 26.4% 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.