This function describes the style of data.frames created with the function etable
.
Usage
style.df(
depvar.title = "Dependent Var.:",
fixef.title = "Fixed-Effects:",
fixef.line = "-",
fixef.prefix = "",
fixef.suffix = "",
slopes.title = "Varying Slopes:",
slopes.line = "-",
slopes.format = "__var__ (__slope__)",
stats.title = "_",
stats.line = "_",
yesNo = c("Yes", "No"),
headers.sep = TRUE,
signif.code = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1),
interaction.combine = " x ",
i.equal = " = ",
default = FALSE
)
Arguments
- depvar.title
Character scalar. Default is
"Dependent Var.:"
. The row name of the dependent variables.- fixef.title
Character scalar. Default is
"Fixed-Effects:"
. The header preceding the fixed-effects. If equal to the empty string, then this line is removed.- fixef.line
A single character. Default is
"-"
. A character that will be used to create a line of separation for the fixed-effects header. Used only iffixef.title
is not the empty string.- fixef.prefix
Character scalar. Default is
""
. A prefix to appear before each fixed-effect name.- fixef.suffix
Character scalar. Default is
""
. A suffix to appear after each fixed-effect name.- slopes.title
Character scalar. Default is
"Varying Slopes:"
. The header preceding the variables with varying slopes. If equal to the empty string, then this line is removed.- slopes.line
Character scalar. Default is
"-"
. A character that will be used to create a line of separation for the variables with varying slopes header. Used only ifslopes.line
is not the empty string.- slopes.format
Character scalar. Default is
"__var__ (__slope__)"
. The format of the name of the varying slopes. The values__var__
and__slope__
are special characters that will be replaced by the value of the variable name and slope name, respectively.- stats.title
Character scalar. Default is
"_"
. The header preceding the statistics section. If equal to the empty string, then this line is removed. If equal to single character (like in the default), then this character will be expanded to take the full column width.- stats.line
Character scalar. Default is
"_"
. A character that will be used to create a line of separation for the statistics header. Used only ifstats.title
is not the empty string.- yesNo
Character vector of length 1 or 2. Default is
c("Yes", "No")
. Used to inform on the presence or absence of fixed-effects in the estimation. If of length 1, then automatically the second value is considered as the empty string.- headers.sep
Logical, default is
TRUE
. Whether to add a line of separation between the headers and the coefficients.- signif.code
Named numeric vector, used to provide the significance codes with respect to the p-value of the coefficients. Default is
c("***"=0.001, "**"=0.01, "*"=0.05, "."=0.10)
. To suppress the significance codes, usesignif.code=NA
orsignif.code=NULL
. Can also be equal to"letters"
, then the default becomesc("a"=0.01, "b"=0.05, "c"=0.10)
.- interaction.combine
Character scalar, defaults to
" x "
. When the estimation contains interactions, then the variables names (after aliasing) are combined with this argument. For example: ifdict = c(x1="Wind", x2="Rain")
and you have the following interactionx1:x2
, then it will be renamed (by default)Wind x Rain
-- usinginteraction.combine = "*"
would lead toWind*Rain
.- i.equal
Character scalar, defaults to
" = "
. Only affects factor variables created with the functioni
, tells how the variable should be linked to its value. For example if you have the Species factor from the iris data set, by default the display of the variable isSpecies = Setosa
, etc. Ifi.equal = ": "
the display becomesSpecies: Setosa
.- default
Logical, default is
FALSE
. IfTRUE
, all the values not provided by the user are set to their default.
Details
@inheritParams etable
The title elements (depvar.title
, fixef.title
, slopes.title
and stats.title
) will be the
row names of the returned data.frame. Therefore keep in mind that any two of them should not be
identical (since identical row names are forbidden in data.frames).
Examples
# 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)
# Default result
etable(est)
#> est.1 est.2 est.3
#> Dependent Var.: Ozone Ozone Ozone
#>
#> Wind -2.693* (0.8549) -2.630* (0.8632) -2.850* (0.8235)
#> Temp 2.373*** (0.2334) -4.009 (3.422) -63.53. (27.70)
#> Temp square 0.0407 (0.0213) 0.8215. (0.3757)
#> Temp cube -0.0034 (0.0017)
#> Fixed-Effects: ----------------- ---------------- ----------------
#> Month Yes Yes Yes
#> Day Yes Yes Yes
#> _______________ _________________ ________________ ________________
#> S.E.: Clustered by: Month by: Month by: Month
#> Observations 116 116 116
#> R2 0.78671 0.79718 0.80469
#> Within R2 0.55271 0.57466 0.59040
#>
#> est.4 est.5 est.6
#> Dependent Var.: Solar.R Solar.R Solar.R
#>
#> Wind 3.031 (1.840) 3.181 (1.921) 3.943 (2.466)
#> Temp 4.787. (2.086) 17.80. (7.057) 234.4 (152.4)
#> Temp square -0.0824 (0.0443) -2.933 (1.969)
#> Temp cube 0.0124 (0.0084)
#> Fixed-Effects: -------------- ---------------- ---------------
#> Month Yes Yes Yes
#> Day Yes Yes Yes
#> _______________ ______________ ________________ _______________
#> S.E.: Clustered by: Month by: Month by: Month
#> Observations 146 146 146
#> R2 0.30641 0.31252 0.32651
#> Within R2 0.08937 0.09740 0.11577
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Playing a bit with the styles
etable(est, style.df = style.df(fixef.title = "", fixef.suffix = " FE",
stats.line = " ", yesNo = "yes"))
#> est.1 est.2 est.3
#> Dependent Var.: Ozone Ozone Ozone
#>
#> Wind -2.693* (0.8549) -2.630* (0.8632) -2.850* (0.8235)
#> Temp 2.373*** (0.2334) -4.009 (3.422) -63.53. (27.70)
#> Temp square 0.0407 (0.0213) 0.8215. (0.3757)
#> Temp cube -0.0034 (0.0017)
#> Month FE yes yes yes
#> Day FE yes yes yes
#> _______________
#> S.E.: Clustered by: Month by: Month by: Month
#> Observations 116 116 116
#> R2 0.78671 0.79718 0.80469
#> Within R2 0.55271 0.57466 0.59040
#>
#> est.4 est.5 est.6
#> Dependent Var.: Solar.R Solar.R Solar.R
#>
#> Wind 3.031 (1.840) 3.181 (1.921) 3.943 (2.466)
#> Temp 4.787. (2.086) 17.80. (7.057) 234.4 (152.4)
#> Temp square -0.0824 (0.0443) -2.933 (1.969)
#> Temp cube 0.0124 (0.0084)
#> Month FE yes yes yes
#> Day FE yes yes yes
#> _______________
#> S.E.: Clustered by: Month by: Month by: Month
#> Observations 146 146 146
#> R2 0.30641 0.31252 0.32651
#> Within R2 0.08937 0.09740 0.11577
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1