I have been trying to upload six-column tables to Latex/Overleaf from Stata. Data exported well but I have been struggling to adjust to Latex format, and some columns don't appear as tables are too wide.
The code on Stata to export a six-column table is as follows:
*esttab q1_1 q1_2 q1_3 q1_4 q1_5 q1_6 using "$output_tex/fin_4_4_4_q11-q16_tables_ra.tex", ///
replace f ///
cells(b(fmt(%9.3f)) se(fmt(%9.2f) star par)) star(* 0.10 ** 0.05 *** 0.01) ///
keep(1.treatment_status 2.treatment_status) /// what variable to keep
label booktabs noobs nonotes nomtitle collabels(none) ///
mgroups("Use of digital payment applications" "Use of digital payment applications for remittances" ///
"Use of digital payment applications for remittances, conditional on remitting", ///
pattern(1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) ///
suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(N c_mean hascon coef se, fmt(%9.0fc %9.3f %9.3f %9.3f) labels("Number of observations" "Control mean of dependent variable" "Additional Control Variables" " Difference in means (CR) - (I)" "Se (CR)-(I)"))*
In a .tex format, the table looks like this:
&\multicolumn{2}{c}{Use of digital payment applications}&\multicolumn{2}{c}{Use of digital payment applications for remittances}&\multicolumn{2}{c}{Use of digital payment applications for remittances, conditional on remitting}\\\cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} &\multicolumn{1}{c}{(5)} &\multicolumn{1}{c}{(6)} \\
\midrule
Classroom (CR) & 0.051 & 0.050 & 0.038 & 0.037 & 0.060 & 0.063 \\
& (0.03)\sym{*} & (0.03)\sym{*} & (0.03) & (0.03) & (0.03)\sym{**} & (0.03)\sym{**} \\
Individualized (I) & 0.107 & 0.104 & 0.078 & 0.067 & 0.086 & 0.086 \\
& (0.03)\sym{***}& (0.03)\sym{***}& (0.03)\sym{***}& (0.03)\sym{**} & (0.03)\sym{**} & (0.03)\sym{**} \\
\midrule
Number of observations& 615 & 615 & 615 & 615 & 482 & 482 \\
Control mean of dependent variable& 0.060 & 0.060 & 0.050 & 0.050 & 0.060 & 0.060 \\
Additional Control Variables& No & Yes & No & Yes & No & Yes \\
Difference in means (CR) - (I)& -0.060 & -0.050 & -0.040 & -0.030 & -0.030 & -0.020 \\
Se (CR)-(I) & 0.040 & 0.040 & 0.030 & 0.030 & 0.040 & 0.040 \\
Then, on latex the code is as follows:
\documentclass[6pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs} % For better looking tables
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{lscape}
\usepackage{dcolumn} % Align on the decimal point of numbers in tabular columns
\newcolumntype{d}[1]{D{.}{.}{#1}}
\usepackage{threeparttable} % For better formatting of table notes
\usepackage{adjustbox}
\usepackage[colorlinks,%
citecolor=black,
filecolor=black,%
linkcolor=black,%
urlcolor=black]{hyperref} % for linking between references, figures, TOC, etc in the pdf document
\setlength{\parindent}{0pt}
\let\estinput=\input % define a new input command so that we can still flatten the document
\newcommand{\estwide}[3]{
\vspace{.75ex}{
\textsymbols
\begin{tabular*}
{\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{#2}{#3}}
\toprule
\estinput{#1}
\bottomrule
\addlinespace[.75ex]
\end{tabular*}
}
}
\newcommand{\estauto}[3]{
\vspace{.75ex}{
\textsymbols
\begin{tabular}{l*{#2}{#3}}
\toprule
\estinput{#1}
\bottomrule
\addlinespace[.75ex]
\end{tabular}
}
}
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
}
\newcommand{\sym}[1]{\rlap{#1}}
\newcommand{\fignote}[1]{\figtext{\emph{Note:~}~#1}}
\newcommand{\figsource}[1]{\figtext{\emph{Source:~}~#1}}
\usepackage{siunitx} % centering in tables
\sisetup{
detect-mode,
tight-spacing = true,
group-digits = false ,
input-signs = ,
input-symbols = ( ) [ ] - + *,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-align-text-post = false
}
\begin{table}[h!]
\centering
\begin{landscape}
\begin{threeparttable}
\caption{Impact of treatment on use of digital payment applications and use of digital payment applications for remittances.} \label{table}
\small\estwide{fin_4_4_4_q11-q16_tables_ra.tex}{6}{c}
\Fignote{Notes: - Standard errors in parentheses (*** p$<$0.01, ** p$<$0.05, * p$<$0.1). \\
- The control mean of dependent variable is the non-attrited subsample mean at baseline. \\
- All regressions include a constant, the outcome variable at baseline, as well as strata fixed effects. Additional control variables, when included, are: Age, Native state, Marital Status, Financial stress index at baseline, Remittance dummy at baseline, Monthly remittance quantity at baseline, Use of digital payment applications at baseline. \\
- All regressions are weighted with the Inverse Predicted Probability from Probit of Attrition on Treatments, with strata, outcome at baseline, and the additional control variables included.}
\end{threeparttable}
\end{landscape}
\end{table}
I have also tried the horizontal option :
\begin{sidewaystable}
\centering
\caption{Impact of treatment on use of digital payment applications and use of digital payment applications for remittances.}
\label{table}
\small\estwide{fin_4_4_4_q11-q16_tables_ra.tex}{6}{c}
\Fignote{Notes: - Standard errors in parentheses (*** p$<$0.01, ** p$<$0.05, * p$<$0.1). \\
- The control mean of dependent variable is the non-attrited subsample mean at baseline. \\
- All regressions include a constant, the outcome variable at baseline, as well as strata fixed effects. Additional control variables, when included, are: Age, Native state, Marital Status, Financial stress index at baseline, Remittance dummy at baseline, Monthly remittance quantity at baseline, Use of digital payment applications at baseline. \\
- All regressions are weighted with the Inverse Predicted Probability from Probit of Attrition on Treatments, with strata, outcome at baseline, and the additional control variables included.}
\end{sidewaystable}
Below, you can see how the tables appear:
Do you happen to know how this table could be reduced/fit into one page with all columns included? Thank you very much in advance for your help. Best regards, Raphaëlle Aulagnon