How do I call stargazer on a list of models?
do.call, r, stargazer
Solution
Please make sure you are using an up-to-date version of the package. Starting with version 4.5.3 (available on CRAN since Nov 2013), `stargazer` has been able to accept lists of object in exactly the way you would expect:
`stargazer(l, title="Results", align=TRUE, type="text")`
Problem
I just ran a series of models in a nice, flexible way that enforced data-code separation. I had a nice list of formulas and models in my configuration section which I `lapply`'d over to get a list of model objects. Now I want to display them in `stargazer`, but it doesn't take a list object. How do I do this without having to type out each list element? Reproducible example: ``` require(stargazer) l <- list() l$lm1 <- lm(rating ~ complaints + privileges + learning + raises + critical, data=attitude) l$lm2 <- lm(rating ~ complaints + privileges + learning, data=attitude) ## create an indicator dependent variable, and run a probit model attitude$high.rating <- (attitude$rating > 70) l$prbt <- glm(high.rating ~ learning + critical + advance, data=attitude, family = binomial(link = "probit")) stargazer( l[[1]], l[[2]], l[[3]], title="Results", align=TRUE, type="text") ```