modelsummary, broom, and inline reporting
March 25, 2025
here, tidyverse, lme4, lmerTest, kableExtradata/processed/data_clean.csv; save it as df_clean
source(here("R", "helpers.R"))eval: false: fitting and saving the modeleval: true: loading in the saved modelYou will render a script that already follows these steps.
broom.mixed::tidy()filter(), then pull and format each parameterlmer_tidy <- broom.mixed::tidy(lmer_gaze, effects = "fixed", conf.int = TRUE)
b_lifetime_lmer <- lmer_tidy |> filter(term == "lifetime1") |> pull(estimate) |> round(2)
se_lifetime_lmer <- lmer_tidy |> filter(term == "lifetime1") |> pull(std.error) |> round(2)
t_lifetime_lmer <- lmer_tidy |> filter(term == "lifetime1") |> pull(statistic) |> round(2)
p_lifetime_lmer <- lmer_tidy |> filter(term == "lifetime1") |> pull(p.value) |> fmt_p(3)`r`There was a main effect of lifetime, with longer first-pass reading times for dead versus living referents (\(\beta\) = 0.05, SE = 0.02, t = 2.12, p < .05).
R for Publication - ?meta:day: Reporting Model Results