This function describes the style of Latex tables to be exported with the function etable
.
style.tex(
main = "base",
depvar.title,
model.title,
model.format,
line.top,
line.bottom,
var.title,
fixef.title,
fixef.prefix,
fixef.suffix,
fixef.where,
slopes.title,
slopes.format,
fixef_sizes.prefix,
fixef_sizes.suffix,
stats.title,
notes.title,
tablefoot,
tablefoot.title,
tablefoot.value,
yesNo,
tabular = "normal"
)
Either "base", "aer" or "qje". Defines the basic style to start from. The styles "aer" and "qje" are almost identical and only differ on the top/bottom lines.
A character scalar. The title of the line of the dependent variables (defaults to "Dependent variable(s):"
if main = "base"
(the 's' appears only if just one variable) and to ""
if main = "aer"
).
A character scalar. The title of the line of the models (defaults to "Model:"
if main = "base"
and to ""
if main = "aer"
).
A character scalar. The value to appear on top of each column. It defaults to "(1)"
. Note that 1, i, I, a and A are special characters: if found, their values will be automatically incremented across columns.
A character scalar. The line at the top of the table (defaults to "\tabularnewline\toprule\toprule"
if main = "base"
and to "\toprule"
if main = "aer"
).
A character scalar. The line at the bottom of the table (defaults to ""
if main = "base"
and to "\bottomrule"
if main = "aer"
).
A character scalar. The title line appearing before the variables (defaults to "\midrule \emph{Variables}"
if main = "base"
and to "\midrule"
if main = "aer"
). Note that the behavior of var.title = " "
(a space) is different from var.title = ""
(the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use "\midrule"
(and not "\midrule "
!--the space!).
A character scalar. The title line appearing before the fixed-effects (defaults to "\midrule \emph{Fixed-effects}"
if main = "base"
and to " "
if main = "aer"
). Note that the behavior of fixef.title = " "
(a space) is different from fixef.title = ""
(the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use "\midrule"
(and not "\midrule "
!--the space!).
A prefix to add to the fixed-effects names. Defaults to ""
(i.e. no prefix).
A suffix to add to the fixed-effects names. Defaults to ""
if main = "base"
) and to "fixed-effects"
if main = "aer"
).
Either "var" or "stats". Where to place the fixed-effects lines? Defaults to "var"
, i.e. just after the variables, if main = "base"
) and to "stats"
, i.e. just after the statistics, if main = "aer"
).
A character scalar. The title line appearing before the variables with varying slopes (defaults to "\midrule \emph{Varying Slopes}"
if main = "base"
and to ""
if main = "aer"
). Note that the behavior of slopes.title = " "
(a space) is different from slopes.title = ""
(the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use "\midrule"
(and not "\midrule "
!--the space!).
Character scalar representing the format of the slope variable name. There are two special characters: "__var__" and "__slope__", placeholers for the variable and slope names. Defaults to "__var__ (__slope__)"
if main = "base"
) and to "__var__ $\times $ __slope__"
if main = "aer"
).
A prefix to add to the fixed-effects names. Defaults to "# "
.
A suffix to add to the fixed-effects names. Defaults to ""
(i.e. no suffix).
A character scalar. The title line appearing before the statistics (defaults to "\midrule \emph{Fit statistics}"
if main = "base"
and to " "
if main = "aer"
). Note that the behavior of stats.title = " "
(a space) is different from stats.title = ""
(the empty string): in the first case you will get an empty row, while in the second case you get no empty row. To get a line without an empty row, use "\midrule"
(and not "\midrule "
!--the space!).
A character scalar. The title appearing just before the notes, defaults to "\medskip \emph{Notes:} "
.
A logical scalar. Whether or not to display a footer within the table. Defaults to TRUE
if main = "aer"
) and FALSE
if main = "aer"
).
A character scalar. Only if tablefoot = TRUE
, value to appear before the table footer. Defaults to "\bottomrule\bottomrule"
if main = "base"
.
A character scalar. The notes to be displayed in the footer. Defaults to "default"
if main = "base"
, which leads to custom footers informing on the type of standard-error and significance codes, depending on the estimations.
A character vector of length 1 or 2. Defaults to "Yes"
if main = "base"
and to "$\checkmark$"
if main = "aer"
(from package amssymb
). This is the message displayed when a given fixed-effect is (or is not) included in a regression. If yesNo
is of length 1, then the second element is the empty string.
Character scalar equal to "normal" (default), "*" or "X". Represents the type of tabular to export.
Returns a list containing the style parameters.
The \checkmark
command, used in the "aer" style (in argument yesNo
), is in the amssymb
package.
The commands \toprule
, \midrule
and \bottomrule
are in the booktabs
package. You can set the width of the top/bottom rules with \setlength\heavyrulewidth{wd}, and of the midrule with \setlength\lightrulewidth{wd}.
# NOT RUN {
# Multiple estimations => see details in feols
aq = airquality
est = feols(c(Ozone, Solar.R) ~
Wind + csw(Temp, Temp^2, Temp^3) | Month + Day,
data = aq)
# Playing a bit with the styles
etable(est, tex = TRUE)
etable(est, tex = TRUE, style.tex = style.tex("aer"))
etable(est, tex = TRUE, style.tex = style.tex("aer",
var.title = "\\emph{Expl. Vars.}",
model.format = "[i]",
yesNo = "x",
tabular = "*"))
# }
Run the code above in your browser using DataLab