| stargazer | R Documentation |
Produces publication-quality regression tables, following the interface of the stargazer package, with native support for modern econometrics packages including fixest and alpaca. Outputs LaTeX, plain-text (ASCII), and HTML tables.
stargazer(
...,
type = "latex",
title = "",
label = "",
dep.var.labels = NULL,
dep.var.caption = NULL,
column.labels = NULL,
column.separate = NULL,
covariate.labels = NULL,
coef.rename = NULL,
omit = NULL,
keep = NULL,
omit.stat = NULL,
digits = 3L,
star.cutoffs = c(0.1, 0.05, 0.01),
star.char = c("*", "**", "***"),
notes = NULL,
notes.append = TRUE,
notes.align = NULL,
notes.label = NULL,
font.size = NULL,
no.space = FALSE,
style = "stargazer2",
obs.label = NULL,
summary.stat = NULL,
median = FALSE,
vcov = NULL,
se = NULL,
se_label = NULL,
out = NULL
)
... |
One or more fitted model objects. Supported classes:
|
type |
Character; output format. One of |
title |
Character; table caption. |
label |
Character; LaTeX cross-reference label (used with
|
dep.var.labels |
Character vector; custom labels for the dependent variable(s). Applied in column order. |
dep.var.caption |
Character; caption text above the dep-var row.
Default: |
column.labels |
Character vector; custom column header labels. Overrides the auto-detected model-type labels. |
column.separate |
Integer vector; controls how many consecutive
columns share each |
covariate.labels |
Character vector; display names for covariates,
applied positionally after |
coef.rename |
Named character vector mapping raw coefficient names to
new display names before the column union is computed. Names are the
existing coefficient names; values are the replacement names. Useful for
aligning TWFE event-study year indicators with relative-time labels from
other estimators, e.g.
|
omit |
Character vector; regex patterns — covariates whose names match any pattern are excluded from the table. |
keep |
Character vector; regex patterns — only covariates whose
names match are included (applied after |
omit.stat |
Character vector; stat identifiers to suppress.
Recognised values: |
digits |
Integer; number of decimal places for coefficients, SEs,
and most fit statistics. Default: |
star.cutoffs |
Numeric vector of length 3; p-value thresholds for
one, two, and three stars. Default: |
star.char |
Character vector of length 3; star symbols. Default:
|
notes |
Character vector; additional table notes appended after the SE-type note. |
notes.append |
Logical; if |
notes.align |
Character; cell alignment for the note row in LaTeX
( |
notes.label |
Character; text preceding the note. Default:
|
font.size |
Character; LaTeX font-size command (e.g.
|
no.space |
Logical; suppress blank spacer rows in the table body.
Only affects |
style |
Character; table formatting style. Controls overall layout, rule style, notes format, and significance-note wording.
|
obs.label |
Character; overrides the label for the Observations row.
Defaults to the style preset ( |
summary.stat |
Character vector; which summary statistics to include
when |
median |
Logical; if |
vcov |
List of variance-covariance matrices (one per model, or
|
se |
List of numeric vectors of standard errors (one per model,
or |
se_label |
Character vector (one per model, or a single string
applied to all) overriding the auto-detected SE-type description used
in the table note. Useful when supplying a |
out |
Character; file path. If provided, output is written to the file (appending the appropriate extension if absent). The table string is also returned invisibly. |
The rendered table as a single character string, returned
invisibly. Also printed to the console unless out is specified.
m1 <- lm(mpg ~ cyl + hp, mtcars)
m2 <- lm(mpg ~ cyl + hp + wt, mtcars)
stargazer(m1, m2, type = "text")
stargazer(m1, m2, type = "latex")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.