79588721

Date: 2025-04-23 13:30:44
Score: 0.5
Natty:
Report link

It is possible thanks to the argument tablefoot.value in style.tex:

etable(model1, 
       signif.code = c("***"=0.001, "**"=0.01, "*"=0.05, "+"=0.1),
       style.tex = style.tex(var.title="", fixef.title="",
                             fixef.suffix=" FE", stats.title="", 
                             tablefoot.value = "My standard errors"),
       tex = TRUE) 
#> \begingroup
#> \centering
#> \begin{tabular}{lc}
#>    \tabularnewline \midrule \midrule
#>    Dependent Variable: & mpg\\  
#>    Model:              & (1)\\  
#>    hp                  & -0.0261\\   
#>                        & (0.0136)\\   
#>    drat                & 0.8521\\   
#>                        & (0.7127)\\   
#>    wt                  & -2.980\\   
#>                        & (1.079)\\   
#>    cyl FE              & Yes\\  
#>    Observations        & 32\\  
#>    R$^2$               & 0.85938\\  
#>    Within R$^2$        & 0.47441\\  
#>    \midrule \midrule
#>    \multicolumn{2}{l}{\emph{ My standard errors }}\\
#> \end{tabular}
#> \par\endgroup

This isn't really intuitive and shouldn't be in style.tex given that these kind of notes vary for each export.

Maybe the easiest would be to use threeparttable notes? See: https://lrberge.github.io/fixest/articles/etable_new_features.html#support-for-threeparttable-notes-1

etable(model1, 
       signif.code = c("***"=0.001, "**"=0.01, "*"=0.05, "+"=0.1),
       style.tex = style.tex(var.title="", fixef.title="",
                             fixef.suffix=" FE", stats.title="", 
                             tablefoot = FALSE,
                             tpt = TRUE),
       tex = TRUE, notes = "My standard errors") 
#> \begingroup
#> \centering
#> \begin{threeparttable}[b]
#>    \begin{tabular}{lc}
#>       \tabularnewline \midrule \midrule
#>       Dependent Variable: & mpg\\  
#>       Model:              & (1)\\  
#>       hp                  & -0.0261\\   
#>                           & (0.0136)\\   
#>       drat                & 0.8521\\   
#>                           & (0.7127)\\   
#>       wt                  & -2.980\\   
#>                           & (1.079)\\   
#>       cyl FE              & Yes\\  
#>       Observations        & 32\\  
#>       R$^2$               & 0.85938\\  
#>       Within R$^2$        & 0.47441\\  
#>       \midrule \midrule & \tabularnewline
#>    \end{tabular}
#>    
#>    \begin{tablenotes}
#>      \item My standard errors
#>    \end{tablenotes}
#> \end{threeparttable}
#> \par\endgroup

These options can then be set only once with setFixest_etable:

setFixest_etable(style.tex = style.tex(var.title = "", fixef.title = "",
                                       fixef.suffix = " FE", stats.title = "", 
                                       tablefoot = FALSE, tpt = TRUE))
etable(model1, notes = "My standard errors", tex = TRUE)
#> \begingroup
#> \centering
#> \begin{threeparttable}[b]
#>    \begin{tabular}{lc}
#>       \tabularnewline \midrule \midrule
#>       Dependent Variable: & mpg\\  
#>       Model:              & (1)\\  
#>       hp                  & -0.0261\\   
#>                           & (0.0136)\\   
#>       drat                & 0.8521\\   
#>                           & (0.7127)\\   
#>       wt                  & -2.980\\   
#>                           & (1.079)\\   
#>       cyl FE              & Yes\\  
#>       Observations        & 32\\  
#>       R$^2$               & 0.85938\\  
#>       Within R$^2$        & 0.47441\\  
#>       \midrule \midrule & \tabularnewline
#>    \end{tabular}
#>    
#>    \begin{tablenotes}
#>       \item My standard errors
#>    \end{tablenotes}
#> \end{threeparttable}
#> \par\endgroup

See another example here: https://lrberge.github.io/fixest/articles/exporting_tables.html#setting-etable-default-values-latex-edition

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
Posted by: Laurent Bergé