Skip to contents

Hand-rolled base-R implementation. When the psych package is installed, results agree with psych::alpha()$total to numerical precision.

Usage

morie_psymet_alpha(data, ci = 0.95)

Arguments

data

Numeric matrix or data.frame: items as columns, respondents as rows.

ci

Confidence level (default 0.95).

Value

A list with components raw, std, avgr, k, n, ci_lo, ci_hi.

Examples

set.seed(1)
f <- rnorm(50)
X <- sapply(1:5, function(j) sqrt(0.6) * f + sqrt(0.4) * rnorm(50))
colnames(X) <- paste0("i", 1:5)
res <- morie_psymet_alpha(X)
res$raw
#> [1] 0.8247525