jacob-long / jtools

Tools for summarizing/visualizing regressions and other helpful stuff
https://jtools.jacob-long.com
GNU General Public License v3.0
162 stars 22 forks source link

Different tidy output for an object of class summary.glht when the package jtools is loaded #139

Closed awcm0n closed 1 month ago

awcm0n commented 1 year ago

An object of class summary.glht submitted to tidy() produces a tibble with different column names if the package jtools is loaded:

Without jtools:

> broom::tidy(o)
# A tibble: 4 × 6
  contrast      null.value estimate std.error statistic adj.p.value
  <chr>         <dbl>    <dbl>     <dbl>     <dbl>      <dbl>
1 mar_jun_2020      0  0.00496   0.00531     0.935 0.350     
2 jul_dec_2020      0 -0.0144    0.00315    -4.56  0.00000508
3 mar_junXnojob     0  0.0470    0.0405      1.16  0.246     
4 jul_decXnojob     0  0.0506    0.0226      2.24  0.0254  

With jtools:

> library(jtools)
> broom::tidy(o)
# A tibble: 4 × 6
  lhs             rhs estimate std.error statistic    p.value
  <chr>              <dbl>    <dbl>     <dbl>     <dbl>       <dbl>
1 mar_jun_2020           0  0.00496   0.00531     0.935  0.350     
2 jul_dec_2020           0 -0.0144    0.00315    -4.56   0.00000508
3 mar_junXnojob          0  0.0470    0.0405      1.16   0.246     
4 jul_decXnojob          0  0.0506    0.0226      2.24   0.0254    
> packageVersion("broom")
[1] ‘1.0.4’
> packageVersion("jtools")
[1] ‘2.2.1’
simonpcouch commented 1 year ago

Some additional context at https://github.com/tidymodels/broom/issues/1161#issuecomment-1577284354. :)