I'm trying to extract two different averaged models from MuMIn
for output to latex via texreg
or stargazer
. I'd like to have one table where I can compare two species' response to different sets of abiotic variables, that looks the same as one created from two model objects using
glmtable <- texreg(list(m1, m2).
The above code will work on glm objects but not on averaged model objects created in MuMIn
.
I tried following an example at https://sites.google.com/site/rforfishandwildlifegrads/home/mumin_usage_examples, to output a text table that can be output to latex.
Here's a reproducible example using the cement data:
library(MuMIn)
data(cement)
# full model
fm1 <- lm(y ~ ., data = Cement, na.action = na.fail)
# create and examine candidate models
(ms1 <- dredge(fm1))
# average models with delta AICc <5, include adjusted SE
MA.ests<-model.avg(ms1, subset= delta < 5, revised.var = TRUE)
This works fine. However when I call
MA.ests$avg.model
I get >NULL.
Has avg.model been deprecated? Or is there another way to do this?
I can do a workaround using any of these three calls, but they're not exactly what I want.
coefTable(MA.ests)
coef(MA.ests)
modavg.table <- as.data.frame(summary(MA.ests)$coefmat)
(that is, I don't know how to get these objects into latex without a lot more code.)
Thanks in advance for any suggestions.