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

wrong degrees of freedom naming convention adopted in standardize_names for broom #236

Closed
IndrajeetPatil opened this issue Oct 22, 2020 · 2 comments · Fixed by #237
Closed
Assignees
Labels
3 investigators ❔❓ Need to look further into this issue What's your opinion 🙉 Collectively discuss something

Comments

@IndrajeetPatil
Copy link
Member

broom::tidy output contains den.df and num.df columns only when the statistic for the given model is F-statistic, otherwise it's always either df or df.residual.

set.seed(123)
library(lme4)
#> Loading required package: Matrix

lm_mod <- lm(Reaction ~ Days, sleepstudy)
(x <- as.data.frame(parameters::model_parameters(lm_mod)))
#>     Parameter Coefficient       SE     CI_low   CI_high         t df_error
#> 1 (Intercept)   251.40510 6.610154 238.360753 264.44946 38.033169      178
#> 2        Days    10.46729 1.238195   8.023855  12.91072  8.453663      178
#>              p
#> 1 2.156888e-87
#> 2 9.894096e-15
insight::standardize_names(x, style = "broom")
#>          term  estimate std.error   conf.low conf.high statistic den.df
#> 1 (Intercept) 251.40510  6.610154 238.360753 264.44946 38.033169    178
#> 2        Days  10.46729  1.238195   8.023855  12.91072  8.453663    178
#>        p.value
#> 1 2.156888e-87
#> 2 9.894096e-15


broom::tidy(lm_mod)
#> # A tibble: 2 x 5
#>   term        estimate std.error statistic  p.value
#>   <chr>          <dbl>     <dbl>     <dbl>    <dbl>
#> 1 (Intercept)    251.       6.61     38.0  2.16e-87
#> 2 Days            10.5      1.24      8.45 9.89e-15
broom::glance(lm_mod)
#> # A tibble: 1 x 12
#>   r.squared adj.r.squared sigma statistic  p.value    df logLik   AIC   BIC
#>       <dbl>         <dbl> <dbl>     <dbl>    <dbl> <dbl>  <dbl> <dbl> <dbl>
#> 1     0.286         0.282  47.7      71.5 9.89e-15     1  -950. 1906. 1916.
#> # ... with 3 more variables: deviance <dbl>, df.residual <int>, nobs <int>

Created on 2020-10-22 by the reprex package (v0.3.0.9001)

@IndrajeetPatil IndrajeetPatil added the What's your opinion 🙉 Collectively discuss something label Oct 22, 2020
@strengejacke
Copy link
Member

This was suggested in easystats/effectsize#156 (see hidden comment). Anyone willing to open a PR and check that the correct naming conventions are used for broom-style?

@strengejacke strengejacke added the 3 investigators ❔❓ Need to look further into this issue label Oct 22, 2020
@IndrajeetPatil
Copy link
Member Author

On it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 investigators ❔❓ Need to look further into this issue What's your opinion 🙉 Collectively discuss something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants