Learn R Programming

fixest (version 0.3.1)

etable: Estimations table (export the results of multiples estimations to a DF or to Latex)

Description

Aggregates the results of multiple estimations and displays them in the form of either a Latex table or a data.frame.

Usage

etable(..., se = c("standard", "white", "cluster", "twoway", "threeway",
  "fourway"), dof = getFixest_dof(), cluster, digits = 4, tex, fitstat,
  title, sdBelow = TRUE, drop, order, dict = getFixest_dict(), file,
  replace = FALSE, convergence, signifCode, label, subtitles,
  fixef_sizes = FALSE, yesNoFixef = c("Yes", "No"),
  keepFactors = TRUE, family, powerBelow = -5,
  interaction.combine = " $\\times $ ", depvar)

esttex(..., se = c("standard", "white", "cluster", "twoway", "threeway", "fourway"), dof = getFixest_dof(), cluster, digits = 4, fitstat, title, sdBelow = TRUE, drop, order, dict = getFixest_dict(), file, replace = FALSE, convergence, signifCode = c(`***` = 0.01, `**` = 0.05, `*` = 0.1), label, subtitles, fixef_sizes = FALSE, yesNoFixef = c("Yes", "No"), keepFactors = TRUE, family, powerBelow = -5, interaction.combine = " $\\times $ ")

esttable(..., se = c("standard", "white", "cluster", "twoway", "threeway", "fourway"), dof = getFixest_dof(), cluster, depvar, drop, order, digits = 4, fitstat, convergence, signifCode = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1), subtitles, keepFactors = FALSE, family)

Value

If tex = TRUE, the lines composing the Latex table are returned invisibly while the table is directly prompted on the console.

If tex = FALSE, the data.frame is directly returned. If the argument file is not missing, the data.frame is returned invisibly.

Functions

  • esttex: Exports the results of multiple fixest estimations in a Latex table.

  • esttable: Facility to display the results of multiple fixest estimations.

Arguments drop and order

The arguments drop and order use regular expressions. If you are aware of regular expressions, I urge you to learn it, since it is an extremely powerful way to manipulate character strings (and it exists across most programming languages).

For example drop = "Wind" would drop any variable whose name contains "Wind". Note that variables such as "Temp:Wind" or "StrongWind" do contain "Wind", so would be dropped. To drop only the variable named "Wind", you need to use drop = "^Wind$" (with "^" meaning beginning, resp. "$" meaning end, of the string => this is the language of regular expressions).

Although you can combine several regular expressions in a single character string using pipes, drop also accepts a vector of regular expressions.

You can use the special character "!" (exclamation mark) to reverse the effect of the regular expression (this feature is specific to this fonction). For example drop = "!Wind" would drop any variable that does not contain "Wind".

The argument order takes in a vector of regular expressions, the order will follow the elments of this vector. The vector gives a list of priorities, on the left the elements with highest priority. For example, order = c("Wind", "!Inter", "!Temp") would give highest priorities to the variables containing "Wind" (which would then appear first), second highest priority is the variables not containing "Inter", last, with lowest priority, the variables not containing "Temp". If you had the following variables: (Intercept), Temp:Wind, Wind, Temp you would end up with the following order: Wind, Temp:Wind, Temp, (Intercept).

Details

The function esttex is equivalent to the function etable with argument tex = TRUE.

The function esttable is equivalent to the function etable with argument tex = FALSE.

See Also

See also the main estimation functions femlm, feols or feglm. Use summary.fixest to see the results with the appropriate standard-errors, fixef.fixest to extract the cluster coefficients.

Examples

Run this code
# NOT RUN {
aq = airquality
aq$Month = factor(aq$Month)

est1 = feols(Ozone ~ Month / Wind + Temp, data = aq)
est2 = feols(Ozone ~ Wind + Temp | Month, data = aq)

# Displaying the two results in a single table
etable(est1, est2)

# drop: dropping the non interaction terms (see regexp help)
etable(est1, est2, drop = "^[[:alnum:]]+$")
# drop interactions
etable(est1, est2, drop = ":")
# keep only interactions ("!" reverses the effect)
etable(est1, est2, drop = "!:")

# order: Wind variable first, intercept last
etable(est1, est2, order = c("Wind", "Month"))
etable(est1, est2, order = c("^Wind", "Wind", "Month"))
# Interactions, then Intercept, last ("!" reverses the effect)
etable(est1, est2, order = c("!Int", "!:"))

# signifCode
etable(est1, est2, signifCode = c(" A"=0.01, " B"=0.05, " C"=0.1,
                                  " D"=0.15, " F"=1))

# fitstat
etable(est1, est2, fitstat = ~r2+ar2+apr2+war2)

# Adding a dictionnary (Tex only)
dict = c(Month5="May", Month6="Jun", Month7="Jul", Month8="Aug", Month9="Sep")
etable(est1, est2, dict = dict, tex = TRUE)

# }

Run the code above in your browser using DataLab