Hello,
Using code like
I want to run regressions on a subsample, depending on whether a third variable is 0 or 1 (this variable is not included in the regression).
Subsequently, using esttab, I want to display the results. Whether or not the dummy is 0 or 1 should be indicated in the output. It currently looks like this:
And I would like to end up with a line such as
I looked into the indicate option, but it seems that this helps when we want to show if a variable is included, not whether the included dummy is 0 or 1.
What is a way to achieve this? What alternatives are there to display the value of a dummy variable that defines the subsample elsewhere in the esttab output?
Best,
Max
Using code like
Code:
sysuse auto.dta, clear eststo: reg price mpg if foreign == 0 eststo: reg price mpg if foreign == 1 esttab * using stata_1_18.tex, replace
Subsequently, using esttab, I want to display the results. Whether or not the dummy is 0 or 1 should be indicated in the output. It currently looks like this:
Code:
{ \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{2}{c}} \hline\hline &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\ &\multicolumn{1}{c}{price}&\multicolumn{1}{c}{price}\\ \hline mpg & -329.3\sym{***}& -250.4\sym{**} \\ & (-4.13) & (-3.64) \\ [1em] \_cons & 12600.5\sym{***}& 12587.0\sym{***}\\ & (7.76) & (7.15) \\ \hline \(N\) & 52 & 22 \\ \hline\hline \multicolumn{3}{l}{\footnotesize \textit{t} statistics in parentheses}\\ \multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\ \end{tabular} }
Code:
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{2}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
&\multicolumn{1}{c}{price}&\multicolumn{1}{c}{price}\\
\hline
mpg & -329.3\sym{***}& -250.4\sym{**} \\
& (-4.13) & (-3.64) \\
[1em]
\_cons & 12600.5\sym{***}& 12587.0\sym{***}\\
& (7.76) & (7.15) \\
\hline
\(N\) & 52 & 22 \\
foreign & 0 & 1 \\
\hline\hline
\multicolumn{3}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
}
What is a way to achieve this? What alternatives are there to display the value of a dummy variable that defines the subsample elsewhere in the esttab output?
Best,
Max
Comment