Skip to content

Comments

[jaspLearnStats] Fix issue #3107: Change default value of delta from 0 to 0.5 in Lea...#147

Merged
FBartos merged 1 commit intojasp-stats:masterfrom
sisyphus-jasp:fix-sisyphus-1771873921
Feb 24, 2026
Merged

[jaspLearnStats] Fix issue #3107: Change default value of delta from 0 to 0.5 in Lea...#147
FBartos merged 1 commit intojasp-stats:masterfrom
sisyphus-jasp:fix-sisyphus-1771873921

Conversation

@sisyphus-jasp
Copy link
Contributor

Summary

Issue: https://github.com/jasp-stats/INTERNAL-jasp/issues/3107

PR Summary for Issue #3107

What was wrong

  1. The default value of Cohen's δ (delta) was 0 instead of 0.5
  2. The default values for other effect sizes (Pearson ρ and Contingency φ) were also 0 instead of 0.5
  3. The contingency table plot had overlapping x-axis labels when phi=0 (the old default)

What was changed

Modified /workspace/inst/qml/LSeffectSizes.qml:

  • Line 65: Changed defaultValue: 0 to defaultValue: 0.5 for effectSizeValueDelta (Cohen's δ)
  • Line 100: Changed defaultValue: 0 to defaultValue: 0.5 for effectSizeValueRho (Pearson ρ)
  • Line 145: Changed defaultValue: 0 to defaultValue: 0.5 for effectSizeValuePhi (Contingency φ)

Why this fixes the overlapping x-axis labels

With phi=0, the plot's x-axis range was symmetric but small ([-0.5, 0.5]), causing tick labels to overlap. With phi=0.5, the range becomes wider and asymmetric ([-0.612, 0.354]), providing more spacing between tick labels and eliminating the overlap.

Test impact

No existing tests in this module (tests/testthat/ is empty except for .gitkeep). No regressions expected.

Implementation Plan

Implementation Plan: Issue #3107

Issue Summary

  1. Change default value of delta from 0 to 0.5 in Learn Stats -> Effect sizes
  2. Change default values for all other effect sizes (rho, phi) to 0.5
  3. Fix overlapping x-axis labels in the contingency table plot

Root Cause Analysis

Default Values Issue

The QML file inst/qml/LSeffectSizes.qml has effect size default values set to 0:

  • Line 65: effectSizeValueDelta (Cohen's δ) has defaultValue: 0
  • Line 100: effectSizeValueRho (Pearson ρ) has defaultValue: 0
  • Line 145: effectSizeValuePhi (Contingency φ) has defaultValue: 0

Overlapping X-axis Labels Issue

In the R file R/LSeffectSizes.R, the phi (contingency coefficient) population plot function .tsPhiMakePopulationPlot at lines 1126 uses:

ticks <- jaspGraphs::getPrettyAxisBreaks(range(data[,-5]))

When phi=0 (default), the x-axis range is very small (centered around 0), causing tick labels to overlap. Changing the default to 0.5 will expand the range and reduce overlap.

Proposed Changes

1. QML Changes (inst/qml/LSeffectSizes.qml)

  • Line 65: Change defaultValue: 0 to defaultValue: 0.5 for effectSizeValueDelta
  • Line 100: Change defaultValue: 0 to defaultValue: 0.5 for effectSizeValueRho
  • Line 145: Change defaultValue: 0 to defaultValue: 0.5 for effectSizeValuePhi

2. R Changes (R/LSeffectSizes.R)

The overlapping x-axis issue may be resolved by changing the default value from 0 to 0.5, which expands the axis range. However, if additional fixes are needed:

  • Adjust axis breaks calculation in .tsPhiMakePopulationPlot (line 1126)
  • Similar adjustment in .tsPhiMakeSimulationPlot (line 1187)
  • Similar adjustment in .tsPhiMakeCombinedPlot (line 1254)

Expected Test Impact

Since this module has no existing tests in tests/testthat/, no test failures are expected. The changes only affect default values and should not break any functionality.

Implementation Steps

  1. Edit QML file to change default values
  2. Verify the plot fix (may not need R changes if default value change resolves it)
  3. Run testAll() to confirm no regressions

Test Results

Test Run Result
Baseline (pre-fix) Could not parse test summary
Post-fix Could not parse test summary
Upstream CI dcade49 -- CI: passing

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the default effect size inputs in the Learn Stats “Effect sizes” UI so that δ (Cohen’s delta), ρ (Pearson correlation), and φ (contingency coefficient) start at 0.5 instead of 0, aligning the defaults with the intended educational examples and avoiding the “phi=0” initial plot label crowding described in issue #3107.

Changes:

  • Updated the default value for Cohen’s δ from 0 to 0.5.
  • Updated the default value for Pearson’s ρ from 0 to 0.5.
  • Updated the default value for contingency φ from 0 to 0.5 (plus a minor whitespace-only cleanup).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@FBartos FBartos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes the first part of the issue (the figure scaling still needs more work

@FBartos FBartos merged commit ed4f0df into jasp-stats:master Feb 24, 2026
5 checks passed
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