Skip to content

GAgreement & reliability · reliability.alpha

Internal consistency (Cronbach's α, McDonald's ω)

Do the items of a scale measure the same thing consistently?

Cronbach's α (raw and standardized) with the Feldt confidence interval, item statistics (corrected item–total correlation, α if the item is dropped) and McDonald's ω from a one-factor maximum-likelihood factor analysis — ω does not assume that every item is equally strongly related to the construct.

Verified in Python and R Python and R agree to 6 decimals

A real result

Example “Attitude”, recorded in both engines. In the app, “Try this example” loads it into Analyze.

Internal consistencyRecorded · Python and R agreeRecorded 2026-11-17 · 43 values compared
R

α = .84, 95% CI [.74, .92]

Cronbach's α
0.8431
95% CI
[0.7394, 0.9158]
Standardized α
0.8391
McDonald's ω
0.8405

Effect size

  • Cronbach's α 0.8431 95% CI [0.7394, 0.9158]

Plots

Inter-item correlationsWhat do the values of a square or rectangular result matrix look like at a glance?
View data
Item r (text)Itemr
rating1.00rating1
complaints0.83rating0.8254
privileges0.43rating0.4261
learning0.62rating0.6237
raises0.59rating0.5901
critical0.16rating0.1564
advance0.16rating0.1551
rating0.83complaints0.8254
complaints1.00complaints1
privileges0.56complaints0.5583
learning0.60complaints0.5967
raises0.67complaints0.6692
critical0.19complaints0.1877
advance0.22complaints0.2246
rating0.43privileges0.4261
complaints0.56privileges0.5583
privileges1.00privileges1
learning0.49privileges0.4933
raises0.45privileges0.4455
critical0.15privileges0.1472
advance0.34privileges0.3433
rating0.62learning0.6237
complaints0.60learning0.5967
privileges0.49learning0.4933
learning1.00learning1
raises0.64learning0.6403
critical0.12learning0.1160
advance0.53learning0.5316
rating0.59raises0.5901
complaints0.67raises0.6692
privileges0.45raises0.4455
learning0.64raises0.6403
raises1.00raises1
critical0.38raises0.3769
advance0.57raises0.5742
rating0.16critical0.1564
complaints0.19critical0.1877
privileges0.15critical0.1472
learning0.12critical0.1160
raises0.38critical0.3769
critical1.00critical1
advance0.28critical0.2833
rating0.16advance0.1551
complaints0.22advance0.2246
privileges0.34advance0.3433
learning0.53advance0.5316
raises0.57advance0.5742
critical0.28advance0.2833
advance1.00advance1

Assumptions

  • Items scored in the same direction — Every item correlates positively with the rest of the scale.
  • One underlying factor — Weak items (corrected item–total r < .30): critical.
  • Sample size — 30 complete respondents — the interval is wide.

Item statistics

ItemMeanSDCorrected item–total rα if droppedLoading (one factor)
rating64.63312.1730.67130.80980.8525
complaints66.60013.3150.74210.79690.9022
privileges53.13312.2350.56070.82780.5927
learning56.36711.7370.71440.80300.7307
raises64.63310.3970.78630.79540.7650
critical74.7679.8950.26500.86390.2461
advance42.93310.2890.46080.84050.3778
  • α from the item covariance matrix (n − 1); ω total = (Σλ)² / ((Σλ)² + Σψ) from a one-factor ML fit of the correlation matrix.
Python

α = .84, 95% CI [.74, .92]

Cronbach's α
0.8431
95% CI
[0.7394, 0.9158]
Standardized α
0.8391
McDonald's ω
0.8405

Effect size

  • Cronbach's α 0.8431 95% CI [0.7394, 0.9158]

To keep this page light, the plots are shown once, under the R tab.

Assumptions

  • Items scored in the same direction — Every item correlates positively with the rest of the scale.
  • One underlying factor — Weak items (corrected item–total r < .30): critical.
  • Sample size — 30 complete respondents — the interval is wide.

Item statistics

ItemMeanSDCorrected item–total rα if droppedLoading (one factor)
rating64.63312.1730.67130.80980.8525
complaints66.60013.3150.74210.79690.9022
privileges53.13312.2350.56070.82780.5927
learning56.36711.7370.71440.80300.7307
raises64.63310.3970.78630.79540.7650
critical74.7679.8950.26500.86390.2461
advance42.93310.2890.46080.84050.3778
  • α from the item covariance matrix (n − 1); ω total = (Σλ)² / ((Σλ)² + Σψ) from a one-factor ML fit of the correlation matrix.

Do it in CodeSplash Run it on your own data, in Python or R, with the code to prove it.

Worked examples in the app

  • Attitudeattitude · items: rating, complaints, privileges, learning, raises, critical, advance
  • Likert reversedlikert_sim · items: q1, q2, q3, q4 (reversed), q5, q6
  • Two items no omegaattitude · items: rating, complaints
  • Degenerate constantattitude · items: rating, complaints, privileges, learning, raises, critical, advance
  • Degenerate n2attitude · items: rating, complaints, privileges, learning, raises, critical, advance
  • Degenerate n3attitude · items: rating, complaints, privileges, learning, raises, critical, advance

In the guides

Where it sits in the decision guides

  • Internal consistency: Cronbach's α, ω · Statistics Guide · G — Agreement / reliability

What you need

Itemsnumeric · 2–200 columns
The scale's items, scored in the same direction (reverse-code negatively worded items first). Rows with a missing item are left out.

Choices you make

hypothesis

Confidence leveldefault 0.95

How sure the intervals should be: 0.95 gives 95% confidence intervals. Higher confidence means wider intervals.

statistics

McDonald's ω (one-factor model)default on

Fit a one-factor maximum-likelihood factor analysis and report ω total and the loadings.

Checks and remedies

CodeSplash checks each testable assumption on every run and shows the result on the card; premises the data can’t test are marked. If a check fails, these are the ways forward.

  • Items scored in the same direction

    A negative corrected item–total correlation usually means the item needs reverse coding.

  • One underlying factor

    α and ω (total) describe one construct; low loadings suggest the item measures something else.

  • Sample size

    Stable estimates need enough respondents (often 100 or more).

What it reports

alpha
The false-positive rate you accept before looking at the data, usually 0.05.
alpha_low
A range of effect values compatible with your data at the chosen confidence level.
alpha_high
A range of effect values compatible with your data at the chosen confidence level.
alpha_std
A reliability estimate from how a scale's items covary. It assumes each item measures the factor equally well.
mean_r
A number from −1 to 1 for how closely two variables move together; Pearson measures straight-line association.
n
How many independent units the analysis used; it sets precision and power.
k
How many groups, studies or clusters the analysis used. Many methods are less reliable when k is small.
omega
A model of how big the next move is likely to be, built from recent shocks and recent volatility. It says nothing about direction.

Per group, level or term: item_total_r[<item>], alpha_if_deleted[<item>], item_mean[<item>], item_sd[<item>], loading[<item>]

Python and R

Python and R agree to 6 decimals (relative tolerance 1e-10). Python uses pandas, numpy, scipy, codesplash; R uses stats, nanoparquet, codesplashr.

Default traps between the two languages

  • α and item statistics are closed form (P0). ω comes from the same EM iterations in both engines (codesplash.stats.reliability.omega_1f ↔ cs_omega_1f) run to 1e-12; factanal's own optimizer agrees to its tolerance (≈ 1e-6).
Python

The exact script CodeSplash ran for example “Attitude” · Python 3.13.5 · scipy 1.18.1 · pandas 3.1.0

# Internal consistency (Cronbach's α, McDonald's ω)
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method reliability.alpha 1.0.1 · spec 9608a335a3376f93
# Dataset: attitude (version 1)
# Runs on its own: outside the app, cs.publish() writes $CS_RESULT_PATH or prints the result JSON.

# %% Setup
import numpy as np
import pandas as pd

import codesplash as cs
from codesplash.stats import reliability as rl  # α and one-factor ω (twins of R's cs_alpha / cs_omega_1f)

# %% Data
df = pd.read_parquet("tests/parity/fixtures/attitude.parquet", columns=["rating", "complaints", "privileges", "learning", "raises", "critical", "advance"])
n_input = len(df)
df = df.dropna(subset=["rating", "complaints", "privileges", "learning", "raises", "critical", "advance"])  # listwise deletion over the analysis columns
n_dropped = n_input - len(df)
warnings = []
if n_dropped:
    warnings.append(cs.cs_warning("CS_W_ROWS_DROPPED", dropped=n_dropped, total=n_input))
if n_input and not len(df):
    cs.cs_error("CS_E_NO_ROWS")
cs.check_finite_columns(df, ["rating", "complaints", "privileges", "learning", "raises", "critical", "advance"])  # infinite values stop the run (registry/errors.yaml)

# %% Cronbach's alpha
items = ["rating", "complaints", "privileges", "learning", "raises", "critical", "advance"]
X = df[items].to_numpy(dtype=float)
n, k = X.shape
if n < 3:
    cs.cs_error("CS_E_TOO_FEW_ROWS", what="Cronbach's α", min=3, n=n)
for j, item in enumerate(items):
    if len(np.unique(X[:, j])) < 2:  # its correlations (standardized α, item–total r, ω) would be 0 / 0
        cs.cs_error("CS_E_CONSTANT", column=item)
conf = 0.95
res = rl.alpha(X, conf)
values = {"alpha": res["alpha"], "alpha_low": res["ci_low"], "alpha_high": res["ci_high"], "alpha_std": res["alpha_std"],
          "mean_r": res["mean_r"], "n": float(n), "k": float(k), "omega": None}

# %% McDonald's omega (one-factor ML factor analysis, EM)
om = None
if True and k >= 3:
    if n <= k:  # the correlation matrix is singular with no more respondents than items
        warnings.append(cs.cs_warning("CS_W_SMALL_SAMPLE", n=n, consequence="McDonald's ω needs more respondents than items, so it is not reported."))
    else:
        om = rl.omega_1f(res["R"])
        if om["converged"]:
            values["omega"] = om["omega"]
nan = lambda x: None if x is None or not np.isfinite(x) else float(x)  # noqa: E731
rows = []
for j, item in enumerate(items):
    load = float(om["loadings"][j]) if om and om["converged"] else None
    values[f"item_mean[{item}]"], values[f"item_sd[{item}]"] = float(res["item_mean"][j]), float(res["item_sd"][j])
    values[f"item_total_r[{item}]"] = float(res["item_total"][j])
    values[f"alpha_if_deleted[{item}]"] = nan(res["if_deleted"][j])
    values[f"loading[{item}]"] = load
    rows.append({"item": item, "mean": float(res["item_mean"][j]), "sd": float(res["item_sd"][j]), "r_drop": float(res["item_total"][j]),
                 "alpha_drop": nan(res["if_deleted"][j]), "loading": load})

# %% Assumptions
neg = [items[j] for j in range(k) if res["item_total"][j] < 0]
weak = [items[j] for j in range(k) if 0 <= res["item_total"][j] < 0.3]
assumptions = [
    {"key": "item_direction", "label": "Items scored in the same direction", "status": "warn" if neg else "pass",
     "detail": f"Negative corrected item–total correlation for {', '.join(neg)} — reverse-code before computing α." if neg
     else "Every item correlates positively with the rest of the scale."},
    {"key": "unidimensionality", "label": "One underlying factor", "status": "warn" if weak else "pass",
     "detail": f"Weak items (corrected item–total r < .30): {', '.join(weak)}." if weak else "Every item correlates at least .30 with the rest of the scale."},
    {"key": "sample_size", "label": "Sample size", "status": "warn" if n < 100 else "pass",
     "detail": f"{n} complete respondents" + (" — the interval is wide." if n < 100 else ".")},
]
if om and not om["converged"]:
    warnings.append("The one-factor model did not converge; ω is not reported.")

# %% Result
pct = f"{conf:.0%}"
R = res["R"]
cs.publish({
    "method": "reliability.alpha",
    "methodVersion": "1.0.1",
    "title": "Internal consistency",
    "engine": cs.engine_info("numpy", "scipy", "codesplash"),
    "n": int(n),
    "summary": f"Cronbach's α = {res['alpha']:.3f}, {pct} CI [{res['ci_low']:.3f}, {res['ci_high']:.3f}] for {k} items"
    + (f"; ω = {values['omega']:.3f}." if values["omega"] is not None else "."),
    "apa": f"α = {cs.fmt_num(res['alpha'], 2, leading_zero=False)}, {pct} CI [{cs.fmt_num(res['ci_low'], 2, leading_zero=False)}, {cs.fmt_num(res['ci_high'], 2, leading_zero=False)}]",
    "statistics": [{"key": "alpha", "label": "Cronbach's α", "value": res["alpha"]}, {"key": "ci", "label": f"{pct} CI", "value": [res["ci_low"], res["ci_high"]]},
                   {"key": "alpha_std", "label": "Standardized α", "value": res["alpha_std"]}]
    + ([{"key": "omega", "label": "McDonald's ω", "value": values["omega"]}] if values["omega"] is not None else []),
    "tables": [{"key": "items", "title": "Item statistics", "columns": [
        {"key": "item", "label": "Item", "type": "string"}, {"key": "mean", "label": "Mean", "type": "number"},
        {"key": "sd", "label": "SD", "type": "number"}, {"key": "r_drop", "label": "Corrected item–total r", "type": "number"},
        {"key": "alpha_drop", "label": "α if dropped", "type": "number"}, {"key": "loading", "label": "Loading (one factor)", "type": "number"},
    ], "rows": rows}],
    "effectSizes": [{"key": "alpha", "label": "Cronbach's α", "value": res["alpha"], "ciLow": res["ci_low"], "ciHigh": res["ci_high"],
                     "ciLevel": conf, "method": "Feldt (1965) F interval"}],
    "assumptions": assumptions,
    "warnings": warnings,
    "notes": ["α from the item covariance matrix (n − 1); ω total = (Σλ)² / ((Σλ)² + Σψ) from a one-factor ML fit of the correlation matrix."],
    "charts": [cs.chart("corr", "matrix-heatmap", "Inter-item correlations", {
        "row": cs.col("Item", [a for a in items for _ in items], "categorical", levels=items),
        "col": cs.col("Item ", [b for _ in items for b in items], "categorical", levels=items),
        "value": cs.col("r", R.ravel().tolist(), "numeric"),
        "label": cs.col("r (text)", [f"{x:.2f}" for x in R.ravel()], "categorical"),
    }, controls={"scale": "diverging", "min": -1, "max": 1})],
    "values": values,
})
R

The exact script CodeSplash ran for example “Attitude” · R version 4.5.1 (2025-06-13)

# Internal consistency (Cronbach's α, McDonald's ω)
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method reliability.alpha 1.0.1 · spec 9608a335a3376f93
# Dataset: attitude (version 1)
# Runs on its own: outside the app, cs_publish() writes $CS_RESULT_PATH or prints the result JSON.

# %% Setup
library(codesplashr)

# %% Data
df <- as.data.frame(nanoparquet::read_parquet("tests/parity/fixtures/attitude.parquet", col_select = c("rating", "complaints", "privileges", "learning", "raises", "critical", "advance")))
n_input <- nrow(df)
df <- df[stats::complete.cases(df[c("rating", "complaints", "privileges", "learning", "raises", "critical", "advance")]), , drop = FALSE]  # listwise deletion
df[] <- lapply(df, function(x) if (is.factor(x)) droplevels(x) else x)
n_dropped <- n_input - nrow(df)
warnings <- list()
if (n_dropped > 0) {
  warnings <- c(warnings, cs_warning("CS_W_ROWS_DROPPED", dropped = n_dropped, total = n_input))
}
if (n_input > 0 && nrow(df) == 0) cs_error("CS_E_NO_ROWS")
cs_check_finite_columns(df, c("rating", "complaints", "privileges", "learning", "raises", "critical", "advance"))  # infinite values stop the run (registry/errors.yaml)

# %% Cronbach's alpha
items <- c("rating", "complaints", "privileges", "learning", "raises", "critical", "advance")
X <- as.matrix(df[items])
n <- nrow(X)
k <- ncol(X)
if (n < 3) cs_error("CS_E_TOO_FEW_ROWS", what = "Cronbach's α", min = 3, n = n)
for (j in seq_len(k)) {
  # its correlations (standardized alpha, item-total r, omega) would be 0 / 0
  if (length(unique(X[, j])) < 2) cs_error("CS_E_CONSTANT", column = items[j])
}
conf <- 0.95
res <- cs_alpha(X, conf)  # twin of codesplash.stats.reliability.alpha
values <- list(alpha = res$alpha, alpha_low = res$ci_low, alpha_high = res$ci_high, alpha_std = res$alpha_std,
               mean_r = res$mean_r, n = n, k = k, omega = NA)

# %% McDonald's omega (one-factor ML factor analysis, EM)
om <- NULL
if (TRUE && k >= 3) {
  if (n <= k) {  # the correlation matrix is singular with no more respondents than items
    warnings <- c(warnings, cs_warning("CS_W_SMALL_SAMPLE", n = n, consequence = "McDonald's ω needs more respondents than items, so it is not reported."))
  } else {
    om <- cs_omega_1f(res$R)
    if (om$converged) values$omega <- om$omega
  }
}
fin <- function(x) if (is.null(x) || !is.finite(x)) NA else unname(x)
rows <- list()
for (j in seq_len(k)) {
  item <- items[j]
  load <- if (!is.null(om) && om$converged) om$loadings[j] else NA
  values[[sprintf("item_mean[%s]", item)]] <- unname(res$item_mean[j])
  values[[sprintf("item_sd[%s]", item)]] <- unname(res$item_sd[j])
  values[[sprintf("item_total_r[%s]", item)]] <- res$item_total[j]
  values[[sprintf("alpha_if_deleted[%s]", item)]] <- fin(res$if_deleted[j])
  values[[sprintf("loading[%s]", item)]] <- load
  rows[[j]] <- list(item = item, mean = unname(res$item_mean[j]), sd = unname(res$item_sd[j]), r_drop = res$item_total[j],
                    alpha_drop = fin(res$if_deleted[j]), loading = load)
}

# %% Assumptions
neg <- items[res$item_total < 0]
weak <- items[res$item_total >= 0 & res$item_total < 0.3]
assumptions <- list(
  list(key = "item_direction", label = "Items scored in the same direction", status = if (length(neg)) "warn" else "pass",
       detail = if (length(neg)) sprintf("Negative corrected item–total correlation for %s — reverse-code before computing α.", paste(neg, collapse = ", "))
                else "Every item correlates positively with the rest of the scale."),
  list(key = "unidimensionality", label = "One underlying factor", status = if (length(weak)) "warn" else "pass",
       detail = if (length(weak)) sprintf("Weak items (corrected item–total r < .30): %s.", paste(weak, collapse = ", "))
                else "Every item correlates at least .30 with the rest of the scale."),
  list(key = "sample_size", label = "Sample size", status = if (n < 100) "warn" else "pass",
       detail = paste0(sprintf("%d complete respondents", n), if (n < 100) " — the interval is wide." else "."))
)
if (!is.null(om) && !om$converged) warnings <- c(warnings, "The one-factor model did not converge; ω is not reported.")

# %% Result
pct <- sprintf("%.0f%%", conf * 100)
R <- res$R
cs_publish(list(
  method = "reliability.alpha",
  methodVersion = "1.0.1",
  title = "Internal consistency",
  engine = cs_engine_info("stats", "codesplashr"),
  n = n,
  summary = paste0(sprintf("Cronbach's α = %.3f, %s CI [%.3f, %.3f] for %d items", res$alpha, pct, res$ci_low, res$ci_high, k),
                   if (!is.na(values$omega)) sprintf("; ω = %.3f.", values$omega) else "."),
  apa = sprintf("α = %s, %s CI [%s, %s]", cs_fmt_num(res$alpha, 2, leading_zero = FALSE), pct, cs_fmt_num(res$ci_low, 2, leading_zero = FALSE),
                cs_fmt_num(res$ci_high, 2, leading_zero = FALSE)),
  statistics = c(list(list(key = "alpha", label = "Cronbach's α", value = res$alpha), list(key = "ci", label = paste(pct, "CI"), value = c(res$ci_low, res$ci_high)),
                      list(key = "alpha_std", label = "Standardized α", value = res$alpha_std)),
                 if (!is.na(values$omega)) list(list(key = "omega", label = "McDonald's ω", value = values$omega))),
  tables = list(list(key = "items", title = "Item statistics", columns = list(
    list(key = "item", label = "Item", type = "string"), list(key = "mean", label = "Mean", type = "number"),
    list(key = "sd", label = "SD", type = "number"), list(key = "r_drop", label = "Corrected item–total r", type = "number"),
    list(key = "alpha_drop", label = "α if dropped", type = "number"), list(key = "loading", label = "Loading (one factor)", type = "number")
  ), rows = rows)),
  effectSizes = list(list(key = "alpha", label = "Cronbach's α", value = res$alpha, ciLow = res$ci_low, ciHigh = res$ci_high,
                          ciLevel = conf, method = "Feldt (1965) F interval")),
  assumptions = assumptions,
  warnings = warnings,
  notes = list("α from the item covariance matrix (n − 1); ω total = (Σλ)² / ((Σλ)² + Σψ) from a one-factor ML fit of the correlation matrix."),
  charts = list(cs_chart("corr", "matrix-heatmap", "Inter-item correlations", list(
    row = cs_col("Item", rep(items, each = k), "categorical", levels = items),
    col = cs_col("Item ", rep(items, times = k), "categorical", levels = items),
    value = cs_col("r", as.vector(t(R)), "numeric"),
    label = cs_col("r (text)", sprintf("%.2f", as.vector(t(R))), "categorical")
  ), controls = list(scale = "diverging", min = -1, max = 1))),
  values = values
))

Sources

  • Cronbach, L. J. (1951). Coefficient alpha and the internal structure of tests. Psychometrika, 16, 297–334.
  • Feldt, L. S. (1965). The approximate sampling distribution of Kuder-Richardson reliability coefficient twenty. Psychometrika, 30, 357–370.
  • McDonald, R. P. (1999). Test theory: A unified treatment. Erlbaum.
  • Dunn, T. J., Baguley, T., & Brunsden, V. (2014). From alpha to omega. British Journal of Psychology, 105, 399–412.

From the CodeSplash method registry · reliability.alpha v1.0.1.