Skip to content
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

fix bug in prop.test() wrapper #502

Merged
merged 4 commits into from
Sep 5, 2023
Merged

fix bug in prop.test() wrapper #502

merged 4 commits into from
Sep 5, 2023

Conversation

simonpcouch
Copy link
Collaborator

Closes #496. See that issue for discussion. :)

@@ -258,11 +258,11 @@ test_that("conf_int argument works", {
})

# generate some data to test the prop.test wrapper
df <- data.frame(resp = c(rep("c", 450),
df <- data.frame(exp = rep(c("a", "b"), each = 500),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead of adjusting each table() call further down to tabulate the first variable as the "column," I just adjusted the order in which the variables in this dataset were defined.


# reorder according to the order and success arguments
sum_table <- sum_table[lvls, order]
select(explanatory_name(x), response_name(x)) %>%
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not obvious to me how we could formally test which selection order is "right," though I'm quite confident it's correct now. :)

Copy link
Collaborator

@mine-cetinkaya-rundel mine-cetinkaya-rundel left a comment

Choose a reason for hiding this comment

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

Just a few comments, looks good to me!

R/wrappers.R Outdated Show resolved Hide resolved
R/wrappers.R Outdated Show resolved Hide resolved
R/wrappers.R Outdated Show resolved Hide resolved
R/wrappers.R Outdated Show resolved Hide resolved
@simonpcouch
Copy link
Collaborator Author

Seeing the same failures on main, so I'll go ahead and merge.

@simonpcouch simonpcouch merged commit 8a22cd6 into main Sep 5, 2023
2 of 8 checks passed
@simonpcouch simonpcouch deleted the prop-test-496 branch September 5, 2023 17:12
@github-actions
Copy link

This pull request 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.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prop_test() wrapper incorrectly computing the confidence interval for differences in percents.
2 participants