Tabularx, landscape, \toprule \midrule do not fully underline row

I understand that the table is automatically generated, but after that you need to fix it so it's readable and syntactically sound. For instance, tabularx here is completely useless, because no X column is specified.

Here's a reworking using siunitx and some tricks to reduce the header widths.

\documentclass[12pt,twoside]{article}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{rotating}

\newcommand{\splitcell}[2][c]{\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}

\begin{document}

\begin{sidewaystable}
\centering

\sisetup{% we don't need to parse uncertainty
  input-open-uncertainty={},
  input-close-uncertainty={}
}

\caption{Some caption to the table}

\begin{tabular}{
  @{}
  l
  S[table-format=3.3]
  S[table-format=4.3]
  S[table-format=3.3]
  S[table-format=4.3]
  S[table-format=3.3]
  S[table-format=4.3]
  S[table-format=-3.3]
  S[table-format=-1.3,
    table-space-text-pre={(},
    table-space-text-post={)},
    table-align-text-pre=false
  ]
  @{}
}
\toprule
& \multicolumn{2}{c}{Full sample (1)}
& \multicolumn{2}{c}{\splitcell[t]{Top 50\% \\ experience \\ target ind. (2)}}
& \multicolumn{2}{c}{\splitcell[t]{Bottom 50\% \\ experience \\ target ind. (3)}}
& \multicolumn{2}{c}{$(3)-(2)$}
\\
\cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}\cmidrule(l){8-9}
& {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{tabular}

\end{sidewaystable}

\end{document}

enter image description here


In the following example, I have removed the tabularx and in order to make the table fit into the page, I have introduced linebreaks in the headers. I have also added the \cmidrules and removed the unnecessary columns (in the original you declared a total of 17 columns but only used 9). In the second table I have added siunitx to improve the alignment of the numbers in the table.

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{pdflscape}
\usepackage{makecell}
\usepackage{siunitx}
\begin{document}

\begin{landscape}
\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{2}{lccc}}
\toprule
                    &\multicolumn{2}{c}{Full sample (1)}  &\multicolumn{2}{c}{\makecell{Top 50\%\\ experience target \\ind. (2)}}  &\multicolumn{2}{c}{\makecell{Bottom 50\%\\ Experience target\\ ind(3)}}  &\multicolumn{2}{c}{(2-3)}           \\
          \cmidrule(r){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(l){8-9}
                    &        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{tabular}

\bigskip

\begin{tabular}{l
                *{3}{
                S[table-format=3.3]
                S[table-format=4.3]}
                S[table-format=-3.3]
                S[table-format=-1.3,
                  input-open-uncertainty= ,
                  input-close-uncertainty  = ,
                  table-space-text-pre={(}, 
                  table-space-text-post={)},
                  table-align-text-pre = false]
           }
\toprule
     &\multicolumn{2}{c}{Full sample (1)}  
         &\multicolumn{2}{c}{\makecell{Top 50\%\\ experience target \\ind. (2)}}  
             &\multicolumn{2}{c}{\makecell{Bottom 50\%\\ Experience target\\ ind(3)}}  
                 &\multicolumn{2}{c}{(2-3)}           \\
          \cmidrule(r){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(l){8-9}
    &        {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{tabular}
\end{landscape}
\end{document}