Skip to content

115 compare cor statistic not z score#116

Merged
Lakens merged 3 commits into
masterfrom
115-compare_cor-statistic-not-z-score
Apr 10, 2026
Merged

115 compare cor statistic not z score#116
Lakens merged 3 commits into
masterfrom
115-compare_cor-statistic-not-z-score

Conversation

@arcaldwell49

Copy link
Copy Markdown
Collaborator

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.

Need to run local checks than GitHub actions. Tag Lakens when both are cleared.
@arcaldwell49 arcaldwell49 requested a review from Lakens April 10, 2026 12:55
@arcaldwell49 arcaldwell49 linked an issue Apr 10, 2026 that may be closed by this pull request
Copilot AI review requested due to automatic review settings April 10, 2026 12:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 null bounds and clarify what statistic represents.
  • Add a regression test to ensure result$statistic matches 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.

@Lakens Lakens merged commit a1510b5 into master Apr 10, 2026
8 checks passed
@Lakens

Lakens commented Apr 10, 2026

Copy link
Copy Markdown
Owner

Excellent, thanks for the update (am using this function in a new paper, which is how I noticed this).

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.

compare_cor $statistic not z-score

3 participants