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

Malformed tidy() tibble from {survey} Wald test (matrix columns) #1081

Closed
ddsjoberg opened this issue Feb 17, 2022 · 3 comments · Fixed by #1082
Closed

Malformed tidy() tibble from {survey} Wald test (matrix columns) #1081

ddsjoberg opened this issue Feb 17, 2022 · 3 comments · Fixed by #1082

Comments

@ddsjoberg
Copy link
Contributor

The problem

The returned tibble from tidy() returns matrix columns unnecessarily.

Reproducible example

library(survey)
data(api)

dclus1 <- svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)

survey::svychisq(~sch.wide + stype, dclus1, statistic = "Wald") |> 
  broom::tidy()
#> Multiple parameters; naming those columns ndf, ddf
#> # A tibble: 1 x 5
#>     ndf   ddf statistic[,1] p.value[,1] method                               
#>   <dbl> <dbl>         <dbl>       <dbl> <chr>                                
#> 1     2    14          2.40       0.127 Design-based Wald test of association

Created on 2022-02-16 by the reprex package (v2.0.1)

If you agree that the columns would be better returned is simple vectors as opposed to nX1 matrices, I can submit a pull request to update.

Thank you!

@simonpcouch
Copy link
Collaborator

Thanks for the issue! This seems worth looking into, and I think stricter checks on column types/attributes will be warranted here soon. I'm taking some time away at the moment, but will spend some time with this and continue discussion here sooner than later.🙂

@ddsjoberg
Copy link
Contributor Author

Thanks @simonpcouch ! Enjoy your time away. I definitely understand the need to take breaks from these projects every so often!

@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2022
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 a pull request may close this issue.

2 participants