The number of models and objects can stargazer can accommodate puts it ahead of most of the alternative R-to-LaTeX options. In addition, stargazer also supports several Zelig models for social network analysis:, ,, and. These include objects from betareg (betareg), coxph (survival), clm (ordinal), clogit (survival), ergm (ergm),gam (mgcv), gee (gee), glm (stats), glmer (lme4), gls (nlme), hurdle (pscl), ivreg (AER), lm (stats), lmer (lme4), lmrob (robustbase), multinom (nnet), nlmer (lme4), plm (plm), pmg (plm), polr (MASS), rlm (MASS), svyglm (survey), survreg (survival), tobit (AER), zeroinfl (pscl), as well as from the implementation of these in Zelig. Stargazer supports objects from the most widely used statistical functions and packages. Stargazer(linear.1, linear.2, probit.model, title="Regression Results", align=TRUE) Probit.model <- glm(high.rating ~ learning + critical + advance, data=attitude, family = binomial(link = "probit"))
We can set the align argument to TRUE, so that coefficients in each column are aligned along the decimal point: # 2 OLS models Now, let us try to create a simple regression table with three side-by-side models – two Ordinary Least Squares (OLS) and one probit regression model – using the lm() and glm() functions. To output the contents of the first four rows of same data frame, specify the part of the data frame you would like to see, and set the summary option to FALSE: stargazer(attitude, summary=FALSE) To create a summary statistics table from the ‘attitude’ data frame (which should be available with your default installation of R), simply run the following: stargazer(attitude)
LATEXIT TABLE INSTALL
You can install stargazer from CRAN in the usual way: install.packages("stargazer") By contrast, if the user feeds it a data frame, stargazer will know that the user is most likely looking for a summary statistics table or – if the summary argument is set to false – wants to output the content of the data frame.Ī quick reproducible example shows just how easy stargazer is to use. If stargazer is given a set of regression model objects, for instance, the package will create a side-by-side regression table. The package is intelligent, and tries to minimize the amount of effort the user has to put into adjusting argument values. The learning curve is very mild and all arguments are very intuitive, so that even a beginning user of R or LaTeX can quickly become familiar with the package’s many capabilities. Stargazer was designed with the user’s comfort in mind.
Compared to available alternatives, stargazer excels in three regards: its ease of use, the large number of models it supports, and its beautiful aesthetics. It can also output the content of data frames directly into LaTeX.
LATEXIT TABLE CODE
Stargazer is a new R package that creates LaTeX code for well-formatted regression tables, with multiple models side-by-side, as well as for summary statistics tables.