Possible Duplicate:
how to succinctly write a formula with many variables from a data frame?
omit some coefficients from mtable/outreg-type table
I'm using write.mtable() from the memisc package to display results for several regressions in a (tab-separated) table that can be easily pasted into Word/Excel/etc.
Because these tables tend to get big pretty quickly, there are times when I want to restrict the output to an arbitrary subset of the variables included in the regressions.
Is there a simply way to not include results for certain explanatory variables in regression tables without actually removing these variables from the regressions themselves? The easy way is to just delete the rows once they've been pasted into Word/Excel/etc, of course, but perhaps there's a more elegant solution.
For example, starting with an example from the documentation for mtable:
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, summary.stats=c("sigma","R-squared","F","p","N"))
mtable123
Is it possible to remove, say, pop75 from the output as below (not that there's any reason to do this here, but as an example of the type of output I'm trying to achieve):
Calls:
Model 1: lm(formula = sr ~ pop15 + pop75, data = LifeCycleSavings)
Model 2: lm(formula = sr ~ dpi + ddpi, data = LifeCycleSavings)
Model 3: lm(formula = sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)
==========================================
Model 1 Model 2 Model 3
------------------------------------------
(Intercept) 30.628*** 6.360*** 28.566***
(7.409) (1.252) (7.355)
pop15 -0.471** -0.461**
(0.147) (0.145)
dpi 0.001 -0.000
(0.001) (0.001)
ddpi 0.529* 0.410*
(0.210) (0.196)
------------------------------------------
sigma 3.931 4.189 3.803
R-squared 0.262 0.162 0.338
F 8.332 4.528 5.756
p 0.001 0.016 0.001
N 50 50 50
==========================================
Thanks!