Adding Binomial and Poisson capability - #504
Conversation
julianwuth
commented
Aug 14, 2026
- Code for Binomial and Poisson process capability analysis
There were some problems with the x-axis labels for the histogram of the residuals in DOE. This is fixed by: - Using jaspGraphs::jaspHistogram - Updating snapshots accordingly - Additionally, the binwidth method now carries over to the matrix plot.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This requires #461 to be merged. |
Requires jasp-stats#504 to be merged
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #504 +/- ##
==========================================
+ Coverage 84.44% 85.11% +0.67%
==========================================
Files 18 19 +1
Lines 10513 11088 +575
==========================================
+ Hits 8878 9438 +560
- Misses 1635 1650 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Switching capabilityDataType can leave stale attribute outputs because the attributeCapability container is not cleared/invalidated when returning to the continuous mode.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds attribute (count) process capability support to the JASP QualityControl module by branching Process Capability Studies into a new binomial/Poisson pipeline and extending the shared control-chart engine with p/u charts; also updates tests/datasets/snapshots accordingly.
Changes:
- Route
processCapabilityStudies()to an attribute-capability implementation whencapabilityDataType == "attributes", and extend control-chart calculations/rule handling to support p and u charts. - Add binomial/Poisson capability datasets and snapshot-based plot expectations; update example-based tests to merge QML defaults with
.jasp-stored options. - Misc: update DOE residual histogram plotting and adjust repo ignores/tooling files (large cleanup).
File summaries
| File | Description |
|---|---|
| R/processCapabilityStudies.R | Adds early branch into attribute capability; expands dependencies to include capabilityDataType. |
| R/commonQualityControl.R | Extends control chart codepaths to handle p/u charts and limits rule sets accordingly. |
| R/doeAnalysis.R | Switches residual histogram plotting to jaspGraphs::jaspHistogram() and updates dependencies. |
| inst/help/attributesCharts.md | Documents relationship between Attributes Charts and Process Capability Studies p/u charts. |
| tests/testthat/test-example-ProcessCapabilityStudyWideFormat.R | Merges default options into .jasp options to avoid missing newly-added options. |
| tests/testthat/test-example-ProcessCapabilityStudyLongFormat.R | Same default-option merge for long-format example test. |
| tests/testthat/datasets/processCapabilityStudy/poissonCapabilityMissing.csv | Adds Poisson capability test data with missing values. |
| tests/testthat/datasets/processCapabilityStudy/poissonCapabilityEdgeCases.csv | Adds Poisson capability edge-case data (zero/fractional columns). |
| tests/testthat/datasets/processCapabilityStudy/poissonCapability.csv | Adds baseline Poisson capability dataset. |
| tests/testthat/datasets/processCapabilityStudy/binomialCapabilityMissing.csv | Adds binomial capability test data with missing values. |
| tests/testthat/datasets/processCapabilityStudy/binomialCapabilityEdgeCases.csv | Adds binomial capability edge-case data (zero/fractional columns). |
| tests/testthat/datasets/processCapabilityStudy/binomialCapability.csv | Adds baseline binomial capability dataset. |
| tests/testthat/_snaps/processCapabilityPoisson/poisson-report-subplot-8.svg | Adds/updates Poisson report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityPoisson/poisson-report-subplot-6.svg | Adds/updates Poisson report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityPoisson/poisson-report-subplot-5.svg | Adds/updates Poisson report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityPoisson/poisson-report-subplot-1.svg | Adds/updates Poisson report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityPoisson/poisson-histogram.svg | Adds/updates Poisson histogram snapshot. |
| tests/testthat/_snaps/processCapabilityBinomial/binomial-report-subplot-8.svg | Adds/updates binomial report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityBinomial/binomial-report-subplot-6.svg | Adds/updates binomial report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityBinomial/binomial-report-subplot-5.svg | Adds/updates binomial report snapshot subplot. |
| tests/testthat/_snaps/processCapabilityBinomial/binomial-report-subplot-1.svg | Adds/updates binomial report snapshot subplot. |
| renv.lock | Updates locked package versions/metadata (e.g., igraph). |
| inst/help/attributesCharts.md | Adds guidance clarifying differences between chart implementations. |
| .vscode/mcp.json | Removes editor MCP server config. |
| .mcp.json | Removes repo-root MCP server config. |
| .gitignore | Adds ignore rules for AI/tooling directories and several repo-doc/instruction paths. |
| .github/instructions/translation.instructions.md | Removes GitHub instruction file. |
| .github/instructions/testing.instructions.md | Removes GitHub instruction file. |
| .github/instructions/R.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-tables.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-state-management.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-plots.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-output-structure.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-module-architecture.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-dependency-management.instructions.md | Removes GitHub instruction file. |
| .github/instructions/jasp-containers-and-errors.instructions.md | Removes GitHub instruction file. |
| .github/instructions/inst.qml.instructions.md | Removes GitHub instruction file. |
| .claude/settings.local.json | Removes Claude Code local settings. |
| .claude/session_startup.R | Removes Claude Code session bootstrap script. |
| .claude/rules/translation-instructions.md | Removes Claude Code rule file. |
| .claude/rules/testing-instructions.md | Removes Claude Code rule file. |
| .claude/rules/r-instructions.md | Removes Claude Code rule file. |
| .claude/rules/qml-instructions.md | Removes Claude Code rule file. |
| .claude/rules/jasp-tables.md | Removes Claude Code rule file. |
| .claude/rules/jasp-state-management.md | Removes Claude Code rule file. |
| .claude/rules/jasp-plots.md | Removes Claude Code rule file. |
| .claude/rules/jasp-output-structure.md | Removes Claude Code rule file. |
| .claude/rules/jasp-module-architecture.md | Removes Claude Code rule file. |
| .claude/rules/jasp-dependency-management.md | Removes Claude Code rule file. |
| .claude/rules/jasp-containers-and-errors.md | Removes Claude Code rule file. |
| .claude/rules/git-workflow.md | Removes Claude Code rule file. |
| .claude/README.md | Removes Claude Code documentation. |
| .claude/mcp-server.R | Removes Claude Code MCP server bootstrap script. |
| .claude/hooks/block-test-edits.js | Removes Claude Code hook script. |
Review details
- Files reviewed: 51/117 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Attribute (count) data has its own data entry, charts and statistics and shares nothing with the | ||
| # continuous pipeline below, so it branches out before any of it. Which of the two attribute | ||
| # analyses runs, binomial or Poisson, is decided there by attributeDistribution. | ||
| if (options[["capabilityDataType"]] == "attributes") | ||
| return(.qcAttributeCapability(jaspResults, dataset, options)) | ||
|
|
||
| wideFormat <- options[["dataFormat"]] == "wideFormat" |
Requires jasp-stats#504 to be merged