# 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)
# keep/drop: keeping only interactions
etable(est1, est2, keep = ":")
# or using drop (see regexp help):
etable(est1, est2, drop = "^[[:alnum:]]+$")
# keep/drop: dropping interactions
etable(est1, est2, drop = ":")
# or using keep ("!" reverses the effect):
etable(est1, est2, keep = "!:")
# 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", "!:"))
# dict + keep/drop/order: using "%" to match the original names
dict = c("Month5"="May", "Month6"="Jun", "Month7"="Jul",
"Month8"="Aug", "Month9"="Sep")
etable(est1, est2, tex = TRUE, dict = dict)
# keeping only June and July
etable(est1, est2, tex = TRUE, dict = dict, keep = c("%Month6", "Jul"))
# All months variabes first
etable(est1, est2, tex = TRUE, dict = dict, order = c("%Month"))
# 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)
#
# Using the argument style to customize Latex exports
#
# If you don't like the default layout of the table, no worries!
# You can modify many parameters with the argument style
# To drop the headers before each section, use:
style_noHeaders = list(var="", fixef="suffix: FE", stats = "")
etable(est1, est2, dict = dict, tex = TRUE, style = style_noHeaders)
# To change the lines of the table
style_lines = list(lines = "top:\\toprule;bottom:\\bottomrule;sep:\\midrule;foot:\\midrule")
etable(est1, est2, dict = dict, tex = TRUE, style = style_lines)
# }
Run the code above in your browser using DataLab