Skip to content

feat: add exp_cronbach_alpha reliability analysis (#14309)#1543

Open
hidekoji wants to merge 6 commits into
masterfrom
fix/issue-14309
Open

feat: add exp_cronbach_alpha reliability analysis (#14309)#1543
hidekoji wants to merge 6 commits into
masterfrom
fix/issue-14309

Conversation

@hidekoji

@hidekoji hidekoji commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds exp_cronbach_alpha() — Cronbach's Alpha / reliability analysis — powering the new Cronbach's Alpha Analytics type in the desktop app (tam PR to follow).

Supports Pearson (Cronbach's Alpha), Polychoric (Ordinal Alpha), and Mixed Correlation (Mixed-Correlation Alpha), with an auto selector that picks the method from the item types. Reuses psych (already an Imports dep — no new dependency).

Contract

  • exp_cronbach_alpha(df, ..., correlation_method = "auto", check_keys = FALSE, smooth = TRUE, correct = 0.5, max_nrow = NULL, seed = 1) — returns a model_df (class cronbach_alpha_exploratory), one model per group.
  • glance(model) — overall alpha, standardized alpha, CI, G6, counts, average inter-item correlation, correlation type, interpretation.
  • tidy(model, type = ...)summary / alpha_if_dropped / item_stats / correlation / response_distribution / scale_candidates / data.

Testing

tests/testthat/test_reliability.R covers the Pearson, all-ordinal, mixed, reverse-key, and edge-case contracts:

  • Pearson alpha matches psych::alpha's raw_alpha exactly; every section shape verified.
  • Auto→Polychoric (ordered factors) → Ordinal Alpha; raw.r hidden.
  • Mixed correlation → Mixed-Correlation Alpha; CI and raw.r are hidden by specification.
  • <2 variables error; nominal-factor error; constant-column drop; group_by.

Notes

  • NAMESPACE updated with the 3 new exports (exp_cronbach_alpha, tidy/glance S3 methods). devtools::document() mis-parses in this local env due to an unrelated find_data load error, so the entries were inserted by hand exactly as document() would emit them — please regenerate in CI if preferred.
  • DESCRIPTION version bumped 16.0.5 → 16.0.6. The bundled binary must be rebuilt + the tam requiredRPackagesReduced.json bumped before the desktop feature works end-to-end.

🤖 Generated with Claude Code

Specification alignment follow-up

  • Pearson exposes Feldt/Duhachek 95% CI and raw.r.
  • Polychoric/Mixed omit the CI summary row and the raw.r output column.
  • check.keys is applied consistently to matrix statistics, item statistics, and alpha-if-dropped results.
  • Local full test execution still requires the repository's 4.6 devtools/exploratory dependency stack.

hidekoji and others added 2 commits July 17, 2026 15:34
New exp_cronbach_alpha() computes a Cronbach's Alpha reliability report
(Pearson / Polychoric / Mixed correlation via psych) and exposes report
sections through tidy(type=)/glance(). Powers the new Cronbach's Alpha
Analytics type in the desktop app.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…h_alpha (#14309)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hidekoji
hidekoji requested a review from kei51e July 17, 2026 23:27
Comment thread DESCRIPTION Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants