| setFixest_dict | R Documentation |
Sets/gets the default dictionary used in the function etable, did_means and
coefplot. The dictionaries are used to relabel variables (usually towards a fancier, more
explicit formatting) when exporting them into a Latex table or displaying in graphs. By setting
the dictionary with setFixest_dict, you can avoid providing the argument dict.
setFixest_dict(dict = NULL, ..., reset = FALSE)
getFixest_dict()
dict |
A named character vector or a character scalar. E.g. to change my variable named "a"
and "b" to (resp.) "$log(a)$" and "$bonus^3$", then use
|
... |
You can add arguments of the form: |
reset |
Logical, default is |
By default the dictionary only grows. This means that successive calls with not erase the
previous definitions unless the argument reset has been set to TRUE.
The default dictionary is equivalent to having setFixest_dict("(Intercept)" = "Constant"). To
change this default, you need to provide a new definition to "(Intercept)" explicitly.
Laurent Berge
data(trade)
est = feols(log(Euros) ~ log(dist_km)|Origin+Destination+Product, trade)
# we export the result & rename some variables
etable(est, dict = c("log(Euros)"="Euros (ln)", Origin="Country of Origin"))
# If you export many tables, it can be more convenient to use setFixest_dict:
setFixest_dict(c("log(Euros)"="Euros (ln)", Origin="Country of Origin"))
etable(est) # variables are properly relabeled
# The dictionary only 'grows'
# Here you get the previous two variables + the new one that are relabeled
# Btw you set the dictionary directly using the argument names:
setFixest_dict(Destination = "Country of Destination")
etable(est)
# Another way to set a dictionary: with a character string:
# See the help page of as.dict
dict = "log(dist_km): Distance (ln); Product: Type of Good"
setFixest_dict(dict)
etable(est)
# And now we reset:
setFixest_dict(reset = TRUE)
etable(est)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.