115 compare cor statistic not z score#116
Merged
Merged
Conversation
Need to run local checks than GitHub actions. Tag Lakens when both are cleared.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes issue #115 in TOSTER where compare_cor(method = "fisher", alternative = "equivalence") reported an unstandardized numerator as the z statistic, despite computing p-values from the standardized value.
Changes:
- Update
compare_cor()to report the standardized z-statistic ((diff - bound) / SE) for TOST-style alternatives. - Add documentation clarifying Fisher-z handling of
nullbounds and clarify whatstatisticrepresents. - Add a regression test to ensure
result$statisticmatches the standardized z and reproduces the p-value.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
R/compare_cor.R |
Fixes reported statistic to be standardized (matches p-value computation) and clarifies Fisher-z bound behavior in docs. |
man/compare_cor.Rd |
Mirrors documentation updates about standardized statistic and Fisher-z bound conversion. |
tests/testthat/test-corr.R |
Adds regression test for issue #115 to prevent reintroduction. |
R/boot_ses_test.R |
Adds roxygen import for stats::runif used unqualified in the implementation. |
NAMESPACE |
Adds importFrom(stats,runif) (consistent with roxygen-generated namespace). |
.gitignore |
Adds an ignore pattern for a Claude local settings file. |
Owner
|
Excellent, thanks for the update (am using this function in a new paper, which is how I noticed this). |
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.
Fix for issue #115 raised by @Lakens
This should resolve the issue, update the documentation, and incorporate a unit test to avoid the issue in the future.