Skip to content

[jaspFactor] Add correlation matrix determinant as an assumption check output...#332

Open
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
sisyphus-jasp:fix-sisyphus-1772855063
Open

[jaspFactor] Add correlation matrix determinant as an assumption check output...#332
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
sisyphus-jasp:fix-sisyphus-1772855063

Conversation

@sisyphus-jasp
Copy link

Summary

Fixes: jasp-stats/jasp-issues#3956

Root cause

  • EFA assumption checks had no option/output path for correlation matrix determinant.
  • Missing in both UI options (PcaEfaOutputOptions.qml) and backend builders (exploratoryfactoranalysis.R).

What changed

  • Added new EFA-only checkbox option: correlationMatrixDeterminant under Assumption checks.
  • Added new backend builder .efaCorrelationDeterminant(...) and wired it into exploratoryFactorAnalysisInternal().
  • New table key: determinantTable, title Correlation Matrix Determinant, column Determinant.
  • Determinant uses correlation matrix aligned with current analysis mode:
    • poly/tetrachoric: psych::mixedCor(... )$rho
    • raw: stats::cor(..., use = "pairwise.complete.obs")
    • variance-covariance input: stats::cov2cor(...)

Caveats / reviewer checks

  • QML option is EFA-only (visible: !pca) in shared PCA/EFA options component.
  • testAll() result after change matches baseline: [ FAIL 0 | WARN 0 | SKIP 13 | PASS 132 ].
  • Repro rerun confirms: option OFF => no determinant table; option ON => determinant table present.
Implementation Plan

Root cause

  • EFA assumption checks currently expose only KMO, Bartlett, Mardia, and anti-image outputs.
  • No QML option exists for correlation matrix determinant, and no R builder computes/displays it in R/exploratoryfactoranalysis.R.

Proposed changes

  • inst/qml/common/PcaEfaOutputOptions.qml
    • Add a new assumption-check checkbox for EFA only (visible: !pca) to request correlation matrix determinant output.
  • R/exploratoryfactoranalysis.R
    • Add a new output builder (table) for the determinant.
    • Compute determinant from the matrix that matches current EFA decomposition base:
      • poly/tetrachoric: determinant of psych::mixedCor(... )$rho
      • raw data: determinant of stats::cor(dataset, use = "pairwise.complete.obs")
      • variance-covariance input: determinant of stats::cov2cor(as.matrix(dataset))
    • Register this builder in exploratoryFactorAnalysisInternal() with other assumption checks.
    • Use translated title/labels via gettext().

Expected test impact

  • Existing tests should still pass because the new option default is FALSE.
  • No snapshot change expected unless tests explicitly enable the new option.

Add correlation matrix determinant as an assumption check output option in EFA analysis

Test Results

Test Run Result
Baseline (pre-fix) [ FAIL 0 | WARN 0 | SKIP 13 | PASS 132 ]
Post-fix [ FAIL 0 | WARN 0 | SKIP 13 | PASS 132 ]
Upstream CI e71f5ad -- CI: failing

Automated Code Review

Approved after 1 review iteration(s).

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.

[Feature Request]: Matrix Determinant

1 participant