Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Filter extremely small p-values by setting them to Machine$double.xmin #112

Merged
merged 13 commits into from
Mar 26, 2024

Conversation

amstilp
Copy link
Contributor

@amstilp amstilp commented Mar 19, 2024

For any p-values calculated by pchisq, set any p-values smaller than Machine$double.xmin to the double.xmin value. This should help prevent pval=0 cases.

Closes #111

pchisq behaves a little differently for df=0 than for df>0, and you
can legitimately get pval=0 when df=0. We don't want to set those
zeros to the double.xmin value. Also update the test to use
expect_identical instead of expect_equal, which checks within a
tolerance.
@amstilp amstilp requested review from mconomos and smgogarten March 20, 2024 22:59
amstilp added 2 commits March 20, 2024 16:01
Include testing with lower.tail=TRUE
@amstilp amstilp marked this pull request as ready for review March 21, 2024 16:32
amstilp added 2 commits March 21, 2024 16:15
Not needed; the previous call to pchisq should handle it if the
user doesn't include df as an argument.
inst/NEWS.Rd Outdated Show resolved Hide resolved
Copy link
Collaborator

@smgogarten smgogarten left a comment

Choose a reason for hiding this comment

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

Looks great, thanks

R/utils.R Show resolved Hide resolved
@amstilp amstilp merged commit a66c918 into devel Mar 26, 2024
1 check passed
@amstilp amstilp deleted the feature/filter-extreme-p-values branch March 26, 2024 18:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants