This function takes a nested model comparison ANOVA object and prints the result in LaTeX or markdown. This currenlty only works for linear mixed effects model comparisons.
print_nmc_p(table, model, latex = TRUE)
library(lme4)
mod1 <- lmer(Reaction ~ 1 + (1|Subject), data = sleepstudy, REML = FALSE)
mod2 <- lmer(Reaction ~ 1 + Days + (1|Subject), data = sleepstudy,
REML = FALSE)
aov_table <- anova(mod1, mod2, test = "Chisq")
print_nmc_p(table = aov_table, model = 'mod2')
#> [1] "($\\chi^{2}$(1) = 116.46; \\emph{p} < .001)"
print_nmc_p(table = aov_table, model = 'mod2', latex = FALSE)
#> [1] "(χ^2^(1) = 116.46; *p* < .001)"