I'm a newbie to stata and latex when it comes to direct export of tables. After reading some documentation, I used the following code (after labeling the variables):
eststo: quietly regress defgh hello, robust
eststo: quietly regress defgh hello lnGDP, robust
esttab using abc.tex, replace alignment(D{.}{.}{-1}) width(1\hsize) se ar2 title("abc") label addnotes("blablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablabla")
eststo clear
(because some of you asked: No, abc, defgh, hello and blablabla... are not the real regressions. I just replaced my real names with these!)
I insert the table with:
\input{Tables/abc.tex}
I basically have 3 issues:
1) The table is too wide (prob. due to hsize) (how can I tell latex that it should only consider the wide of the first row?)
2) The caption of the second regression moves to somewhere else (also had it a bit more left, but still not where it belongs)
3) My table notes don't get wrapped... Is it also possible to put them in a nice box?
Thanks for your help!
The tex-file (code) produced:
\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{abc}
\begin{tabular*}{1\hsize}{@{\hskip\tabcolsep\extracolsep\fill}l*{2}{D{.}{.}{-1}}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
&\multicolumn{1}{c}{defgh}&\multicolumn{1}{c}{defgh}\\
\hline
Hello Everybody & -0.493\sym{***}& -0.317\sym{***}\\
& (0.106) & (0.0403) \\
[1em]
ln(GDP per capita) & & 6.466\sym{***}\\
& & (0.349) \\
[1em]
Constant & 39.75\sym{***}& 26.45\sym{***}\\
& (1.188) & (0.801) \\
\hline
Observations & 146 & 145 \\
Adjusted \(R^{2}\) & 0.146 & 0.780 \\
\hline\hline
\multicolumn{3}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{3}{l}{\footnotesize blablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablabla}\\
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular*}
\end{table}
ablablablablablablablablablablablablablablablablablablablablablablablablablablablablablabla....
? – Mico Jun 5 '19 at 14:05