2

I want to add another column called "N" right before "Range" column for each sample. How to revise my code?

This is my code:

\documentclass{article}
\usepackage{booktabs}

\begin{document}
\begin{table}[ht]
\centering
\caption{Descriptive Statistics}
\begin{tabular}{@{} l ccc ccc @{}}
  \toprule
  & \multicolumn{3}{c}{Dyads Sample} & \multicolumn{3}{c}{Committed Sample} \\
  \cmidrule(lr){2-4} \cmidrule(l){5-7}
  & Range & Mean & Sd & Range & Mean & Sd \\ 
  \midrule
  BAA & \{0,1\}\ & 0.362 &  & \{0,1\}\ & 0.306 &  \\ 
  BAF & \{0,1\}\ & 0.449 &  & \{0,1\}\ & 0.388 &  \\ 
  Data Science & \{0,1\}\ & 0.550 &  & \{0,1\}\ & 0.406 &  \\ 
  Life Science & \{0,1\}\ & 0.597 &  & \{0,1\}\ & 0.509 &  \\ 
  Engineer & \{0,1\}\ & 0.796 &  & \{0,1\}\ & 0.864 &  \\ 
  Previous Raised & (0,40.0] & 1.096 & 3.030 & (0,10.0] & 1.101 & 1.754 \\ 
  Max Raise & [0.2,27.7] & 2.026 & 2.658 & [0.2,20.0] & 2.947 & 2.947 \\ 
  Age & [0,18] & 3.157 & 2.738 & [0,11] & 3.188 & 2.307 \\ 
  Patent & \{0,1\}\ & 0.171 &  & \{0,1\}\ & 0.161 &  \\ 
  Committed & \{0,1\}\ & 0.0188 &  & \{0,1\}\ & 1 &  \\ 
  Amount (\$K) & [0,350] & 0.273 & 5.154 & [3,350] & 15.408 & 35.627 \\ 
  \midrule
  \#Obs & 18,618 & 18,618 & 18,618 & 330 & 330 & 330 \\
  \bottomrule
\end{tabular}
\end{table}
\end{document}

This is my output: enter image description here

0
6

If I got properly what you're asking for, this should be what you need.
Otherwise tell me that I make some changes: enter image description here

\documentclass{article}
\usepackage{booktabs}

\begin{document}
\begin{table}[ht]
\centering
\caption{Descriptive Statistics}
\begin{tabular}{@{} l ccc ccc ccc@{}}
  \toprule
  & \multicolumn{4}{c}{Dyads Sample} & \multicolumn{4}{c@{}}{Committed Sample} \\
  \cmidrule(lr){2-5} \cmidrule(l){6-9}
  & N & Range & Mean & Sd & N &Range & Mean & Sd \\ 
  \midrule
  BAA && \{0,1\}\ & 0.362 &  && \{0,1\}\ & 0.306 &  \\ 
  BAF && \{0,1\}\ & 0.449 &  && \{0,1\}\ & 0.388 &  \\ 
  Data Science && \{0,1\}\ & 0.550 &  && \{0,1\}\ & 0.406 &  \\ 
  Life Science && \{0,1\}\ & 0.597 &  && \{0,1\}\ & 0.509 &  \\ 
  Engineer && \{0,1\}\ & 0.796 &  && \{0,1\}\ & 0.864 &  \\ 
  Previous Raised && (0,40.0] & 1.096 & 3.030 && (0,10.0] & 1.101 & 1.754 \\ 
  Max Raise && [0.2,27.7] & 2.026 & 2.658 && [0.2,20.0] & 2.947 & 2.947 \\ 
  Age && [0,18] & 3.157 & 2.738 && [0,11] & 3.188 & 2.307 \\ 
  Patent && \{0,1\}\ & 0.171 &  && \{0,1\}\ & 0.161 &  \\ 
  Committed && \{0,1\}\ & 0.0188 &  && \{0,1\}\ & 1 &  \\ 
  Amount (\$K) && [0,350] & 0.273 & 5.154 && [3,350] & 15.408 & 35.627 \\ 
  \midrule
  \#Obs && 18,618 & 18,618 & 18,618 && 330 & 330 & 330 \\
  \bottomrule
\end{tabular}
\end{table}
\end{document}
4
  • +1. One minor remark: neither array nor multirow are required for this particular tabular.
    – leandriis
    May 18 '21 at 16:06
  • Oops. My fault! I had to do my own MWE using ad older example. I edit it immediately! Thanks a lot. Wooof May 18 '21 at 16:17
  • thank you so much!!
    – user235424
    May 19 '21 at 13:44
  • @user235424 you're welcome! If this solved your problem, don't forget to accept my solution ;D May 20 '21 at 8:19

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.