[jaspLearnStats] Fix issue #3107: Change default value of delta from 0 to 0.5 in Lea...#148
Closed
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
Closed
Conversation
…0 to 0.5 in Lea...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue: https://github.com/jasp-stats/INTERNAL-jasp/issues/3107
Fix Issue #3107: Learn Stats Effect Sizes Defaults
Summary
Fixed three issues in the Learn Stats Effect Sizes module:
1. Changed default value of delta from 0 to 0.5
inst/qml/LSeffectSizes.qmldefaultValue: 0→defaultValue: 0.5foreffectSizeValueDelta2. Changed default values for other effect sizes to 0.5
inst/qml/LSeffectSizes.qmleffectSizeValueRhodefault from 0 to 0.5effectSizeValuePhidefault from 0 to 0.53. Fixed overlapping x-axis labels in contingency table plot
R/LSeffectSizes.R.tsPhiMakePopulationPlot,.tsPhiMakeSimulationPlot, and.tsPhiMakeCombinedPlotfunctionsscales::pretty_breaks(n = 3)to limit the number of axis labels and prevent overlapVerification
Implementation Plan
Plan: Fix issue #3107 - Learn Stats Effect Sizes
Root Cause
Default values: The QML file (
inst/qml/LSeffectSizes.qml) has default values of 0 for effect size parameters:effectSizeValueDelta(line 65): defaultValue: 0effectSizeValueRho(line 100): defaultValue: 0effectSizeValuePhi(line 145): defaultValue: 0Overlapping x-axis labels: The R code (
R/LSeffectSizes.R) generates axis ticks usingjaspGraphs::getPrettyAxisBreaks()which may produce too many tick marks for the phi coefficient plots, causing overlap.Proposed Changes
1. Change default values in QML (inst/qml/LSeffectSizes.qml)
defaultValue: 0todefaultValue: 0.5for effectSizeValueDeltadefaultValue: 0todefaultValue: 0.5for effectSizeValueRhodefaultValue: 0todefaultValue: 0.5for effectSizeValuePhi2. Fix overlapping x-axis labels in R (R/LSeffectSizes.R)
The issue is in
.tsPhiMakePopulationPlotand.tsPhiMakeSimulationPlotfunctions. The ticks are generated from the data range which may be too dense.Looking at lines:
ticks <- jaspGraphs::getPrettyAxisBreaks(range(c(0, 1)))ticks <- jaspGraphs::getPrettyAxisBreaks(range(data[,-5]))The fix is to limit the number of breaks or use a fixed set of breaks. A simple fix is to add
scales::pretty_breaks(n = 3)or similar to reduce the number of tick marks.Actually, looking more carefully at the issue, it seems the problem is that when pX = 0.5 (which is the default), the x-axis tick at 0.5 and possibly other values may overlap. The fix could be to ensure fewer breaks are used.
Expected Test Impact
Test Results