crsh / papaja

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.
https://frederikaust.com/papaja_man/
Other
657 stars 133 forks source link

apa_print for lmer models standardized beta output bug? #577

Closed sebsilas closed 10 months ago

sebsilas commented 10 months ago

Describe the bug

When I print the results of a mixed-effects model to a table using apa_print and apa_table, the table header labelling is for a standardised beta coefficient (β), but I believe this should be the unstandardised beta coefficient for a mixed-effects model (B)?

To Reproduce

mod <- lmer(mpg ~ cyl + hp + disp + (1|gear), data = mtcars)

# Excuse the terrible model.

mod %>% 
  apa_print() |>
  apa_table()

Expected behavior Instead of "β" in the table header, I would expect to see "Β".

mariusbarth commented 10 months ago

Hi @sebsilas,

The behaviour you describe is actually not a bug, but a design decision (we here follow Eid et al., 2010). However, if you don't like $\beta$, you can use argument est_name to pick whatever estimate name you want:

mod <- lmer(mpg ~ cyl + hp + disp + (1|gear), data = mtcars)

mod |>
  apa_print(est_name = "b") |>
  apa_table()
sebsilas commented 10 months ago

Ah ok, I thought there wasn't an agreed upon way of presenting standardised coefficients for mixed effects models. Could you give me the full reference please? Thanks!

mariusbarth commented 10 months ago

I also think there is no agreed-upon way, which is why we used this (German) stats text book as a starting point:

Eid, M., Gollwitzer, M., & Schmitt, M. (2010). Statistik und Forschungsmethoden [Statistics and research methods] (5th ed.). Beltz, Weinheim, Germany.