I’ve had some success using mtable from the memisc package to pretty-print results (APSR-style) for several regressions side-by-side, but I’m having trouble getting the same command to work for models fit with lrm() from the MASS package and lmrob() from the robustbase package.
Works great:
lm0 <- lm(sr ~ pop15 + pop75, data = LifeCycleSavings)
lm1 <- lm(sr ~ dpi + ddpi, data = LifeCycleSavings)
lm2 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
mtable123 <- mtable("Model 1"=lm0,"Model 2"=lm1,"Model 3"=lm2)
Fails at the mtable() command ("Error in qt(p, df, lower.tail, log.p): Non-numeric argument to mathematical function"):
rlm0 <- rlm(sr ~ pop15 + pop75, data = LifeCycleSavings)
rlm1 <- rlm(sr ~ dpi + ddpi, data = LifeCycleSavings)
rlm2 <- rlm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
mtable123 <- mtable("Model 1"=rlm0, "Model 2"=rlm1, "Model 3"=rlm2)
Fails at the mtable() command ("Error in UseMethod("getSummary"): no applicable method for 'getSummary' applied to an object of class "lmrob""):
lmrob0 <- lmrob(sr ~ pop15 + pop75, data = LifeCycleSavings)
lmrob1 <- lmrob(sr ~ dpi + ddpi, data = LifeCycleSavings)
lmrob2 <- lmrob(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
mtable123 <- mtable("Model 1"=lmrob0, "Model 2"=lmrob1, "Model 3"=lmrob2)
I’m open to suggestions that don’t involve mtable, but I’m looking for plain-text or tab-separated output (in other words, not LaTeX).
The documentation at
?getSummaryin the memisc package describes how you can extend themtablefunction to be used on other model types.In particular, you need to create an appropriate method for
getSummaryand then create a summary template usingsetSummaryTemplate. So, for instance, something like this works: