tidymodels / infer

An R package for tidyverse-friendly statistical inference
https://infer.tidymodels.org
Other
726 stars 80 forks source link

issues with p-value shading #463

Closed simonpcouch closed 1 year ago

simonpcouch commented 1 year ago

Seeing the following with CRAN versions of infer and ggplot2:

library(infer)
data(gss)

set.seed(2)
null_dist <- gss %>%
   specify(response = hours) %>%
   hypothesize(null = "point", mu = 40) %>%
   generate(reps = 5000, type = "bootstrap") %>%
   calculate(stat = "mean")

point_estimate <- gss %>%
   specify(response = hours) %>%
   calculate(stat = "mean")

null_dist %>%
   visualize() +
   shade_p_value(obs_stat = point_estimate, direction = "two_sided")
#> Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
#> collapsing to unique 'x' values

#> Warning in regularize.values(x, y, ties, missing(ties), na.rm = na.rm):
#> collapsing to unique 'x' values

Created on 2022-11-28 with reprex v2.0.2

The regularize.values warning doesn't appear when the shaded regions are computed correctly.

github-actions[bot] commented 1 year ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.