pander
pander copied to clipboard
Support for lme4 / lmer models?
Anything is doable :) Can you please share some example objects and preferred output?
It's a bit of a mouthful, but I might do something like this:
library(pander)
library(lme4)
library(broom)
library(dplyr)
require(lmerTest)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
tab1 <- tidy(fm1) %>% select(-group)
fixedpvals <- coef(summary(fm1))[,5]
tab1$p <- c(fixedpvals, rep(NA, length(tab1$estimate)-length(fixedpvals)))
colnames(tab1) <- c("", "Estimate", "Std. Error", "t", "Pr(>|t|)")
pander(tab1,
missing="",
justify = c('left', 'center', 'center', 'center', 'center'),
)
Note you have to use lmerTest for the p values to be present in the coefficients table. Perhaps we need to check whether the library is loaded before grabbing that column...
might want to coordinate with the broom
package ... ? (there are issues there with lmerTest
output, too, but might as well not solve the problem twice ...)