0

I know that this question has been asked before, but I am having troubling solving the issue in my case. I have a table and I simply want to add a third column to show the regression output from my third equation. I looked at "defining multiple columns" in the LaTeX wikibook, but I didn't have much luck extrapolating from there. Can you help?

MWE:

\documentclass[twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}

\usepackage{amsmath,geometry,siunitx,booktabs, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
%\usepackage[lite]{mtpro2}

\usepackage{amsmath,geometry,siunitx,booktabs, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}

\newcommand\mC[1]{\multicolumn{1}{C@{}}{#1}} % handy shortcut macro

\sisetup{group-separator={,}, group-minimum-digits=4}
\usepackage[skip=1ex]{caption}
\captionsetup[table]{font=small, labelfont=bf, singlelinecheck=no}


\usepackage{%booktabs, 
            makecell, %tabularx
            }
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\usepackage{textcomp}
\usepackage{graphicx}
\raggedbottom
\usepackage{rotating}
\usepackage[referable]{threeparttablex}
\usepackage{upquote}
\usepackage{balance}
\usepackage{wasysym}
\usepackage{footmisc}
\usepackage{float}
\floatstyle{boxed} 
\restylefloat{figure}

\title{\LARGE \bf ECON 425 Term Paper}

\author{}

\begin{document}
    \begin{table*}[!htb]
\caption{Estimates of pay-performance sensitivity.}
\label{tab:table1}
OLS regressions of CEO salary and CEO total compensation on change in shareholder wealth. Standard errors in parentheses.

    \medskip
    \setlength\tabcolsep{4pt}
    \small
    \makegapedcells
\begin{tabularx}{\textwidth}{@{}L ll@{}}
    \toprule
\thead[l]{Dependent\\ variable}
            &  \thead[l]{CEO\\
                         salary\\
                         (eq. \ref{eqn:first})}
                                    & \thead[l]{CEO total\\
                                            compensation\\
                                            (eq. \ref{eqn:second})} \\


    \midrule
Return       &  -0.320 (0.083)        & 2.213 (1.545)                    \\
Logbonus
                & -5.269 (1.38)   & ---          \\
    \addlinespace
Return*Volume   & 0.00 (0.000)       & ---                        \\
Stock Awards    & $0.036^*$ (0.000)    & ---                    \\
Option Awards    & 0.023 (0.000)        & ---                         \\
Other Compensation & 0.028 (0.00) & ---
    \\
Age & 33.387 (4.567) & 913.016 (84.768)
    \\
agesq & -0.217 (0.039) & -7.435 (0.733)
    \\
male & -2.601 (18.079) & -465.612 (337.631)
    \\
outdoors & -173.761 (77.902) & -4268.128 (1453.675) 
    \\
mining & -178.289 (26.792) & -972.327 (499.369)
    \\
utilities & -199.853 (34.906) & -4217.222 (651.127)
    \\
construction & -102.424 (33.259 & -3572.244 (620.558)
    \\
wholesale & -193.954 (28.814) & -3827.542 (537.382)
    \\
information & -218.414 (24.494) & -618.642 (456.968)
    \\
finance & -160.005 (23.320) & -3078.595 (434.591)
    \\
realestate & -303.096 (25.248) & -3410.482 (470.966)  
    \\
professional & -238.323 (27.486) & -3776.246 (512.813)
    \\
waste  & -186.965 (31.766) & -3365.898 (592.813)
    \\
education & -287.113 (50.956) & -5770.548 (950.712)
    \\
healthcare & -153.385 (32.953) & -2123.471 (615.121) 
    \\
arts & 178.082 (56.622) & -2303.748 (1056.786)
    \\
food & -34.24 (31.091) & -2656.446 (579.849)
    \\
other & -109.691 (61.642) & -3786.196 (1150.511)
    \\
manufacturing & -193.729 (22.394) & -2540.859 (417.698)
    \\
transportation & -313.349 (29.509) & -3678.069 (551.778)
    \\
retail &  $\underset{(25.756)}{-80.145}$ & -2295.232 (480.656)
    \\
    \bottomrule
\end{tabularx}

\smallskip
$^{*}$ Significant at the 1\% level.
    \end{table*}

\end{document}

Here's how it currently looks:

enter image description here

Thanks as always!

FOLLOW-UP @SAMCARTER

How can I fix this issue with the 4th column? I'd like it to look like the others.

enter image description here

  • 1
    You already have three columns. What is your expected result? – TeXnician May 6 '18 at 13:25
  • TeXnician--Ah, I suppose I do. I would like a "4th" column, then, to the right of "CEO total compensation (eq. 2)" that will be "TITLE (eq. 3)" – texmex May 6 '18 at 13:28
  • 1
    You should have a look at the siunitx package. It allows to easily align the numbers in your table and also to unify the usage of minus signs and hyphens. – samcarter_is_at_topanswers.xyz May 6 '18 at 13:28
3

Add an additional column with your desired alignment, for example l in @{}L lll@{} and add an additional number at the end of each row.

Off-topic:

  • Please don't use deprecated font commands such as \bf.

  • please do not load the same package multiple times


\documentclass[twocolumn]{article}

\usepackage[T1]{fontenc}
\usepackage{amsmath,geometry,siunitx,booktabs, tabularx}
\usepackage[skip=1ex]{caption}
\captionsetup[table]{font=small, labelfont=bf, singlelinecheck=no}
\usepackage{makecell}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\usepackage[referable]{threeparttablex}
\usepackage{float}
\floatstyle{boxed} 
\restylefloat{figure}

\title{\LARGE \textbf{ECON 425 Term Paper}}

\author{}

\begin{document}

\begin{table*}[!htb]
    \caption{Estimates of pay-performance sensitivity.}
    \label{tab:table1}
    OLS regressions of CEO salary and CEO total compensation on change in shareholder wealth. Standard errors in parentheses.

    \medskip
    \setlength\tabcolsep{4pt}
    \small
    \makegapedcells
    \begin{tabularx}{\textwidth}{@{}L lll@{}}
        \toprule
        \thead[l]{Dependent\\ variable} &  \thead[l]{CEO\\ salary\\ (eq. \ref{eqn:first})} & \thead[l]{CEO total\\ compensation\\ (eq. \ref{eqn:second})} & 4th column \\
        \midrule
        Return &  \num{-0.320} (\num{0.083}) & \num{2.213} (\num{1.545}) & \num{42}\\
        Logbonus & \num{-5.269} (\num{1.38}) & {---} & \num{42}\\
        \bottomrule
    \end{tabularx}

    \smallskip
    $^{*}$ Significant at the 1\% level.
\end{table*}

\end{document}
| improve this answer | |
  • @texmex You already loaded it in your origional code, but you don't use it. Have a look at the package documentation mirrors.ctan.org/macros/latex/contrib/siunitx/siunitx.pdf how to align columns using the S column type. – samcarter_is_at_topanswers.xyz May 6 '18 at 13:48
  • Gotcha. I also have a follow-up question if you would please see the original post – texmex May 6 '18 at 13:49
  • @texmex Edits are not the best place to ask new questions. Also when you ask a new questions, please specify what you mean with issue. BTW @ pings in yoru questions don't work. you can only ping people in comments if they either already commented to the specific question or answer or (like here) if they are the original author of the question or answer. – samcarter_is_at_topanswers.xyz May 6 '18 at 13:53
  • @texmex for using siunitx see also tex.stackexchange.com/a/430290/36296 – samcarter_is_at_topanswers.xyz May 6 '18 at 13:55
  • (the @ ping still isnt working) okay, I will ask a new question. Thanks! – texmex May 6 '18 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.