-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug with visualize()
#424
Comments
Didn't end up coming to a fix, but some notes from poking around with this: library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(infer)
r_hat <- gss %>%
observe(college ~ sex, success = "no degree",
stat = "ratio of props", order = c("female", "male"))
set.seed(33)
null_dist <- gss %>%
specify(college ~ sex, success = "no degree") %>%
hypothesize(null = "independence") %>%
generate(reps = 1000) %>%
calculate(stat = "ratio of props", order = c("female", "male"))
#> Setting `type = "permute"` in `generate()`.
visualize(null_dist) +
shade_p_value(obs_stat = r_hat, direction = "two-sided") # just draw the problematic portion
visualize(null_dist) +
shade_p_value(obs_stat = r_hat, direction = "left") # or both of them, using a slightly jittered r_hat
r_hat$stat <- .989
visualize(null_dist) +
shade_p_value(obs_stat = r_hat, direction = "both") Created on 2021-11-13 by the reprex package (v2.0.0) The calculated statistic seems to fall exactly on the boundaries of one of the bins, and this results in the y-coordinate from Lines 245 to 252 in a4a41d6
Note, in this case, that obs_stat == second_border
> TRUE |
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. |
The problem
There seems to be a plotting glitch that's actually reproduced in the documentation (the full pipeline article).
Reproducible example
Created on 2021-10-20 by the reprex package (v2.0.0)
Session info
The text was updated successfully, but these errors were encountered: