[jaspFrequencies] Fix incorrect display of test value in Binomial Test footnote. The...#300
Open
sisyphus-jasp wants to merge 1 commit into
Open
Conversation
…t footnote. The...
Contributor
|
I'm actually not sure whether we want this fix or somehow differentiating between
|
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
Fixes: https://github.com/jasp-stats/INTERNAL-jasp/issues/3110
Issue #3110: Fix incorrect display of test value in Binomial Test footnote
What was wrong (root cause)
The Binomial Test footnote was displaying the raw formula string (e.g., "rnorm(1)") instead of the actual parsed numeric value. This happened because the code used
options$testValueUnparsedwhich contains the unparsed formula, instead ofoptions$testValuewhich contains the actual numeric value that was parsed and used in calculations.What was changed
Changed the footnote generation in both
binomialtest.Randbinomialtestbayesian.Rto useoptions$testValueinstead ofoptions$testValueUnparsed:options$testValueUnparsedtooptions$testValueoptions$testValueUnparsedtooptions$testValueWhy this fix works
The
.parseAndStoreFormulaOptions()function (called at line 28 in binomialtest.R and line 22 in binomialtestbayesian.R) parses formula fields and stores:options$testValueoptions$testValueUnparsedThe footnote should display the actual value being used in the test (the parsed value), not the formula string the user entered.
Test impact
Caveats for reviewer
priorAUnparsedandpriorBUnparsedin the Bayesian binomial test (line 128), but this was not part of the reported issue. A separate issue could be filed for that.Implementation Plan
Issue #3110: Fix incorrect display of test value in Binomial Test footnote
Root Cause
The footnote in the Binomial Test output displays the raw formula string (e.g., "rnorm(1)") instead of the actual parsed test value. This happens because the code uses
options$testValueUnparsedwhich contains the unparsed formula string, when it should useoptions$testValuewhich contains the actual parsed numeric value.Affected Files
R/binomialtest.R- Lines 199, 201, 203R/binomialtestbayesian.R- Lines 122, 124, 126Proposed Changes
In both files, replace
options$testValueUnparsedwithoptions$testValuein the footnote generation:options$testValueUnparsedtooptions$testValueoptions$testValueUnparsedtooptions$testValueoptions$testValueUnparsedtooptions$testValue(The same change in
binomialtestbayesian.Rat lines 122, 124, 126)Expected Test Impact
The existing tests should still pass because:
The tests affected will likely be snapshot tests that capture the footnote text.
Test Results