0

I am creating a regression output table and it looks good to me except one thing: a want the first column (with variable names) to have a left alignment; and lave center alignment for columns 2-4 with regression results. This is my code:

\begin{table}[htbp]
  \centering
  \newcommand\sym[1]{\rlap{$^{#1}$}}
  
  \caption{Regression Results\label{tab1}}
  
  \begin{tabular*}{\linewidth}{@{\hspace{\tabcolsep}\extracolsep{\fill}} r ... }
  
  \toprule
    & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)}     \\
    & \multicolumn{1}{c}{WTI} & \multicolumn{1}{c}{BRENT} & \multicolumn{1}{c}{WTI}   \\
  \midrule
  Confirmed Cases & -0.0000143\sym{***} &  -0.0000103\sym{***}  & -0.0000155\sym{***} \\
                  & (0.000028)          & (-0.00000203)         & (0.00000416)        \\
  \addlinespace
  Deaths          & -0.00286\sym{***}   &  -0.000189\sym{***}   & -0.000286\sym{***}  \\
                  & (0.0000406)         &  (0.0000296)          & (0.0000607)         \\
  \addlinespace
  VIX             & -0.193\sym{***}     &  -0.299\sym{***}      & -0.236\sym{***}     \\
                  & (0.00313)           &  (0.00228)            & (0.00466)           \\
  \addlinespace
  EPU             & -0.0469\sym{***}    &  -0.0327\sym{***}     & -0.0361\sym{***}    \\
                  & (0.000285)          &  (0.000207)           & (0.000424)          \\
  \addlinespace
  Constant        & 58.48\sym{***}      &  64.46\sym{***}       & 56.51\sym{***}      \\
                  & (0.0905)            &  (0.0659)             & (0.135)             \\
  \midrule
  Observations & \multicolumn{1}{c}{17,112} & \multicolumn{1}{c}{17,112} & \multicolumn{1}{c}{16,928} \\
  \addlinespace
  R^2 & \multicolumn{1}{c}{0.856} & \multicolumn{1}{c}{0.903} & \multicolumn{1}{c}{0.679} \\
  \bottomrule
  \multicolumn{4}{l}{\footnotesize \textit Standard errors in parentheses}           \\
  \multicolumn{4}{l}{\footnotesize * \(p<0.5\), ** \(p<0.01\), *** \(p<0.001\)}
  \end{tabular*}
\end{table}

And this is my output:

enter image description here

2
  • 1
    You can use l instead of r to get a left aligned column.
    – leandriis
    Apr 30, 2020 at 15:12
  • 2
    please always show code as text (preferably a complete example that can be run to see the problem) not as an image Apr 30, 2020 at 20:40

1 Answer 1

1

just specify the alignment of each column in the definition of the tabular*-environment: the second argument.

for some information on tabular* you could check wikibooks.org

In your example the first column should be left-aligned (c) and the other three seem to be centered (c): lccc

    \begin{tabular*}{\linewidth}{@{\hspace{\tabcolsep}\extracolsep{\fill}} lccc}
1
  • It also looks like that if OP does this, then they can remove most or all of the \multicolumn{1}{c}.
    – Teepeemm
    Jan 25, 2021 at 17:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .