Somehow \toprule
does not underline the whole row of my table. Hopefully, someone can explain to me what I am doing wrong. My ultimate goal is to create a table similar to:
Copy of my shortened code:
\documentclass[12pt,twoside]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{lscape}
\begin{landscape}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabularx}{\textwidth}{l*{4}{lccc}}
\toprule
&\multicolumn{2}{c}{Full sample (1)} &\multicolumn{2}{c}{Top 50\% experience target ind. (2)} &\multicolumn{2}{c}{Bottem 50\% Experience target ind(3)} &\multicolumn{2}{c}{(2-3)} \\
&\multicolumn{2}{c}{} &\multicolumn{2}{c}{} &\multicolumn{2}{c}{} &\multicolumn{2}{c}{} \\
& mean& sd& mean& sd& mean& sd& b & t\\
\midrule
Book to Market & 2.911& 18.792& 3.341& 16.830& 2.642& 19.949& -0.699 & (-0.371)\\
Free cash flow & 225.883& 4275.873& 325.020& 6726.092& 163.922& 1242.414& -161.098 & (-0.290)\\
Leverage & 0.578& 0.204& 0.601& 0.206& 0.564& 0.202& -0.037 & (-1.734)\\
Relative size & 87.852& 667.603& 50.216& 184.712& 111.334& 838.031& 61.119 & (1.075)\\
\midrule
Observations & 390& & 150& & 240& & 390 & \\
\bottomrule
\end{tabularx}
}
\end{landscape}
Good to mention is that the code is created using the STATA package esstab + booktabs.
\textwidth
on a landscape page eould equal the width of a line of text in a portrait page. To get the width of a line of text in a landscape page, you can use\linewidth
instead. Apart from that, atabularx
at least needs oneX
type column. I don't see anyX
type columns in your code, so don't usetabularx
.booktabs
are called...rule
instead of...line
.