I would like to display some statistics and difference in means by treatment arm on a single table. The data is exported from stata. I would like to allocate more space to the first column with the variable names so that the table looks nicer, and to lower the space between the mean and standard deviation figures/lines.
This is the way the stats table is coded:
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs} % For better looking tables
\usepackage{tabularx}
\setlength{\parindent}{0pt}
\newcommand{\sym}[1]{#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
}
\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize}
\usepackage{enumitem}
\newlist{myitemize}{itemize}{1}
\setlist[myitemize]{nosep,
left=0pt,
before=\begin{minipage}{\linewidth},
after =\end{minipage},
label=--}
\usepackage[colorlinks,%
citecolor=black,
filecolor=black,%
linkcolor=black,%
urlcolor=black]{hyperref} % for linking between references, figures, TOC, etc in the pdf document
\begin{document}
\begin{table}[h!]
\sisetup{table-format=-1.3,
table-space-text-pre=),
table-space-text-post=)**,
table-align-text-pre=false,
table-align-text-post=false}
\setlength{\tabcolsep}{3pt}
\caption{Summary Statistics at Baseline} \label{table}
\begin{tabularx}{\textwidth}{>{\raggedright\arraybackslash}X{7}{S}}
\toprule
\cmidrule{2-8}
&\multicolumn{4}{c}{Total average}
&\multicolumn{3}{c}{\thead{Difference in means}}
\
\cmidrule(lr){2-5}\cmidrule(lr){6-8}
&{Total} &{Control} &{Classroom} &{Individualized} &{(C)-(CR)} &{(C)-(I)} &{(CR)-(I)} \
% insert after midrule until bottomrule
\midrule
Age \scriptsize (years)
& 23.6 & 23.3 & 23.8 & 23.7 & -0.50 & -0.32 & 0.18 \
& (4.16) & (3.75) & (4.43) & (4.30) & (0.38) & (0.37) & (0.41) \
\
Marital Status \scriptsize (0, single ; \scriptsize 1, married)
& 0.047 & 0.033 & 0.066 & 0.043 & -0.032 & -0.0094 & 0.023 \
& (0.21) & (0.18) & (0.25)& (0.20)& (0.020) & (0.018) & (0.021) \
\
Language \scriptsize (0, Non-Odia ; \scriptsize 1, Odia)
& 0.50 & 0.49 & 0.46 & 0.55 & 0.027 & -0.055 & -0.082\sym{*} \
& (0.50) & (0.50)& (0.50)& (0.50)& (0.046) & (0.046) & (0.046) \
\
Remittance dummy \scriptsize (0, not remitting; \scriptsize 1, remitting)
& 0.86 & 0.85 & 0.85 & 0.89 & 0.0033 & -0.035 & -0.038 \
& (0.34) & (0.35) & (0.36) & (0.31) & (0.033) & (0.031) & (0.031) \
\
Awareness of digital payment method \scriptsize (1, have heard about digital payment methods)
& 0.63 & 0.62 & 0.60 & 0.67 & 0.019 & -0.054 & -0.074 \
& (0.48) & (0.49) & (0.49) & (0.47) & (0.045) & (0.044) & (0.045) \
Use of digital payment methods \scriptsize (0, not using; \scriptsize1, using)
& 0.057 & 0.054 & 0.048 & 0.068 & 0.0059 & -0.014 & -0.020 \
& (0.23) & (0.23) & (0.21) & (0.25) & (0.020) & (0.022) & (0.022) \scriptsize
\
Quantity remitted in the past 30 days \scriptsize (in INR)
& 3719.1 & 3560.4& 3848.7& 3755.6& -288.3 & -195.1 & 93.1 \
& (3769.1) & (3101.7) & (4574.2)& (3527.6)& (363.1) & (305.4) & (380.7) \
\
Remittance fees \scriptsize(in INR)
& 60.2& 58.1& & 64.9& 57.9& -6.77 & 0.25 & 7.02 \
& (64.6) & (50.2) & (88.9)& (48.4)& (7.30) & (4.86) & (7.23) \
\
Stress index
& 0.000000011 & -0.077 & -0.019& 0.097& -0.058 & -0.17\sym{*} & -0.12 \
& (1.00)& (0.98)& (0.98)& (1.03)& (0.092) & (0.093) & (0.094) \
\
Aware of bank balance \scriptsize(0, not tracking their bank balance; \scriptsize 1 tracking tracking)
& 0.68 & 0.67 & 0.66 & 0.70& 0.0060 & -0.036 & -0.042 \
& (0.47) & (0.47)& & (0.47)& (0.46)& (0.045) & (0.044) & (0.044) \\
\\
Ease of coming up with 4000INR for an emergency \scriptsize(between 0 and 2)
& 0.98 & 0.99 & 1 & 0.94& -0.012 & 0.047 & 0.060 \
& (0.65)& (0.62)& (0.66)& (0.67)& (0.059) & (0.059) & (0.062) \
\midrule
Number of observations& 702 & 240 & 228& 234& 468 & 474 & 462 \
% end inserting after midrule until bottomrule
\bottomrule
\end{tabularx}
Notes:
\begin{myitemize}
\item All variables were collected during the baseline survey cycle. \
\item The table includes all workers interviewed at baseline, including attrited participants.
\item The three last columns display the differences in the means across the experimental groups.
\item *, , and * indicate significance at the 1%, 5%, and 10% critical level. \item The stress index is an indicator variable created using a weighted average of three indicator variables (stress related to consumption, stress related to remittance, and overall financial stress). The index is a z-score unit, with higher values corresponding to "positive" outcomes, , i.e. lower levels of stress.
\item The emergency variable is on a Likert scale from 0 to 2; respectively from "very difficult, or not possible", "possible, but not easy", to "quite easy". A high variable corresponds to a "positive" outcome, i.e. a better ability to come up with 4000 INR if necessary..
\end{myitemize}
\end{table}
Do you happen to know how this table could fit into one single page, with the footnotes included, as well as how the first column could be resized?
Thank you very much in advance, Best regards, Raphaëlle Aulagnon


&than should be, twice), but for me the compilation ends with a*message. Can you compile it? – Bernard Jul 14 '20 at 10:02