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

report() not outputting denominator degrees of freedom #453

Open
RenyBB opened this issue Jul 5, 2024 · 3 comments
Open

report() not outputting denominator degrees of freedom #453

RenyBB opened this issue Jul 5, 2024 · 3 comments

Comments

@RenyBB
Copy link

RenyBB commented Jul 5, 2024

For example, the following code...

m<- lmerTest::lmer(mpg ~ wt+ (1| gear), data=mtcars) 
report(anova(m)) 

... provides a written summary that is missing the denominator degrees of freedom:

" The ANOVA suggests that:The main effect of wt is statistically significant and large (F(1) = 62.20, p < .001; Eta2 (partial) = 0.74, 95% CI [0.56, 1.00]) "

@rempsyc rempsyc transferred this issue from easystats/easystats Jul 8, 2024
@DominiqueMakowski
Copy link
Member

m<- lmerTest::lmer(mpg ~ wt+ (1| gear), data=mtcars) 
parameters::parameters(anova(m)) 
#> Parameter | Sum_Squares | df | Mean_Square |     F |      p
#> -----------------------------------------------------------
#> wt        |      526.21 |  1 |      526.21 | 62.20 | < .001
#> 
#> Anova Table (Type 3 tests)

Created on 2024-07-09 with reprex v2.0.2

I reckon that's because parameters() doesn't return one by default (@mattansb expert of anovas)

@strengejacke
Copy link
Member

strengejacke commented Jul 9, 2024

We've only tested for lme4, which doesn't include the denominator df. Package lmerTest, however, does. This should be fixed in parameters now (easystats/parameters#988).

report still needs to be fixed, though.

m <- lmerTest::lmer(mpg ~ wt + (1 | gear), data = mtcars)

parameters::parameters(anova(m))
#> Parameter | Sum_Squares | df | df (error) | Mean_Square |     F |      p
#> ------------------------------------------------------------------------
#> wt        |      526.21 |  1 |      21.92 |      526.21 | 62.20 | < .001
#> 
#> Anova Table (Type 3 tests)

report::report(anova(m))
#> The ANOVA suggests that:
#> 
#>   - The main effect of wt is statistically significant and large (F(1) = 62.20, p
#> < .001; Eta2 (partial) = 0.74, 95% CI [0.56, 1.00])
#> 
#> Effect sizes were labelled following Field's (2013) recommendations.

Created on 2024-07-09 with reprex v2.1.1

@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Jul 9, 2024

@RenyBB also note that in-general, dfs for mixed models are a tricky business (easystats/parameters#989)

strengejacke added a commit to easystats/parameters that referenced this issue Jul 9, 2024
* `model_parameters.anova()` includes `df_error`
easystats/report#453

* add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants