Skip to content

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

@ddsjoberg

Description

@ddsjoberg

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions