apa_reliability: Reliability and item analysis table

View source: R/reliability.R

apa_reliabilityR Documentation

Reliability and item analysis table

Description

Makes an APA-style table of the reliability of one or more scales: for each item, its mean, standard deviation, corrected item-total correlation, and Cronbach's \alpha if the item were deleted, followed for each scale by the scale score's mean and standard deviation, Cronbach's \alpha with its confidence interval, McDonald's \omega_{\text{total}}, and the mean inter-item correlation.

Usage

apa_reliability(
  data,
  scales = NULL,
  reverse = NULL,
  item_range = NULL,
  level = c("items", "scales"),
  omega = TRUE,
  ci = 0.95,
  score = c("mean", "sum"),
  flag = NULL,
  format_variable_names = TRUE,
  digits = 2
)

Arguments

data

data frame of item responses

scales

named list of the items of each scale, given as unquoted or quoted names or tidyselect helpers (e.g., list(Agreeableness = c(A1, A2, A3), Conscientiousness = starts_with("C"))). A named list of character vectors stored in a variable works too. If NULL (default), all columns of data form one scale.

reverse

items to reverse-score before the analysis, selected like the items in scales (e.g., c(A1, C4, C5)). Items are reversed within their scale's range of responses (item_range), and they are marked "(R)" in the table.

item_range

lowest and highest possible responses, used to reverse items. If NULL (default), the lowest and highest responses observed in each scale are used.

level

"items" (default) for item rows followed by each scale's statistics, or "scales" for one row per scale.

omega

if TRUE (default), McDonald's \omega_{\text{total}} is shown

ci

confidence level of the interval of \alpha

score

"mean" (default) or "sum": how scale scores are computed

flag

NULL (default) or a number: item-total correlations below it, and \alpha-if-deleted values above the scale's \alpha, are bolded (e.g., flag = .30), and the note says so. TRUE is the same as .30. This works like flag in apa_collinearity().

format_variable_names

if TRUE (default), item and scale names are lightly formatted: underscores become spaces, and the first letter is capitalized (item codes such as "A1" stay intact). Set to FALSE to keep names exactly as they are.

digits

number of decimal places (unaffected by apa7_defaults(accuracy = ))

Details

The corrected item-total correlation (r~it~) is the item's correlation with the sum of the other items in its scale. Items with low values (often, below .30) discriminate poorly. \alpha if deleted is the scale's \alpha without the item; values above the scale's \alpha mean that the item lowers reliability.

Cronbach's \alpha, the item statistics, and the mean inter-item correlation come from psych::alpha(). The confidence interval of \alpha is Feldt's. \omega_{\text{total}} is computed from a one-factor model (psych::fa(), minimum residual): (\sum\lambda)^2 / ((\sum\lambda)^2 + \sum\psi).

Each scale uses the respondents who answered all of its items, and the note gives their number. Scale scores are the means of the items (or their sums, with score = "sum").

When all items of a scale are scored 0 and 1 (e.g., incorrect and correct answers), M is the item's difficulty (the proportion of 1s), r~it~ is the corrected point-biserial correlation, and \alpha equals KR-20. The note says so.

Value

apa7_tbl (tibble)

References

Feldt, L. S., Woodruff, D. J., & Salih, F. A. (1987). Statistical inference for coefficient alpha. Applied Psychological Measurement, 11(1), 93–103. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/014662168701100107")}

McDonald, R. P. (1999). Test theory: A unified treatment. Lawrence Erlbaum. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.4324/9781410601087")}

Examples

d <- psych::bfi
apa_reliability(
  d,
  scales = list(
    Agreeableness = paste0("A", 1:5),
    Conscientiousness = paste0("C", 1:5)
  ),
  reverse = c("A1", "C4", "C5"),
  item_range = c(1, 6)
)

# One row per scale, with items selected by tidyselect helpers
apa_reliability(
  d,
  scales = list(
    Agreeableness = A1:A5,
    Conscientiousness = starts_with("C")
  ),
  reverse = c(A1, C4, C5),
  item_range = c(1, 6),
  level = "scales"
)

apa7 documentation built on Dec. 1, 2026, 5:06 p.m.