是否有一种方法可以在没有表环境的情况下从r导出带有etable函数(从“最固定”包)的回归表?因此,乳胶程式码不应以\begin{table}开头,而应以\begin{tabular}开头。
我知道xtable和星空望远镜是有可能的,但是可选的呢?
发布于 2022-04-06 20:19:51
默认情况下,table环境不存在于etable的Latex导出中,除非有标题。这很可能是包版本问题。
下面是一个fixest 0.10.4的MRE:
base = setNames(iris, c("y", "x1", "x2", "x3", "species"))
est = feols(y ~ csw(x.[,1:3]), base)
etable(est, tex = TRUE)
#> \begingroup
#> \centering
#> \begin{tabular}{lccc}
#> \tabularnewline \midrule \midrule
#> Dependent Variable: & \multicolumn{3}{c}{y}\\
#> Model: & (1) & (2) & (3)\\
#> \midrule
#> \emph{Variables}\\
#> (Intercept) & 6.526$^{***}$ & 2.249$^{***}$ & 1.856$^{***}$\\
#> & (0.4789) & (0.2480) & (0.2508)\\
#> x1 & -0.2234 & 0.5955$^{***}$ & 0.6508$^{***}$\\
#> & (0.1551) & (0.0693) & (0.0667)\\
#> x2 & & 0.4719$^{***}$ & 0.7091$^{***}$\\
#> & & (0.0171) & (0.0567)\\
#> x3 & & & -0.5565$^{***}$\\
#> & & & (0.1275)\\
#> \midrule
#> \emph{Fit statistics}\\
#> Observations & 150 & 150 & 150\\
#> R$^2$ & 0.01382 & 0.84018 & 0.85861\\
#> Adjusted R$^2$ & 0.00716 & 0.83800 & 0.85571\\
#> \midrule \midrule
#> \multicolumn{4}{l}{\emph{IID standard-errors in parentheses}}\\
#> \multicolumn{4}{l}{\emph{Signif. Codes: ***: 0.01, **: 0.05, *: 0.1}}\\
#> \end{tabular}
#> \par\endgroup发布于 2022-04-05 20:10:42
您可以让latex在table环境的末尾添加注释:
\documentclass{article}
\begin{document}
\AddToHook{env/table/end}{some note}
\begin{table}
first table
\end{table}
\RemoveFromHook{env/table/end}
\begin{table}
second table
\end{table}
\end{document}https://stackoverflow.com/questions/71756713
复制相似问题