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', | |
'hp' = 'Gross horsepower', | |
'factor(gear): 4/3' = 'Four forward gears', | |
'factor(gear): 5/3' = 'Five forward gears', | |
'N' = 'Observations')) |
------------------------------------------------------------------ | |
m1 m2 m3 | |
------------------------ ------------- ------------- ------------- | |
**Constant** 30.099***\ 10.790*\ 16.306*\ | |
(1.634) (5.078) (6.429) | |
**Gross horsepower** -0.068***\ -0.052***\ -0.064***\ | |
(0.010) (0.009) (0.011) | |
**drat** \ 4.698***\ 3.510\ | |
(1.192) (1.851) | |
**Four forward gears** \ \ -0.276\ | |
(2.135) | |
**Five forward gears** \ \ 3.761\ | |
(2.161) | |
**Observations** 32 32 32 | |
**R-squared** 0.6 0.7 0.8 | |
**F** 45.5 41.5 24.2 | |
------------------------------------------------------------------ |
This comment has been minimized.
This comment has been minimized.
"the most recent version of the pander package dropped support for mtable but there are plans to re-integrate it at Rapporter/pander#304" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
any idea what the error means?