0

I don't get why if I make smaller the table produced by the following code (using \tiny), the table gets smaller and stays centered,

\begin{table}
 \tiny
  \begin{threeparttable}
  \caption{Participant Characteristics}

  \label{tab:key}

     \begin{tabularx}{\linewidth}{@{}>{\raggedright\arraybackslash\hangindent=6pt}X r@{\;}l r@{\;}l S[table-format=1.3]@{}}

          \toprule

          \thead[bl]{Variables} 

           & \multicolumn{2}{c}{\thead[b]{More \\experienced \\ investors}} 

          &  \multicolumn{2}{c}{\thead[b]{Less \\experienced \\ investors}} 

          &  {\thead[b]{P-Value\tnote{*}}}\\

         \midrule
         Percentage who had
        previously invested in
        the stock market       
                                     & \multicolumn{2}{c}{78.50\%} & \multicolumn{2}{c}{36.78\%} & .001  \\
        Years of business work
        experience        
                            &  6.35         & (6.00)             & 1.28         & (2.14)              & .001  \\
        Age     
                                &  30.46        & (5.83)             &  20.11       & (2.67)              & .001  \\
        Number of courses taken
        that discussed investing
        in mutual funds or the
        stock market        
                            &  1.58         & (1.70)              &  .95        & (1.16)             & .001  \\
        Familiarity with mutual
        funds (1 = not at all
        familiar, 7 = very
        familiar)   
                            & 4.59      & (1.61)              & 3.63        & (4.96)             & .011  \\
        Importance in investing in
        mutual funds or the
        stock market (1 = not
        at all important, 7 =
        very important) 
                            & 5.61      & (1.39)              &  5.24       & (1.31)             & .016  \\
        Peers' views of investing
        in mutual funds or the
        stock market (1 = not
        at all desirable, 7 =
        very desirable)         &  5.14         & (1.26)             &  4.64        & (1.71)              & .009  \\

          \bottomrule

     \end{tabularx}

\begin{tablenotes}[flushleft]
    \small
        \item[*] All tests are t-tests (one-tailed) except for the percentage investing, which is a chi-square test.
\end{tablenotes}


\end{threeparttable}

\end{table}

while if I do it with the table produced by the following code

\begin{table}
\tiny

\begin{tabular}{ l l l l l l }

\toprule

\multirow{3}*{Model} & \multicolumn{2}{l}{Unstandardized}               & Standardized       &  & \\

                 & \multicolumn{2}{l}{Coefficients}                 & \multicolumn{1}{l}{Coefficients}       & t    & sig\\

\cmidrule(lr){2-4}
                & B & Std. Error & Beta & & \\

\midrule
    (Constant)      &    30,757     &   6,188   &           &   4,971   &   ,000\\
    Interest Rate       &   ,392        &   ,129        &   ,519        &   3,031   &   ,004\\
    Exchange Rate   &   3,331   &   ,618        &   ,663        &   ,663        &   ,000\\

\bottomrule \end{tabular} \begin{tablenotes}[flushleft]\small \item[*] \textit{a. Dependent Variable: Investation} \end{tablenotes} \end{table}

the table gets smaller, but goes to the left. I would like it to stay centered.

Moreover, I would like to put a title on top of the second table (what is done by \caption for the first one), but using \caption in the second table I get a title that is too close to the table itself.

The code for the first table is by leandriis (Reproduce a table (using tabular?)).

Any suggestions are welcome.

MWE

\documentclass{book}

\usepackage{graphicx} \graphicspath{ {./images/} }

\usepackage{multirow}

\usepackage{booktabs} % horizontal lines, such as \toprule, \midrule and \bottomrule \usepackage{tabularx} % tabularx environment \usepackage{siunitx} % S type columns to improve alignment of numbers \usepackage{threeparttable} % tablenotes environment and \tnote commend \usepackage{makecell} % \thead command for column headers with manual line breaks

\usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage[english]{babel}

\begin{document}

\begin{center}

\begin{table} \tiny \begin{threeparttable}

  \caption{Participant Characteristics}

  \label{tab:key}

     \begin{tabularx}{\linewidth}{@{}>{\raggedright\arraybackslash\hangindent=6pt}X r@{\;}l r@{\;}l S[table-format=1.3]@{}}

          \toprule

          \thead[bl]{Variables} 

           & \multicolumn{2}{c}{\thead[b]{More \\experienced \\ investors}} 

          &  \multicolumn{2}{c}{\thead[b]{Less \\experienced \\ investors}} 

          &  {\thead[b]{P-Value\tnote{*}}}\\

         \midrule
         Percentage who had
        previously invested in
        the stock market       
                                     & \multicolumn{2}{c}{78.50\%} & \multicolumn{2}{c}{36.78\%} & .001  \\
        Years of business work
        experience        
                            &  6.35         & (6.00)             & 1.28         & (2.14)              & .001  \\
        Age     
                                &  30.46        & (5.83)             &  20.11       & (2.67)              & .001  \\
        Number of courses taken
        that discussed investing
        in mutual funds or the
        stock market        
                            &  1.58         & (1.70)              &  .95        & (1.16)             & .001  \\
        Familiarity with mutual
        funds (1 = not at all
        familiar, 7 = very
        familiar)   
                            & 4.59      & (1.61)              & 3.63        & (4.96)             & .011  \\
        Importance in investing in
        mutual funds or the
        stock market (1 = not
        at all important, 7 =
        very important) 
                            & 5.61      & (1.39)              &  5.24       & (1.31)             & .016  \\
        Peers' views of investing
        in mutual funds or the
        stock market (1 = not
        at all desirable, 7 =
        very desirable)         &  5.14         & (1.26)             &  4.64        & (1.71)              & .009  \\

          \bottomrule

     \end{tabularx}

\begin{tablenotes}[flushleft]
    \small
        \item[*] All tests are t-tests (one-tailed) except for the percentage investing, which is a chi-square test.
\end{tablenotes}


\end{threeparttable}

\end{table}

%\begin{tabular}{lccc} % %\toprule %\multirow{2}*{Elemento} & \multicolumn{3}{c}{Strati} \ %\cmidrule(lr){2-4} %& K & L & M \ %\midrule %idrogeno & $1$ & & \ %litio & $2$ & $1$ & \ %sodio & $2$ & $8$ & $1$ \ %\bottomrule %\end{tabular}

%\begin{tabular}{lcccll} % %\toprule % % \multirow{3}*{Model} & \multicolumn{3}{c}{Unstandardized Coefficients} & t & sign\ %
% \cmidrule(lr){2-4} % & B & Std. Error & Beta \ %
% \midrule % (Constant) & 30,757 & 6,188 & & 4,971 & ,000\ % Interest Rate & ,392 & ,129 & ,519 & 3,031 & ,004\ % Exchange Rate & 3,331 & ,618 & ,663 & ,663 & ,000\ % %\bottomrule %\end{tabular}

\begin{table} \tiny %\caption{t test results.}

\begin{tabular}{ l l l l l l }

\toprule

\multirow{3}*{Model} & \multicolumn{2}{l}{Unstandardized}               & Standardized       &  & \\

                 & \multicolumn{2}{l}{Coefficients}                 & \multicolumn{1}{l}{Coefficients}       & t    & sig\\

\cmidrule(lr){2-4}
                & B & Std. Error & Beta & & \\

\midrule
    (Constant)      &    30,757     &   6,188   &           &   4,971   &   ,000\\
    Interest Rate       &   ,392        &   ,129        &   ,519        &   3,031   &   ,004\\
    Exchange Rate   &   3,331   &   ,618        &   ,663        &   ,663        &   ,000\\

\bottomrule \end{tabular} \begin{tablenotes}[flushleft]\small \item[*] \textit{a. Dependent Variable: Investation} \end{tablenotes} \end{table}

\end{center}

%\begin{center} % %\begin{table} %\tiny %\begin{tabular}{lccccc} %\toprule %Panel A: Percentage of Participants Willing to Invest in Mutual Funds\ % & Small Set Condition2 & Large Set Condition2 & Difference & Chi-Square & P-Value \ %\midrule %forza & $F$ & newton \ %energia & $E$ & joule \ %tensione & $V$ & volt \ %\bottomrule %\end{tabular} % %\end{table} % %\end{center}

\end{document}

Vladimir
  • 343

0 Answers0