Skip to content

Instantly share code, notes, and snippets.

@daroczig
daroczig / memisc_and_pander.R
Last active January 24, 2018 19:22
Multiple regression models in a markdown table with memisc and pander
m1 <- lm(mpg ~ hp, data = mtcars)
m2 <- lm(mpg ~ hp + drat, data = mtcars)
m3 <- lm(mpg ~ hp + drat + factor(gear), data = mtcars)
library(pander); library(memisc)
panderOptions('table.alignment.rownames', 'left')
pander(relabel(
mtable(m1, m2, m3,
summary.stats=c('N', 'R-squared', 'F')),
'(Intercept)' = 'Constant',