alpha_sensitivity: Sensitivity of Cronbach's alpha to scale design parameters

View source: R/alpha_sensitivity.R

alpha_sensitivityR Documentation

Sensitivity of Cronbach's alpha to scale design parameters

Description

Computes how Cronbach's alpha changes as a function of either the average inter-item correlation (\bar{r}) or the number of items (k), holding the other parameter constant.

Usage

alpha_sensitivity(
  data = NULL,
  k = NULL,
  r_bar = NULL,
  vary = c("r_bar", "k"),
  k_range = NULL,
  r_bar_range = NULL,
  plot = TRUE,
  digits = 3
)

Arguments

data

A data frame or matrix of item responses. If provided, k and \bar{r} are computed from the data.

k

Number of items. Required if data is not supplied.

r_bar

Average inter-item correlation. Required if data is not supplied.

vary

Character string indicating which parameter to vary: "r_bar" (default) or "k".

k_range

Numeric vector of item counts to evaluate when vary = "k". Default is 2:20.

r_bar_range

Numeric vector of average inter-item correlations to evaluate when vary = "r_bar". Default is seq(0.05, 0.9, by = 0.05).

plot

Logical; if TRUE, a base R plot is produced. Default is TRUE.

digits

Number of decimal places for rounding output. Default is 3.

Details

The function supports two modes:

  • Empirical: derive k and \bar{r} from a dataset

  • Theoretical: specify k and \bar{r} directly

Value

A data frame with columns:

  • k: number of items

  • r_bar: average inter-item correlation

  • alpha: Cronbach's alpha

The returned object includes an attribute "baseline" containing the reference k and \bar{r} values.

See Also

alpha, reliability

Examples

# Theoretical example

## Not run: 
alpha_sensitivity(k = 6) # produces plot

## End(Not run)

alpha_sensitivity(k = 6, r_bar = 0.4, plot = FALSE)

# Vary number of items
alpha_sensitivity(k = 6, r_bar = 0.4, vary = "k", plot = FALSE)

# Empirical example
df <- data.frame(
  V1 = c(1, 2, 3, 4, 5),
  V2 = c(3, 2, 4, 2, 5),
  V3 = c(2, 1, 5, 4, 3)
)

## Not run: 
alpha_sensitivity(data = df) # produces plot

## End(Not run)

alpha_sensitivity(df, vary = "r_bar", plot = FALSE)

alpha_sensitivity(df, vary = "k", plot = FALSE)


LikertMakeR documentation built on March 23, 2026, 9:07 a.m.