Title: | Well-Formatted Regression and Summary Statistics Tables |
---|---|
Description: | Produces LaTeX code, HTML/CSS code and ASCII text for well-formatted tables that hold regression analysis results from several models side-by-side, as well as summary statistics. |
Authors: | Marek Hlavac <[email protected]> |
Maintainer: | Marek Hlavac <[email protected]> |
License: | GPL (>= 2) |
Version: | 5.2.3 |
Built: | 2024-10-31 21:07:09 UTC |
Source: | https://github.com/cran/stargazer |
The stargazer
command produces LaTeX code, HTML code and ASCII text for well-formatted tables that hold regression analysis results from several models side-by-side. It can also output summary statistics and data frame content. stargazer
supports a large number model objects from a variety of packages. Please see stargazer models.
stargazer( ..., type = "latex", title = "", style = "default", summary = NULL, out = NULL, out.header = FALSE, column.labels = NULL, column.separate = NULL, covariate.labels = NULL, dep.var.caption = NULL, dep.var.labels = NULL, dep.var.labels.include = TRUE, align = FALSE, coef = NULL, se = NULL, t = NULL, p = NULL, t.auto = TRUE, p.auto = TRUE, ci = FALSE, ci.custom = NULL, ci.level = 0.95, ci.separator = NULL, add.lines = NULL, apply.coef = NULL, apply.se = NULL, apply.t = NULL, apply.p = NULL, apply.ci = NULL, colnames = NULL, column.sep.width = "5pt", decimal.mark = NULL, df = TRUE, digit.separate = NULL, digit.separator = NULL, digits = NULL, digits.extra = NULL, flip = FALSE, float = TRUE, float.env="table", font.size = NULL, header = TRUE, initial.zero = NULL, intercept.bottom = TRUE, intercept.top = FALSE, keep = NULL, keep.stat = NULL, label = "", model.names = NULL, model.numbers = NULL, multicolumn = TRUE, no.space = NULL, notes = NULL, notes.align = NULL, notes.append = TRUE, notes.label = NULL, object.names = FALSE, omit = NULL, omit.labels = NULL, omit.stat = NULL, omit.summary.stat = NULL, omit.table.layout = NULL, omit.yes.no = c("Yes", "No"), order = NULL, ord.intercepts = FALSE, perl = FALSE, report = NULL, rownames = NULL, rq.se = "nid", selection.equation = FALSE, single.row = FALSE, star.char = NULL, star.cutoffs = NULL, suppress.errors = FALSE, table.layout = NULL, table.placement = "!htbp", zero.component = FALSE, summary.logical = TRUE, summary.stat = NULL, nobs = TRUE, mean.sd = TRUE, min.max = TRUE, median = FALSE, iqr = FALSE )
stargazer( ..., type = "latex", title = "", style = "default", summary = NULL, out = NULL, out.header = FALSE, column.labels = NULL, column.separate = NULL, covariate.labels = NULL, dep.var.caption = NULL, dep.var.labels = NULL, dep.var.labels.include = TRUE, align = FALSE, coef = NULL, se = NULL, t = NULL, p = NULL, t.auto = TRUE, p.auto = TRUE, ci = FALSE, ci.custom = NULL, ci.level = 0.95, ci.separator = NULL, add.lines = NULL, apply.coef = NULL, apply.se = NULL, apply.t = NULL, apply.p = NULL, apply.ci = NULL, colnames = NULL, column.sep.width = "5pt", decimal.mark = NULL, df = TRUE, digit.separate = NULL, digit.separator = NULL, digits = NULL, digits.extra = NULL, flip = FALSE, float = TRUE, float.env="table", font.size = NULL, header = TRUE, initial.zero = NULL, intercept.bottom = TRUE, intercept.top = FALSE, keep = NULL, keep.stat = NULL, label = "", model.names = NULL, model.numbers = NULL, multicolumn = TRUE, no.space = NULL, notes = NULL, notes.align = NULL, notes.append = TRUE, notes.label = NULL, object.names = FALSE, omit = NULL, omit.labels = NULL, omit.stat = NULL, omit.summary.stat = NULL, omit.table.layout = NULL, omit.yes.no = c("Yes", "No"), order = NULL, ord.intercepts = FALSE, perl = FALSE, report = NULL, rownames = NULL, rq.se = "nid", selection.equation = FALSE, single.row = FALSE, star.char = NULL, star.cutoffs = NULL, suppress.errors = FALSE, table.layout = NULL, table.placement = "!htbp", zero.component = FALSE, summary.logical = TRUE, summary.stat = NULL, nobs = TRUE, mean.sd = TRUE, min.max = TRUE, median = FALSE, iqr = FALSE )
... |
one or more model objects (for regression analysis tables) or data frames/vectors/matrices (for summary statistics, or direct output of content). They can also be included as lists (or even lists within lists). |
type |
a character vector that specifies what type of output the command should produce. The possible values are |
title |
a character vector with titles for the tables. |
style |
a character string that specifies what style, typically designed to resemble an existing academic journal, should be used in producing the tables. This argument is not case-sensitive. See list of supported styles. |
summary |
a logical value indicating whether the package should output a summary statistics table when given a data frame. If |
out |
a character vector that contains the path(s) of output files. Depending on the file extension (.tex, .txt, .htm or .html), either a LaTeX/HTML source file or an ASCII text output file will be produced. For any other file extension, the value of the |
out.header |
a logical value that indicates whether the LaTeX or HTML file output should contain a code header (if TRUE) or just the chunk of code that creates the output (if FALSE). |
column.labels |
a character vector of labels for columns in regression tables. Their layout, in terms of the number of columns associated with each label, is given by the argument |
column.separate |
a numeric vector that specifies how |
covariate.labels |
a character vector of labels for covariates in regression tables. A value of |
dep.var.caption |
a character vector that specifies the caption to appear above dependent variable labels. A value of |
dep.var.labels |
a character vector of labels for the dependent variables in regression tables. A value of |
dep.var.labels.include |
a logical value that toggles whether dependent variable labels will be included in the regression table. |
align |
a logical value indicating whether numeric values in the same column should be aligned at the decimal mark in LaTeX output. Requires |
coef |
a list of numeric vectors that will replace the default coefficient values for each model. Element names will be used to match coefficients to individual covariates, and should therefore match covariate names. A |
se |
a list of numeric vectors that will replace the default coefficient values for each model. Behaves exactly like the argument |
t |
a list of numeric vectors that will replace the default test statistics (e.g., t-scores, or z-scores) for each model. Like |
p |
a list of numeric vectors that will replace the default p-values for each model. Matched by element names. These will form the basis of decisions about significance stars. |
t.auto |
a logical value that indicates whether |
p.auto |
a logical value that indicates whether |
ci |
a logical vector that indicates, for each column, whether |
ci.custom |
a list of two-column numeric matrices that will replace the default confidence intervals for each model. The first and second columns represent the lower and the upper bounds, respectively. Matched by element names. |
ci.level |
a numeric vector that specifies, for each column, the confidence level to be used in regression tables when argument |
ci.separator |
a character string that will serve as the separator between the lower and upper bounds of reported confidence intervals. |
add.lines |
a list of vectors (one vector per line) containing additional lines to be included in the table. Each element of the listed vectors will be put into a separate column. |
apply.coef |
a function that will be applied to the coefficients. |
apply.se |
a function that will be applied to the standard errors. |
apply.t |
a function that will be applied to the test statistics. |
apply.p |
a function that will be applied to the p-values. |
apply.ci |
a function that will be applied to the lower and upper bounds of the confidence intervals. |
colnames |
a logical value that toggles column names on or off when printing data frames, vectors or matrices. |
column.sep.width |
a character string that specifies, in LaTeX code, the width of the space that separates columns in LaTeX tables. The default value is |
decimal.mark |
a character string that will serve as the decimal mark. For instance, the string |
df |
a logical value that indicates whether the degrees of freedom of model statistics should be reported. |
digit.separate |
a numeric vector that indicates where digit separators should be placed. The first element of the vector indicates the number of digits (counted from the decimal mark to the left) that will be separated. The second element indicates the number of digits that will be separated from that 'first' separator, and so on. A value of |
digit.separator |
a character string that will serve as the digit (e.g., thousands) separator. Commonly used strings include |
digits |
an integer that indicates how many decimal places should be used. A value of |
digits.extra |
an integer indicating the maximum number of additional decimal places to be used if a number, rounded to |
flip |
a logical value that flips the vertical and horizontal axes when printing summary statistic tables or vector, matrix and data frame content. |
float |
a logical value that indicates whether the resulting table will be a floating table (set off, for instance, by |
float.env |
a character string that specifies the floating environment of the resulting LaTeX table (when argument |
font.size |
a character string that specifies the font size used in the table. The font can be one of the following: |
header |
a logical value indicating whether a header (containing the name and version of the package, the author's name and contact information, and the date and time of table creation) should appear in comments at the beginning of the LaTeX code. |
initial.zero |
a logical value indicating whether an initial zero should be printed before the decimal mark if a number is between 0 and 1. |
intercept.bottom |
a logical value indicating whether the intercept (or constant) coefficients should be on the bottom of the table. |
intercept.top |
a logical value indicating whether the intercept (or constant) coefficients should be on the top of the table. |
keep |
a vector of regular expressions that specifies which of the explanatory variables should be kept in the table. Alternatively, this argument can be a numeric vector whose elements indicate which variables (from top to bottom, or left to right) should be kept. The default value of |
keep.stat |
a character vector that specifies which model statistics should be kept in the regression table output. For instance |
label |
a character string containing the |
model.names |
a logical value indicating whether model names (e.g., "OLS" or "probit") should be included in the table. |
model.numbers |
a logical value indicating whether models should be numbered. No number is used whenever a regression table includes only one model. |
multicolumn |
a logical value indicating whether dependent variables and model names (e.g., "OLS" or "probit") should be reported across several columns if they remain identical. |
no.space |
a logical value indicating whether all empty lines should be removed from the table. |
notes |
a character vector containing notes to be included below the table. The character strings can include special substrings that will be replaced by the corresponding cutoffs for statistical significance 'stars': |
notes.align |
a character string that specifies how notes should be aligned under the table. One of three strings can be used: |
notes.append |
a logical value that indicates whether |
notes.label |
a character string containing a label for the notes section of the table. |
object.names |
a logical value indicating whether object names should be included in the table. |
omit |
a vector of regular expressions that specifies which of the explanatory variables should be omitted from presentation in the table. Alternatively, this argument can be a numeric vector whose elements indicate which variables (from top to bottom, or left to right) should be omitted. This argument might be used, for instance, to exclude fixed effects dummies from being presented. The default value of |
omit.labels |
a character vector of labels that correspond to each of the regular expressions in |
omit.stat |
a character vector that specifies which model statistics should be omitted from regression table output. For instance |
omit.summary.stat |
a character vector that specifies which summary statistics should be omitted from summary statistics table output. See the list of summary statistic codes. This argument is not case-sensitive. |
omit.table.layout |
a character string that specifies which parts of the table should be omitted from the output. Each letter in the string indicates a particular part of the table, as specified by the table layout characters. For instance, |
omit.yes.no |
a character vector of length 2 that contains the 'yes' and 'no' strings to indicate whether, in any specific model, variables were omitted from the table, as specified by |
order |
a vector of regular expressions (or of numerical indexes) that indicates the order in which variables will appear in the output. |
ord.intercepts |
a logical value indicating whether intercepts for models with ordered dependent variables (such as ordered probit, or ordered logit) are included in the table. |
perl |
a logical value indicating whether perl-compatible regular expressions should be used. If |
report |
a character string containing only elements of |
rownames |
a logical value that toggles row names on or off when printing data frames, vectors or matrices. |
rq.se |
a character string that specifies the method used to compute standard errors for |
single.row |
a logical value that indicates whether regression and standard errors (or confidence intervals) should be reported on the same row. For convenience in formatting the resulting table, argument |
selection.equation |
a logical value that indicates whether the selection equation (when argument is set to |
star.char |
a character string to be used as the 'star' to denote statistical significance. |
star.cutoffs |
a numeric vector that indicates the statistical signficance cutoffs for the statistical significance 'stars.' For elements with |
suppress.errors |
a logical value that indicates whether |
table.layout |
a character string that specifies which parts of the table should be included in the output, in the order provided by the user. Each letter in the string indicates a particular part of the table, as specified by the table layout characters. For instance, |
table.placement |
a character string containing only elements of |
zero.component |
a logical value indicating whether to report coefficients for the |
summary.logical |
a logical value indicating whether logical variables should be reported in summary statistics table. If so, they will be treated as if they had values of 0 (corresponding to |
summary.stat |
a character vector that specifies which summary statistics should be included in the summary statistics table output. See the list of summary statistic codes. This argument is not case-sensitive.). |
nobs |
a logical value that toggles whether the number of observations (N) for each variable is shown in summary statistics tables. |
mean.sd |
a logical value that toggles whether variable means and standard deviations are shown in summary statistics tables. |
min.max |
a logical value that toggles whether variable minima and maxima are shown in summary statistics tables. |
median |
a logical value that toggles whether variable medians are shown in summary statistics tables. |
iqr |
a logical value that toggles whether the 25th and 75th percentiles for each variable are shown in summary statistics tables. ('iqr' stands for interquartile range.) |
Arguments with a value of NULL
will use the default settings of the requested style
.
stargazer
uses cat()
to output LaTeX/HTML code or ASCII text for the table. To allow for further processing of this output, stargazer
also returns the same output invisibly as a character vector. You can include the produced tables in your paper by inserting stargazer
LaTeX output into your publication's TeX source. Alternatively, you can use the out
argument to save the output in a .tex or .txt file.
To include stargazer
tables in Microsoft Word documents (e.g., .doc or .docx), please follow the following procedure: Use the out
argument to save output into an .htm or .html file. Open the resulting file in your web browser. Copy and paste the table from the web browser to your Microsoft Word document.
I would like to thank everyone who has tested this package, or provided useful comments and suggestions. Please see stargazer package acknowledgments.
See stargazer news for a list of new models and features in each release of stargazer
.
Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables. R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
Dr. Marek Hlavac < marek.hlavac at gmail.com >
Social Policy Institute, Bratislava, Slovakia
## create summary statistics table for 'attitude' data frame stargazer(attitude) ## list the content of the data frame 'attitude' stargazer(attitude, summary=FALSE) ## 2 OLS models linear.1 <- lm(rating ~ complaints + privileges + learning + raises + critical, data=attitude) linear.2 <- lm(rating ~ complaints + privileges + learning, data=attitude) ## create an indicator dependent variable, and run a probit model attitude$high.rating <- (attitude$rating > 70) probit.model <- glm(high.rating ~ learning + critical + advance, data=attitude, family = binomial(link = "probit")) stargazer(linear.1, linear.2, probit.model, title="Regression Results") ## report ASCII text for a table with 90 percent confidence ## intervals reported on the same row as coefficients ## and omitting F statistics and the residual standard error stargazer(linear.1, linear.2, probit.model, type="text", title="Regression Results", single.row=TRUE, ci=TRUE, ci.level=0.9, omit.stat=c("f", "ser")) ### re-order the models and only keep explanatory ### variables that contain "complaints", "learning", ### "raises" and "critical"; report these with standard ### errors, and put "learning" and "raises" before ### the other explanatory variables; of the summary ### statistics, only keep the number of observations stargazer(probit.model, linear.1, linear.2, type="text", keep=c("complaints","learning","raises","critical"), keep.stat="n", order=c("learning", "raises")) ### apply a function to the coefficients and standard errors ### that will multiply them by ten; you can think of this ### as a change in units multiply.by.10 <- function(x) (x * 10) stargazer(probit.model, linear.1, linear.2, apply.coef=multiply.by.10, apply.se=multiply.by.10) ### print out HTML code for a correlation matrix correlation.matrix <- cor(attitude) stargazer(correlation.matrix, type="html")
## create summary statistics table for 'attitude' data frame stargazer(attitude) ## list the content of the data frame 'attitude' stargazer(attitude, summary=FALSE) ## 2 OLS models linear.1 <- lm(rating ~ complaints + privileges + learning + raises + critical, data=attitude) linear.2 <- lm(rating ~ complaints + privileges + learning, data=attitude) ## create an indicator dependent variable, and run a probit model attitude$high.rating <- (attitude$rating > 70) probit.model <- glm(high.rating ~ learning + critical + advance, data=attitude, family = binomial(link = "probit")) stargazer(linear.1, linear.2, probit.model, title="Regression Results") ## report ASCII text for a table with 90 percent confidence ## intervals reported on the same row as coefficients ## and omitting F statistics and the residual standard error stargazer(linear.1, linear.2, probit.model, type="text", title="Regression Results", single.row=TRUE, ci=TRUE, ci.level=0.9, omit.stat=c("f", "ser")) ### re-order the models and only keep explanatory ### variables that contain "complaints", "learning", ### "raises" and "critical"; report these with standard ### errors, and put "learning" and "raises" before ### the other explanatory variables; of the summary ### statistics, only keep the number of observations stargazer(probit.model, linear.1, linear.2, type="text", keep=c("complaints","learning","raises","critical"), keep.stat="n", order=c("learning", "raises")) ### apply a function to the coefficients and standard errors ### that will multiply them by ten; you can think of this ### as a change in units multiply.by.10 <- function(x) (x * 10) stargazer(probit.model, linear.1, linear.2, apply.coef=multiply.by.10, apply.se=multiply.by.10) ### print out HTML code for a correlation matrix correlation.matrix <- cor(attitude) stargazer(correlation.matrix, type="html")
I would like to thank everyone who has tested this package, or provided useful suggestions. I am especially grateful to the following people, listed in alphabetical order (based on last names):
Ross Ahmed, Newcastle University, UK
Liviu Andronic, University of Toulouse, France
Josie Athens, University of Otago, New Zealand
Erin Baggott, Harvard University, USA
Simcha Barkai, University of Chicago, USA
Rodrigo Belo, Carnegie Mellon University, USA
Eva Bernauer, University of Mannheim, Germany
Daniel Bjorkegren, Brown University, USA
Ruben de Bliek, Erasmus University Rotterdam, Netherlands
Michael Carniol, University of Pennsylvania, USA
Julian Chan, Boston University, USA
Chetan Chawla, University of Massachusetts-Amherst, USA
Dana Chandler, Massachussetts Institute of Technology, USA
Volha Charnych, Harvard University, USA
Ben Charoenwong, University of Chicago, USA
John Coglianese, Harvard University, USA
Randy Cragun, Clemson University, USA
Dominik Cremer-Schulte, National Research Institute of Science and Technology for Environment and Agriculture (Irstea), France
Brandon de la Cuesta, Princeton University, USA
Sebastian Daza, University of Wisconsin-Madison, USA
Bryan Dettrey, Pennsylvania State University, USA
Stefan Dimitriadis, Harvard University, USA
Bonnie Dixon, University of California-Davis, USA
Gregory Eady, University of Toronto, Canada
Maximilian Eber, Harvard University, USA
Jing Fang, Huazhong University of Science and Technology, China
Thiemo Fetzer, London School of Economics, UK
Andrey Fradkin, Stanford University, USA
Bernard Fraga, Harvard University, USA
Tal Galili, Tel Aviv University, Israel
Cheng Gao, Harvard University, USA
Simen Gaure, Frisch Centre for Economic Research, Oslo, Norway
Charlie Gibbons, University of California-Berkeley, USA
Rebecca Goldstein, Harvard University, USA
Charlie Gomez, Stanford University, USA
Josiah Grover, Ball State University, USA
Andrew Heiss, Duke University, USA
Rasmus Hertzum, Glostrup University Hospital, Denmark
F. Daniel Hidalgo, Massachusetts Institute of Technology, USA
Gregor Hochschild, Germany
Christian Horea, University of Heidelberg, Germany
Connor Huff, Harvard University, USA
Nicole Janz, University of Cambridge, UK
Vitalijs Jascisens, Toulouse School of Economics, France
Melissa Kline, Massachussetts Institute of Technology, USA
Maxim Kovalenko, University of Antwerp, Belgium
Michael Kranz, University of Illinois, USA
Johannes Kutsam, Johann Kepler University, Linz, Austria
Michal Kvasnicka, Masaryk University, Brno, Czech Republic
Akos Lada, Harvard University, USA
Christopher Lee, McGill University, Canada
Yphtach Lelkes, University of Amsterdam, Netherlands
Carl Jacob Liebersohn, Massachussetts Institute of Technology, USA
Daniel Yew Mao Lim, Harvard University, USA
Eric Lin, Harvard University, USA
Christopher Lucas, Harvard University, USA
Jochen Luedering, University of Giessen, Germany
Richard Martin, University of Victoria, Canada
Miguel Godinho de Matos, Catolica-Lisbon, Portugal
Tamim Mohammad, University of Massachussetts-Boston, USA
Filip Moren, Lund University, Sweden
Samuel Moy, The Brattle Group, USA
Christoph Nguyen, Northwestern University, USA
Dominic Nyhuis, University of Mannheim, Germany
Ohchan Kwon, Harvard University, USA
Nick Obradovich, University of California-San Diego, USA
Stan Oklobdzija, University of California-San Diego, USA
Suhas D. Parandekar, The World Bank
Nathan Paxton, American University, USA
Stephen Pettigrew, Harvard University, USA
Giuseppe Ragusa, Luiss University, Rome, Italy
Christoph Riedl, Northeastern University, USA
James Rising, Columbia University, USA
James Ryans, University of California-Berkeley, USA
Francesco Sarracino, STATEC, Luxembourg
Martijn Schoonvelde, University of Exeter, United Kingdom
Jason Sclar, Harvard University, USA
Jennifer Sheehy-Skeffington, Harvard University, USA
Boris Shor, University of Chicago, USA
Zachary Steinert-Threkeld, University of California-San Diego, USA
Emily Stephen, Boston University, USA
Bryan Stroube, University of Maryland, USA
Ivan Sutoris, CERGE-EI, Czech Republic
Deirdre Sutula, University of California-Berkeley, USA
David Szakonyi, Columbia University, USA
Kevin Tappe, University of Stuttgart, Germany
Beth Truesdale, Harvard University, USA
Clara Ulmer, Ulm University, Germany
Anna Weisfeiler, University of Wisconsin-Madison, USA
Carl Witthoft, UTC Aerospace Systems, USA
Minkeun Woo, Stanford University, USA
Alex Wood-Doughty, University of California-Santa Barabara, USA
Yuan "Clara" Yuan, Virginia Tech, USA
Jan Zilinsky, University of Chicago, USA
Steffen Zittlau, University of Mannheim, Germany
This page summarizes the models that stargazer
supports. Please note that I am always looking for comments and suggestions. Do not hesitate to contact me at mhlavac [at] alumni.princeton.edu.
The package name is indicated in bold and is followed by a list of functions/object types.
AER:
- ivreg
- tobit
betareg:
- betareg
brglm:
- brglm
censReg:
- censReg
dynlm:
- dynlm
eha:
- aftreg
- coxreg
- mlreg
- phreg
- weibreg
erer:
- maBina
ergm:
- ergm
fGarch:
- garchFit
gee:
- gee
glmx:
- hetglm
gmm:
- gmm
lfe:
- felm
lme4:
- glmer
- lmer
- nlmer
lmtest:
- coeftest
MASS:
- polr
- rlm
- survreg
mclogit:
- mclogit
mgcv:
- gam
mlogit:
- mlogit
mnlogit:
- mnlogit
nlme:
- gls
- lme
- nlme
nnet:
- multinom
ordinal:
- clm
plm:
- pgmm
- plm
- pmg
pscl:
- hurdle
- zeroinfl
rms:
- bj
- cph
- Glm
- Gls
- lrm
- ols
- psm
- Rq
relevent:
- rem.dyad
rq:
- quantreg
robustbase:
- glmrob
- lmrob
sampleSelection:
- binaryChoice
- heckit
- probit
- selection
spdep:
- errorsarlm
- largarlm
stats:
- arima
- glm
- lm
survey:
- svyglm
survival:
- coxph
- clogit
- survreg
Zelig:
- the implementation of the above models
- relogit
- cloglog.net
- gamma.net
- probit.net
- logit.net
This page summarizes the models, features, and bug fixes that were introduced in each release of stargazer
. Please note that I am always looking for comments and suggestions. Do not hesitate to contact me at mhlavac [at] alumni.princeton.edu.
v. 5.2.3:
- very minor update: logical coercion of length longer than one removed
v. 5.2.2:
- very minor update: removed instances in code where if/while statement is used with a condition of length greater than one
v. 5.2.1:
- very minor update: updated author contact information
v. 5.2:
- New models:
– arima (stats)
– censReg (censReg)
– garchFit (fGarch)
– glmrob (robustbase)
– lme (nlme)
– nlme (nlme)
– mnlogit (mnlogit)
– pgmm (plm)
- New features:
– decimal mark (argument decimal.mark
) now gets automatically updated in notes (argument notes
)
- Fixed bugs:
– felm (lfe) working again
– fixed formatting issues that led to an occasional inability to produce ASCII text output
– much faster output of multi-model tables with many omitted variables
– negative numbers are now properly displayed when initial.zero
is set to FALSE
– fixed minor bug that occasionally led to a misalignment of additional lines (argument add.lines
)
– lm() and glm() models now report AIC and BIC
– underscores are now properly formatted in column and dependent variable labels
– fixed an issue with the mlogit model that led LR tests to crash the output when no intercept was present
v. 5.1:
- New features:
– the CRAN description now lists packages whose usefulness is enhanced by stargazer
- Fixed bugs
– labels that indicate whether variables have been omitted from the model are now correctly assigned (argument omit.labels
)
– argument summary.stat
now functions properly
– out.header
and header
can both be set to false at the same time
– minor formatting changes
v. 5.0:
- New models:
– felm (lfe)
- New features:
– ability to produce HTML/CSS output (argument type
)
– vector and matrix objects are now acceptable (argument ...
)
– additional lines can be included in the tables (argument add.lines
)
– table layout is now fully customizable (arguments table.layout
and omit.table.layout
)
– choice over which summary statistics should be reported (arguments summary.stat
and omit.summary.stat
)
– users can choose whether and the order in which to report coefficients, standard errors, confidence intervals, test statistics and p-values (argument report
)
– object names can be reported above each column (argument object.names
)
– option to toggle the reporting of dependent variables and model names across several columns (argument multicolumn
)
– reporting of model statistics' degrees of freedom can now be suppressed (argument df
)
– users can now include more than three statistical significance cutoffs (argument star.cutoffs
)
– regression, summary statistic and data frame table can now be flipped (argument flip
)
– colnames and rownames can be included in, or excluded from, data frame content tables (arguments colnames
and rownames
)
– argument summary
can now have a different value for each table within a single stargazer()
call
– if arguments coef
, se
, t
, p
, ci.custom
and add.lines
only contain a single vector, they will be accepted as though they were a list containing the same vector
- Fixed bugs:
– fixed bug that caused the number of observations to be misreported in complicated models
– fixed bug that led to the omission of coefficients from output when multiple models had a single regressor
– notes
now working well for summary statistics and data frame tables
– font size can now be change even if floating environment is not used
– fixed compatability issues with latest version of Zelig
– argument apply.ci
now works properly
– minor formatting changes
v. 4.5.3:
- New features:
– model objects can now be passed to stargazer in a list (argument ...
)
- Fixed bugs:
– fixed problem with printing negative numbers in data frame and summary statistics tables
– corrected formatting of column widths in ASCII text output
– minor bug with lme4 covariate names corrected
v. 4.5.2:
- Fixed bugs:
– much faster output
– now compatible with the updated lme4 package
– corrected a bug that prevented users from including multiple models with a single covariate + intercept
– underscores now print correctly in ASCII text output
v. 4.5.1:
- Fixed bugs:
– fixed a bug involving the calculation of t-statistics from user-given coefficients and standard errors
v. 4.5:
- New models:
– binaryChoice (sampleSelection)
– brglm (brglm)
– coeftest (lmtest)
– heckit (sampleSelection)
– maBina (erer)
– mclogit (mclogit)
– mlogit (mlogit)
– selection (sampleSelection)
- New features:
– explanatory variables can be ordered in customizable ways (argument order
)
– custom functions can now be applied to coefficients (argument apply.coef
), standard errors (argument apply.se
), test statistics (argument apply.t
), p-values (argument apply.p
), and confidence intervals (argument apply.ci
)
– keep explanatory variables and statistics based on regular expressions (argument keep
and keep.stat
)
– users can customize confidence intervals (argument custom.ci
)
– ability to have both standard errors and confidence intervals in the same table (argument ci
is now a logical vector)
– different confidence levels for each individual column (argument ci.level
is now a vector)
– ability to omit and keep variables based on their position in the table
- Fixed bugs:
– citation and change log updates
– minor formatting changes
v. 4.0:
- New models:
– aftreg (eha)
– bj (rms)
– coxreg (eha)
– cph (rms)
– dynlm (dynlm)
– errorsarlm (spdep)
– Glm (rms)
– Gls (rms)
– gmm (gmm)
– hetglm (glmx)
– lrm (rms)
– mlreg (eha)
– lagsarlm (spdep)
– ols (rms)
– phreg (eha)
– psm (rms)
– rem.dyad (relevent)
– rq (quantreg)
– Rq (rms)
– weibreg (eha)
- New features:
– the package can produce ASCII text output, in addition to LaTeX code (argument type
)
– output directly to .tex or .txt files (argument out
)
– column labels (arguments column.labels
and column.separate
)
– confidence intervals (arguments ci
, ci.level
and ci.separator
)
– coefficients and standard errors/confidence intervals can now be reported in the same row (argument single.row
)
– users can choose to omit all empty lines in a table (argument no.space
)
– notes can now be appended to, rather than always replace, the default notes for a given style (argument notes.append
)
– ability to customize the dependent variable caption (argument dep.var.caption
)
– font size can now be changed (argument font.size
)
– comments header (with package and author name, version, date and time) can now be suppressed (argument header
)
– ability to change or disable the floating environment (arguments float
and float.env
)
– table placement settings (argument table.placement
)
– customization of column spacing (argument column.sep.width
)
– perl-compatible regular expressions (argument perl
)
- Fixed bugs:
– all columns are now displayed for multinom
objects
– better positioning of tables in the LaTeX document
– minor formatting changes
v. 3.0.1:
- Fixed bugs:
– corrected an issue that led to problems when printing data frames with multiple decimal places
– some reporting and formatting changes to summary statistics and data frame tables
v. 3.0:
- New models:
– clm (ordinal)
– clogit (survival)
– ergm (ergm)
– glmer (lme4)
– gls (nlme)
– lmer (lme4)
– lmrob (robustbase)
– nlmer (lme4)
– pmg (plm)
– rlm (MASS)
- New features:
– users can customize coefficients (argument coef
), standard errors (se
), test statistics (t
), and p-values (p
)
– automatic calculation of z-scores and p-values when the user supplies custom standard errors (can be toggled using arguments t.auto
and p.auto
)
– ability to set \label{}
markers in TeX for each table (using argument label
)
– summary statistics table can now report logical (i.e., dummy, indicator) variables as if they had values of 0 (corresponding to FALSE
) and 1 (TRUE
). See argument summary.logical
.
– user can choose between rounding to a set number of decimal places (argument digits
) and reporting all available decimal places (by setting digits
equal to NA
)
– can omit all test statistics
- Fixed bugs:
– package runs much faster
– corrected p-values for polr() and zelig oprobit, ologit models
– coxph now, by default, reports robust standard errors, for consistency with its summary() output
– multinom models now report the first set of coefficients (when multiple sets are present), instead of producing an error
– singularities in model regression no longer disrupt the output
– model formulas can now be symbols
– no more warnings when creating summary statistics tables
– minor formatting changes
v. 2.0.1:
- Fixed bugs:
– stargazer now reports the correct number of observations for plm() models
v. 2.0:
- New models:
– betareg (betareg)
– hurdle (pscl)
– ivreg (AER)
– multinom (nnet)
– plm (plm)
– tobit (AER)
– zeroinfl (pscl)
- New features:
– direct output of data frames into LaTeX (summary = FALSE
)
– ability to omit the reporting of selected statistics (using argument omit.stat
)
– alignment of columns at the decimal mark (align = TRUE
)
– automatic coordination of star cutoffs and values in regression table notes
- Fixed bugs:
– argument digits
now works properly
– stargazer
updated to reflect, and work properly with, recent changes to Zelig
– variable names can now contain dollar signs and underscores
– some minor formatting fixes
The following character strings can be used in the keep.stat
and omit.stat
arguments of the stargazer
command.
"all" |
all statistics |
"adj.rsq" |
adjusted R-squared |
"aic" |
Akaike Information Criterion |
"bic" |
Bayesian Information Criterion |
"chi2" |
chi-squared |
"f" |
F statistic |
"ll" |
log-likelihood |
"logrank" |
score (logrank) test |
"lr" |
likelihood ratio (LR) test |
"max.rsq" |
maximum R-squared |
"n" |
number of observations |
"null.dev" |
null deviance |
"Mills" |
Inverse Mills Ratio |
"res.dev" |
residual deviance |
"rho" |
rho |
"rsq" |
R-squared |
"scale" |
scale |
"theta" |
theta |
"ser" |
standard error of the regression (i.e., residual standard error) |
"sigma2" |
sigma squared |
"ubre" |
Un-Biased Risk Estimator |
"wald" |
Wald test |
The following character strings can be used in the style
argument of the stargazer
command. Most styles are designed to resemble an existing academic journal, as listed below.
"all" |
publish every statistic available, incl. t-statistics and p-values |
"all2" |
same as "all" , but omitting t-statistics and p-values |
"default" |
default: publish regression coefficients with standard errors, and the most commonly reported statistics |
"commadefault" |
like "default" , but uses a decimal comma and a single space to separate thousands |
"aer" |
American Economic Review |
"ajps" |
American Journal of Political Science |
"ajs" |
American Journal of Sociology |
"asq" |
Administrative Science Quarterly |
"asr" |
American Sociological Review |
"apsr" |
American Political Science Review |
"demography" |
Demography |
"io" |
International Organization |
"jpam" |
Journal of Policy Analysis and Management |
"qje" |
Quarterly Journal of Economics |
The following character strings can be used in the summary.stat
and omit.summary.stat
arguments of the stargazer
command.
"max" |
maximum |
"mean" |
mean |
"median" |
median |
"min" |
minimum |
"n" |
number of observations |
"p25" |
25th percentile |
"p75" |
75th percentile |
"sd" |
standard deviation |
The following character strings can be used in the table.layout
and omit.table.layout
arguments of the stargazer
command.
"-" |
single horizontal line |
"=" |
double horizontal line |
"-!" |
mandatory single horizontal line |
"=!" |
mandatory double horizontal line |
"l" |
dependent variable caption |
"d" |
dependent variable labels |
"m" |
model label |
"c" |
column labels |
"#" |
model numbers |
"b" |
object names |
"t" |
coefficient table |
"o" |
omitted coefficient indicators |
"a" |
additional lines |
"n" |
notes |
"s" |
model statistics |