[Tex/LaTex] How to resize this table for a beamer presentation

beamerresizetables

{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}

\resizebox{\linewidth}{!}{
    \footnotesize
\begin{tabular}{l*{3}{c}}
\hline\hline
            &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}\\
            &\multicolumn{1}{c}{netinmargin}&\multicolumn{1}{c}{netinmargin}&\multicolumn{1}{c}{netinmargin}\\
\hline
infltn      &  -0.0000703* &   -0.000157  &      0.0230* \\
            &     (-2.16)  &     (-1.72)  &      (2.12)  \\
[1em]
fdi         &     -0.0405**&     -0.0364* &     -0.0189  \\
            &     (-3.80)  &     (-2.54)  &     (-0.21)  \\
[1em]
GDP         &     -0.0260  &     -0.0300  &     -0.0525* \\
            &     (-0.58)  &     (-0.75)  &     (-2.58)  \\
[1em]
roa         &              &       0.921**&      0.0126  \\
            &              &      (4.55)  &      (0.07)  \\
[1em]
roe         &              &     -0.0107  &      0.0877**\\
            &              &     (-0.44)  &      (7.11)  \\
[1em]
bcbd        &              &     0.00472  &     -0.0112  \\
            &              &      (0.56)  &     (-0.91)  \\
[1em]
dbacba      &              &     -0.0620**&     -0.0827**\\
            &              &     (-2.75)  &     (-3.70)  \\
[1em]
cbagdp      &              &    -0.00347  &      -0.106**\\
            &              &     (-0.11)  &     (-3.65)  \\
[1em]
llgdp       &              &      -0.212**&      -0.168* \\
            &              &     (-4.12)  &     (-2.28)  \\
[1em]
dbagdp      &              &      0.0532  &      0.0841* \\
            &              &      (1.78)  &      (2.05)  \\
[1em]
fdgdp       &              &       0.135**&       0.124* \\
            &              &      (2.73)  &      (2.43)  \\
[1em]
ll\_usd      &              &              &  0.00000381  \\
            &              &              &      (0.62)  \\
[1em]
overhead    &              &              &       0.699**\\
            &              &              &      (7.30)  \\
[1em]
xregme      &              &              &      -0.931  \\
            &              &              &     (-1.95)  \\
[1em]
nrbloan     &              &              &      0.0228  \\
            &              &              &      (0.48)  \\
[1em]
stmktcap    &              &              &     -0.0440* \\
            &              &              &     (-2.55)  \\
[1em]
stvaltraded &              &              &       0.255* \\
            &              &              &      (2.44)  \\
[1em]
stturnover  &              &              &     -0.0123  \\
            &              &              &     (-1.32)  \\
[1em]
listco\_pc   &              &              &   -0.000506  \\
            &              &              &     (-1.86)  \\
[1em]
\_cons      &       7.404**&       11.72**&       10.18**\\
            &     (34.15)  &      (4.67)  &      (4.14)  \\
\hline
\(N\)       &         470  &         452  &         102  \\
\(R^{2}\)   &       0.017  &       0.363  &       0.887  \\
adj. \(R^{2}\)&       0.011  &       0.347  &       0.860  \\
\hline\hline
\multicolumn{4}{l}{\footnotesize "test line 1" "test line 2"}\\
\end{tabular}}
}

Best Answer

even if you reorganize table, as is done in example below, you will have problem to fit it in one frame ... only with reduce font size to \scriptsize and reduce stretching of lines is possible to obtain:

enter image description here

\documentclass{beamer}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
\begin{frame}
    \centering
    \scriptsize
    \renewcommand\arraystretch{0.8}
    \setlength\tabcolsep{2pt}
\begin{tabular}{@{}l S[table-format=-2.8,
                       table-align-text-post=false]@{\,}r
                 S[table-format=-2.6,
                       table-align-text-post=false]@{\,}r
                 S[table-format=-2.8,
                       table-align-text-post=false]@{\,}r
                @{}}
    \toprule
        &   \multicolumn{2}{c}{(1)}
                    &   \multicolumn{2}{c}{(2)}
                            &   \multicolumn{2}{c}{(3)}       \\
        \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}
        & {netinmargin}
                      &  ???     & {netinmargin}
                                            &  ???    & {netinmargin}
                                                                &  ???      \\
    \midrule
infltn  & -0.0000703* & (-2.16) & -0.000157 & (-1.72) &  0.0230* & ( 2.12)  \\
fdi     & -0.0405**   & (-3.80) & -0.0364*  & (-2.54) & -0.0189  & (-0.21)  \\
GDP     & -0.0260     & (-0.58) & -0.0300   & (-0.75) & -0.0525* & (-2.58)  \\
roa     &             &         &  0.921**  & (4.55)  &  0.0126  & (0.07)   \\
roe     &             &         & -0.0107   & (-0.44) &  0.0877**& (7.11)   \\[2pt]

bcbd    &             &         &  0.00472  & (0.56)  & -0.0112  & (-0.91)  \\
dbacba  &             &         & -0.0620** & (-2.75) & -0.0827**& (-3.70)  \\
cbagdp  &             &         & -0.00347  & (-0.11) & -0.106** & (-3.65)  \\
llgdp   &             &         & -0.212**  & (-4.12) & -0.168*  & (-2.28)  \\
dbagdp  &             &         &  0.0532   & (1.78)  &  0.0841* & (2.05)   \\[2pt]

fdgdp   &             &         &  0.135**  & (2.73)  &  0.124*  & (2.43)   \\
ll\_usd &             &         &           &         &  0.00000381 & (0.62)\\
overhead&             &         &           &         &  0.699** & (7.30)   \\
xregme  &             &         &           &         & -0.931   & (-1.95)  \\
nrbloan &             &         &           &         &  0.0228  & (0.48)   \\[2pt]

stmktcap    &         &         &           &         & -0.0440* & (-2.55)  \\
stvaltraded &         &         &           &         &  0.255*  & (2.44)   \\
stturnover  &         &         &           &         & -0.0123  & (-1.32)  \\
listco\_pc  &         &         &           &         & -0.000506& (-1.86)  \\
\_cons      & 7.404** & (34.15) & 11.72**   & (4.67)  & 10.18**  & (4.14)   \\[2pt]

\(N\)       & 470     &         & 452       &         & 102      &          \\
\(R^{2}\)   & 0.017   &         & 0.363     &         &  0.887   &          \\
adj. \(R^{2}\)  & 0.011     &   & 0.347     &         &  0.860   &          \\
    \midrule[1pt]
\multicolumn{4}{l}{\scriptsize "test line 1" "test line 2"} \\
\end{tabular}

\end{frame}
\end{document}
Related Question