Thanks! The code for table titles shown in the image is:
\begin{tabular}{l*{4}{c}}
\hline\hline
&\multicolumn{2}{c}{Weight} &\multicolumn{2}{c}{Length} \\\cline{2-3}\cline{4-5}
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\
&\multicolumn{1}{c}{price}&\multicolumn{1}{c}{price}&\multicolumn{1}{c}{price}&\multicolumn{1}{c}{price}\\
\hline
\end{tabular}
and this is created automatically by Stata code:
eststo clear
sysuse auto
eststo: qui reg price weight
eststo: qui reg price weight foreign
eststo: qui reg price length
eststo: qui reg price length foreign
esttab using example.tex, replace mgroups( "Weight" "Length" , pattern(1 0 1 0 ) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cline{@span}))
\cmidrule
from booktabs, you might want to use\cmidrule(r){2-3} \cmidrule(l){4-5}
in order to get the small gap in the horizontal line.