0

I want to rescale this table because I want it to fit in one page but for some reason it won't and it gives me errors. I tried using \scalebox{0.5} that I used for another table but it doesn't work.

   \begin{table}[h]
    \centering
        \caption{Panel A}
    \begin{tabular}{l*{2}{c}}
\hline\hline
            &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\

\hline Highest schooling attained& -0.00577 & -0.00835 \ & (0.0109) & (0.0108) \ Husband's highest schooling attained (reported by wife)& 0.0151 & 0.0167 \ & (0.0145) & (0.0145) \ Ideal number of children& 0.00757 & 0.00803 \ & (0.0292) & (0.0292) \ Age & 0.00192 & 0.00132 \ & (0.0110) & (0.0110) \ Husband's age (reported by wife)& 0.00393 & 0.00467 \ & (0.0120) & (0.0120) \ Husband's ideal number of children (reported by wife)& -0.0225 & -0.0220 \ & (0.0203) & (0.0203) \ Has ever used a modern contraceptive method& -0.0181 & 0.00141 \ & (0.102) & (0.101) \ Wife has monthly income& -0.0735 & -0.0748 \ & (0.129) & (0.129) \ Wife knows when she is most fertile& 0.0917 & 0.0965 \ & (0.0817) & (0.0816) \ Wife wants to become pregnant in following 2 years& 0.00457 & -0.00293 \ & (0.0664) & (0.0657) \ Age wife married& 0.00758 & 0.00787 \ & (0.00948) & (0.00947) \ Catholic & -0.00748 & -0.00580 \ & (0.0658) & (0.0657) \ Comparison of happiness with other women in region\(1=very unhappy, 5=very happy)& 0.00915 & 0.0119 \ & (0.0353) & (0.0352) \ Comparison of health with other women in region\(1=very poor, 5=excellent)& 0.00229 & -0.00611 \ & (0.0406) & (0.0403) \ Number of years respondent lived in Lusaka& 0.000733 & 0.000546 \ & (0.00256) & (0.00255) \ Couple has electricity& 0.00826 & 0.00748 \ & (0.0574) & (0.0569) \ Formally married& 0.0388 & 0.0233 \ & (0.0930) & (0.0916) \ Number of days in past 7 days couple has sex& 0.0194 & 0.0174 \ & (0.0256) & (0.0256) \ Number of days in past month couple has sex& -0.00292 & -0.00287 \ & (0.00786) & (0.00785) \ Number of children husband has with other women& -0.00612 & -0.000674 \ & (0.0676) & (0.0674) \ Frequency at which couple has talked about contraception in last year& 0.0137 & 0.0112 \ & (0.0267) & (0.0266) \ Couple has ever disagreed on number of children& 0.0559 & 0.0559 \ & (0.0824) & (0.0824) \ Couple has ever disagreed on contraception use& -0.0699 & -0.0682 \ & (0.0909) & (0.0908) \ Have used contraceptive method without husband's knowledge& 0.00117 & -0.00202 \ & (0.0875) & (0.0874) \ Husband drinks at least 2 to 3 times a week& -0.00806 & -0.00576 \ & (0.0553) & (0.0552) \ f29 & -0.0802 & -0.0819 \ & (0.0580) & (0.0579) \ Wife ever pressured to have sex& 0.0549 & 0.0560 \ & (0.0623) & (0.0621) \ Husband does budgeting& 0.0193 & 0.0141 \ & (0.0818) & (0.0817) \ Husband decides major purchases& 0.0404 & 0.0421 \ & (0.0632) & (0.0631) \ cons & 0.286 & 0.303 \ & (0.321) & (0.321) \ \hline (N) & 423 & 426 \ \hline\hline \multicolumn{2}{l}{\footnotesize Standard errors in parentheses}\ \multicolumn{2}{l}{\footnotesize * (p<0.05), ** (p<0.01), *** (p<0.001)}\ \end{tabular}

\end{table}

This is what I used for the other

\begin{table}[htbp]
\centering                
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}                 
\caption{Summary Statistics for Final Sample \label{tab:tab2}}                 \scalebox{0.5}{\begin{tabular}{l c*{6}{c}} \hline
          &\multicolumn{3}{c}{Individual Treatment}                &\multicolumn{2}{c}\\\cmidrule(lr){2-4}
          &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
\toprule                                 \multicolumn{6}{l}{\textbf{Panel B}} \\                                 \midrule

Using any method at baseline& -0.0613 & -0.0444 \ & (0.0820) & (0.0810) \ Number of living children& 0.0143 & 0.0133 \ & (0.0276) & (0.0276) \ Using injectable at baseline& -0.151 & -0.153 \ & (0.384) & (0.384) \ \hline\hline \multicolumn{11}{l}{\footnotesize Standard errors in parentheses}\ \multicolumn{11}{l}{\footnotesize \sym{} (p<0.05), \sym{} (p<0.01), \sym{**} (p<0.001)}\ \end{tabular}} \end{table}

4 Answers4

1

Your table is too long to fit on a page. If you reduce the size of the fonts used in the table then it will become increasingly difficult for any readers to be able to read the table.

Basically you have too many entries in your table. Redesign it instead into two (or more) tabulations that will each fit onto a page. I haven't studied your table in detail but it seems to concatenate several topics; can you separate these out? Perhaps into "Panel A" and "Panel A (continued)" --- GOM

Peter Wilson
  • 28,066
1

After half of year (I didn't notice this question before) ...

Your first table in its current format is too long to fit on a page. If you willing to write standard errors in separate columns and round number of decimals to (reasonable) three, than is possible to fit it on one page at using normal font size.

By use of the tabularray package with libraries booktabs and siunitx (which load packages of the same names) the MWE with your table can be as follows:

\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{tabularray}
\UseTblrLibrary{siunitx,booktabs}
\ExplSyntaxOn
\NewChildSelector {eachfour}
  {
    \int_step_inline:nnnn {2} {4} { \l_tblr_childs_total_tl }
      { \clist_put_right:Nn \l_tblr_childs_clist {##1} }
  }
\ExplSyntaxOff

\usepackage{lipsum} \begin{document} %\lipsum[55]

\begin{table}

\sisetup{ input-open-uncertainty={}, input-close-uncertainty={}, table-align-text-before=false, table-align-text-after=false, round-mode=places, round-precision=3, table-format={(}-1.3{)} } \begin{talltblr}[ caption = {Panel A}, label = {tab:???}, note{} = {Standard errors in parentheses:\newline : (p<0.10),\quad : (p<0.05),\quad *: (p<0.01). } ]{ colsep = 3pt, colspec = { X[2.8,l,m, font=\linespread{0.84}\selectfont] {4}{X[0.8, c, si]} }, row{1} = {font=\small\bfseries}, hline{eachfour} = {1-5}{0.2pt,dashed},
} \toprule &\SetCell[c=2]{c} {{{(1)}}} & &\SetCell[c=2]{c} {{{(2)}}}
& \ \cmidrule[r]{1-1} \cmidrule[l]{2-3} \cmidrule[l]{4-5} Highest schooling attained & -0.00577 & (0.0109) & -0.00835 & (0.0108) \ Husband's highest schooling attained (reported by wife) & 0.0151 & (0.0145) & 0.0167 & (0.0145) \ Ideal number of children & 0.00757 & (0.0292) & 0.00803 & (0.0292) \ Age & 0.00192 & (0.0110) & 0.00132 & (0.0110) \ Husband's age (reported by wife) & 0.00393 & (0.0120) & 0.00467 & (0.0120) \

Husband's ideal number of children (reported by wife) & -0.0225 & (0.0203) & -0.0220 & (0.0203) \ Has ever used a modern contraceptive method & -0.0181 & (0.102) & 0.00141 & (0.101) \ Wife has monthly income & -0.0735 & (0.129) & -0.0748 & (0.129) \ Wife knows when she is most fertile & 0.0917 & (0.0817) & 0.0965 & (0.0816) \ Wife wants to become pregnant in following 2 years & 0.00457 & (0.0664) & -0.00293 & (0.0657) \

Age wife married & 0.00758 & (0.00948) & 0.00787 & (0.00947) \ Catholic & -0.00748 & (0.0658) & -0.00580 & (0.0657) \ Comparison of happiness with other women in region (1=very unhappy, 5=very happy) & 0.00915 & (0.0353) & 0.0119 & (0.0352) \ Comparison of health with other women in region (1=very poor, 5=excellent) & 0.00229 & (0.0406) & -0.00611 & (0.0403) \ Number of years respondent lived in Lusaka & 0.000733 & (0.00256) & 0.000546 & (0.00255) \

Couple has electricity & 0.00826 & (0.0574) & 0.00748 & (0.0569) \ Formally married & 0.0388 & (0.0930) & 0.0233 & (0.0916) \ Number of days in past 7 days couple has sex & 0.0194 & (0.0256) & 0.0174 & (0.0256) \ Number of days in past month couple has sex & -0.00292 & (0.00786) & -0.00287 & (0.00785) \ Number of children husband has with other women & -0.00612 & (0.0676) & -0.000674 & (0.0674) \

Frequency at which couple has talked about contraception in last year & 0.0137 & (0.0267) & 0.0112 & (0.0266) \ Couple has ever disagreed on number of children & 0.0559 & (0.0824) & 0.0559 & (0.0824) \ Couple has ever disagreed on contraception use & -0.0699 & (0.0909) & -0.0682 & (0.0908) \ Have used contraceptive method without husband's knowledge & 0.00117 & (0.0875) & -0.00202 & (0.0874) \ Husband drinks at least 2 to 3 times a week & -0.00806 & (0.0553) & -0.00576 & (0.0552) \

f29 & -0.0802 & (0.0580) & -0.0819 & (0.0579) \ Wife ever pressured to have sex & 0.0549 & (0.0623) & 0.0560 & (0.0621) \ Husband does budgeting & 0.0193 & (0.0818) & 0.0141 & (0.0817) \ Husband decides major purchases & 0.0404 & (0.0632) & 0.0421 & (0.0631) \ cons & 0.286 & (0.321) & 0.303 & (0.321) \ \midrule (N) & {423} & & {426} & \ \bottomrule \end{talltblr} \end{table} \end{document}

enter image description here

Meanwhile the structure of the first table and its content is clear, the second table is unclear at all. Therefore the suggestion for it is based on guessing (and may be completely wrong). Anyway, given is skeleton in which can be (hopefuly) easy insert correct content:

\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{tabularray}
\UseTblrLibrary{siunitx,booktabs}

\begin{document} \begin{table}[htbp] \sisetup{ input-open-uncertainty={}, input-close-uncertainty={}, table-align-text-before=false, table-align-text-after=false, round-mode=places, round-precision=3, table-format={(}-1.3{)} } \begin{talltblr}[ caption = {Panel B}, label = {tab:?}, note{} = {Standard errors in parentheses:\newline : (p<0.10),\quad : (p<0.05),\quad *: (p<0.01). } ]{ colsep = 3pt, colspec = { X[2.8,l,m, font=\linespread{0.84}\selectfont] {6}{X[0.8, c, si]} }, row{1} = {font=\small\bfseries}, } \toprule &\SetCell[c=4]{c} {{{Individual Treatment}}}
& & & &\SetCell[c=2]{c} {{{missing}}} & \ \cmidrule[r]{2-5} \cmidrule[l]{6-7} &\SetCell[c=2]{c} {{{(1)}}} & &\SetCell[c=2]{c} {{{(2)}}} & & {{{?}}} & {{{?}}} \ \cmidrule[r]{1-1} \cmidrule[l]{2-3} \cmidrule[l]{4-5} \cmidrule[l]{6-7} Using any method at baseline & -0.0613 & (0.0820) & -0.0444 & (0.0810) & & \ Number of living children & 0.0143 & (0.0276) & 0.0133 & (0.0276) & & \ Using injectable at baseline & -0.151 & (0.384) & -0.153 & (0.384) & & \ \bottomrule \end{talltblr} \end{table} \end{document}

enter image description here

Note: both MWEs have been tested with the 2022A tabularray version. In a few days, a new version of the 2022B will be available with new features that will, among other things, allow you to write even simpler code for column headers.

The package version 2022A (unfortunately) are still not available on Overleaf.

Zarko
  • 296,517
0

I have no problems to scale your first example:

\begin{table}[h]
    \centering
    \caption{Panel A}
    \scalebox{0.5}{\begin{tabular}{l*{2}{c}}
        \hline\hline
        &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
    \hline
    Highest schooling attained&amp;     -0.00577         &amp;    -0.00835         \\
    &amp; (0.0109)         &amp;    (0.0108)         \\
    Husband's highest schooling attained (reported by wife)&amp;   0.0151         &amp;      0.0167         \\
    &amp;    (0.0145)         &amp;    (0.0145)         \\
    Ideal number of children&amp;     0.00757         &amp;     0.00803         \\
    &amp;                         (0.0292)         &amp;    (0.0292)         \\
    Age       &amp;     0.00192         &amp;     0.00132         \\
    &amp;    (0.0110)         &amp;    (0.0110)         \\
    Husband's age (reported by wife)&amp;      0.00393         &amp;     0.00467         \\
    &amp;    (0.0120)         &amp;    (0.0120)         \\
    Husband's ideal number of children (reported by wife)&amp;    -0.0225         &amp;     -0.0220         \\
    &amp;    (0.0203)         &amp;    (0.0203)         \\
    Has ever used a modern contraceptive method&amp;    -0.0181         &amp;     0.00141         \\
    &amp;     (0.102)         &amp;     (0.101)         \\
    Wife has monthly income&amp;    -0.0735         &amp;     -0.0748         \\
    &amp;     (0.129)         &amp;     (0.129)         \\
    Wife knows when she is most fertile&amp;    0.0917         &amp;      0.0965         \\
    &amp;    (0.0817)         &amp;    (0.0816)         \\
    Wife wants to become pregnant in following 2 years&amp;     0.00457         &amp;    -0.00293         \\
    &amp;    (0.0664)         &amp;    (0.0657)         \\
    Age wife married&amp;     0.00758         &amp;     0.00787         \\
    &amp;   (0.00948)         &amp;   (0.00947)         \\
    Catholic  &amp;      -0.00748         &amp;    -0.00580         \\
    &amp;    (0.0658)         &amp;    (0.0657)         \\
    Comparison of happiness with other women in region\\(1=very unhappy, 5=very happy)&amp;    0.00915         &amp;      0.0119         \\
    &amp;    (0.0353)         &amp;    (0.0352)         \\
    Comparison of health with other women in region\\(1=very poor, 5=excellent)&amp;    0.00229         &amp;    -0.00611         \\
    &amp;    (0.0406)         &amp;    (0.0403)         \\
    Number of years respondent lived in Lusaka&amp;     0.000733         &amp;    0.000546         \\
    &amp;   (0.00256)         &amp;   (0.00255)         \\
    Couple has electricity&amp;      0.00826         &amp;     0.00748         \\
    &amp;    (0.0574)         &amp;    (0.0569)         \\
    Formally married&amp;    0.0388         &amp;      0.0233         \\
    &amp;    (0.0930)         &amp;    (0.0916)         \\
    Number of days in past 7 days couple has sex&amp;    0.0194         &amp;      0.0174         \\
    &amp;    (0.0256)         &amp;    (0.0256)         \\
    Number of days in past month couple has sex&amp;       -0.00292         &amp;    -0.00287         \\
    &amp;   (0.00786)         &amp;   (0.00785)         \\
    Number of children husband has with other women&amp;    -0.00612         &amp;   -0.000674         \\
    &amp;    (0.0676)         &amp;    (0.0674)         \\
    Frequency at which couple has talked about contraception in last year&amp;    0.0137         &amp;      0.0112 \\
    &amp;    (0.0267)         &amp;    (0.0266)         \\
    Couple has ever disagreed on number of children&amp;    0.0559         &amp;      0.0559         \\
    &amp;    (0.0824)         &amp;    (0.0824)         \\
    Couple has ever disagreed on contraception use&amp;    -0.0699         &amp;     -0.0682         \\
    &amp;    (0.0909)         &amp;    (0.0908)         \\
    Have used contraceptive method without husband's knowledge&amp;    0.00117         &amp;    -0.00202         \\
    &amp;    (0.0875)         &amp;    (0.0874)         \\
    Husband drinks at least 2 to 3 times a week&amp;     -0.00806         &amp;    -0.00576         \\
    &amp;    (0.0553)         &amp;    (0.0552)         \\
    f29       &amp;    -0.0802         &amp;     -0.0819         \\
    &amp;    (0.0580)         &amp;    (0.0579)         \\
    Wife ever pressured to have sex&amp;     0.0549         &amp;      0.0560         \\
    &amp;    (0.0623)         &amp;    (0.0621)         \\
    Husband does budgeting&amp;    0.0193         &amp;      0.0141         \\
    &amp;    (0.0818)         &amp;    (0.0817)         \\
    Husband decides major purchases&amp;     0.0404         &amp;      0.0421         \\
    &amp;    (0.0632)         &amp;    (0.0631)         \\
    cons      &amp;     0.286         &amp;       0.303         \\
    &amp;  (0.321)         &amp;     (0.321)         \\
    \hline
    \(N\)       &amp;       423       &amp;       426     \\
    \hline\hline
    \multicolumn{2}{l}{\footnotesize Standard errors in parentheses}\\
    \multicolumn{2}{l}{\footnotesize * \(p&lt;0.05\), ** \(p&lt;0.01\), *** \(p&lt;0.001\)}\\
\end{tabular}

} \end{table}

There are 3 errors in the second table:

  1. In the second \multicolumn command the third argument is missing.

  2. and 3. In the last 2 \multicolumn comands you write 11, but you defined only 8 columns.

That works for me:

\begin{table}[htbp]
    \centering                
    \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}                 
    \caption{Summary Statistics for Final Sample \label{tab:tab2}}                 \scalebox{0.5}{\begin{tabular}{l c*{6}{c}} \hline
            &\multicolumn{3}{c}{Individual Treatment}                &\multicolumn{2}{c}{missing}\\\cmidrule(lr){2-4}
            &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
            \toprule                                 \multicolumn{6}{l}{\textbf{Panel B}} \\                                 \midrule
        Using any method at baseline&amp;    -0.0613         &amp;     -0.0444         \\
        &amp;    (0.0820)         &amp;    (0.0810)         \\
        Number of living children&amp;     0.0143         &amp;      0.0133         \\
        &amp;    (0.0276)         &amp;    (0.0276)         \\
        Using injectable at baseline&amp;           -0.151         &amp;      -0.153         \\
        &amp;     (0.384)         &amp;     (0.384)         \\
        \hline\hline
        \multicolumn{8}{l}{\footnotesize Standard errors in parentheses}\\ % changed to 8 columns
        \multicolumn{8}{l}{\footnotesize \sym{*} \(p&lt;0.05\), \sym{**} \(p&lt;0.01\), \sym{***} \(p&lt;0.001\)}\\ % changed to 8 columns
\end{tabular}}

\end{table}

Imran
  • 3,096
uli
  • 136
  • The second table is fine. I am asking for the first code I wrote. The first table is too big to fit in one page and I am asking for help on how to do that – Maybeline Lee Nov 29 '21 at 15:16
  • I added the scaled version of the first example in my answer. – uli Nov 29 '21 at 22:10
0

You're trying to cram too much in a table. Anyway, this fits on a standard text height if the font size is reduced.

Some descriptions have been split across two lines, the second is indented to show it's a continuation of the line above.

I used siunitx to align the figures and booktabs for better looking rules.

\documentclass{article}
\usepackage{siunitx,booktabs}
\usepackage{caption}

\begin{document}

\begin{table}[htp] \centering \scriptsize \sisetup{ input-open-uncertainty={}, input-close-uncertainty={}, table-align-text-before=false, table-align-text-after=false, group-digits=none, } \newcommand{\splitcell}[1]{% \smash{\begin{tabular}[t]{@{\qquad}l@{}}\hspace*{-2em}#1\end{tabular}}% }

\caption{Panel A}

\begin{tabular}{ @{} l S[table-format={(}-1.6{)}] S[table-format={(}-1.6{)}] @{} } \toprule & {(1)} & {(2)} \ \midrule Highest schooling attained & -0.00577 & -0.00835 \ & (0.0109) & (0.0108) \ \splitcell{Husband's highest schooling attained \ (reported by wife)} & 0.0151 & 0.0167 \ & (0.0145) & (0.0145) \ Ideal number of children & 0.00757 & 0.00803 \ & (0.0292) & (0.0292) \ Age & 0.00192 & 0.00132 \ & (0.0110) & (0.0110) \ \splitcell{Husband's age \ (reported by wife)} & 0.00393 & 0.00467 \ & (0.0120) & (0.0120) \ \splitcell{Husband's ideal number of children \ (reported by wife)} & -0.0225 & -0.0220 \ & (0.0203) & (0.0203) \ \splitcell{Has ever used a modern \ contraceptive method} & -0.0181 & 0.00141 \ & (0.102) & (0.101) \ Wife has monthly income & -0.0735 & -0.0748 \ & (0.129) & (0.129) \ Wife knows when she is most fertile & 0.0917 & 0.0965 \ & (0.0817) & (0.0816) \ \splitcell{Wife wants to become pregnant \ in following 2 years} & 0.00457 & -0.00293 \ & (0.0664) & (0.0657) \ Age wife married & 0.00758 & 0.00787 \ & (0.00948) & (0.00947) \ Catholic & -0.00748 & -0.00580 \ & (0.0658) & (0.0657) \ \splitcell{Comparison of happiness with other women \ in region (1=very unhappy, 5=very happy)} & 0.00915 & 0.0119 \ & (0.0353) & (0.0352) \ \splitcell{Comparison of health with other women \ in region (1=very poor, 5=excellent)} & 0.00229 & -0.00611 \ & (0.0406) & (0.0403) \ Number of years respondent lived in Lusaka & 0.000733 & 0.000546 \ & (0.00256) & (0.00255) \ Couple has electricity & 0.00826 & 0.00748 \ & (0.0574) & (0.0569) \ Formally married & 0.0388 & 0.0233 \ & (0.0930) & (0.0916) \ Number of days in past 7 days couple has sex & 0.0194 & 0.0174 \ & (0.0256) & (0.0256) \ Number of days in past month couple has sex & -0.00292 & -0.00287 \ & (0.00786) & (0.00785) \ \splitcell{Number of children husband \ has with other women} & -0.00612 & -0.000674 \ & (0.0676) & (0.0674) \ \splitcell{Frequency at which couple has talked \ about contraception in last year} & 0.0137 & 0.0112 \ & (0.0267) & (0.0266) \ \splitcell{Couple has ever disagreed \ on number of children} & 0.0559 & 0.0559 \ & (0.0824) & (0.0824) \ \splitcell{Couple has ever disagreed \ on contraception use} & -0.0699 & -0.0682 \ & (0.0909) & (0.0908) \ \splitcell{Have used contraceptive method \ without husband's knowledge} & 0.00117 & -0.00202 \ & (0.0875) & (0.0874) \ Husband drinks at least 2 to 3 times a week & -0.00806 & -0.00576 \ & (0.0553) & (0.0552) \ f29 & -0.0802 & -0.0819 \ & (0.0580) & (0.0579) \ Wife ever pressured to have sex & 0.0549 & 0.0560 \ & (0.0623) & (0.0621) \ Husband does budgeting & 0.0193 & 0.0141 \ & (0.0818) & (0.0817) \ Husband decides major purchases & 0.0404 & 0.0421 \ & (0.0632) & (0.0631) \ cons & 0.286 & 0.303 \ & (0.321) & (0.321) \ \midrule (N) & {423} & {426} \ \midrule[\heavyrulewidth] \multicolumn{3}{@{}l@{}}{Standard errors in parentheses} % * (p<0.05), ** (p<0.01), *** (p<0.001)}\ \end{tabular}

\end{table}

\end{document}

I omitted the last line with the p values, because asterisks don't appear in the table.

enter image description here

Probably splitting the table in halves and printing them at the top of facing pages is better.

egreg
  • 1,121,712