In addition to fixing the problem with underscores pointed out by Ulrike Fischer, you might want to tidy up the layout and alignment a little. The following uses booktabs
to improve the spacing and rules and dcolumn
to align the columns on the decimal point. I also use \centering
rather than the center
environment to avoid creating additional spacing since longtable
already uses spacing of its own.
\documentclass[12pt]{article}
\usepackage{dcolumn,longtable,booktabs}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{document}
{\centering% don't add extra space since the longtable environment will already add its own space
\begin{longtable}{cd{3}*{3}{d{2}}d{3}}
\caption{A simple longtable example}\\
\toprule
\textbf{name} & \multicolumn{1}{c}{\textbf{val1}} & \multicolumn{1}{c}{\textbf{val2}} & \multicolumn{1}{c}{\textbf{val3}} & \multicolumn{1}{c}{\textbf{val4}} & \multicolumn{1}{c}{\textbf{val5}}\\
\midrule
\endfirsthead
\multicolumn{6}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\toprule
\textbf{name} & \multicolumn{1}{c}{\textbf{val1}} & \multicolumn{1}{c}{\textbf{val2}} & \multicolumn{1}{c}{\textbf{val3}} & \multicolumn{1}{c}{\textbf{val4}} & \multicolumn{1}{c}{\textbf{val5}}\\
\midrule
\endhead
\bottomrule \multicolumn{6}{r}{\textit{Continued on next page}} \\
\endfoot
\bottomrule
\endlastfoot
a\_01 & 6.75 & 30.75 & 2.75 & -20.75 & 0.05 \\
a\_02 & 5.51 & 12.01 & 1.51 & -4.99 & 0.06 \\
b\_02 & 11.99 & 50.99 & -0.51 & -60.01 & 0.06 \\
b\_01 & 10.49 & 27.99 & 1.99 & -16.01 & 0.03 \\
c\_02 & 10.50 & 18.00 & 3.00& -6.49& 0.16 \\
d\_01 & 6.73 & 39.73 & -2.26 & -37.26 & 0.08 \\
d\_02 & 5.740 & 42.24 & -1.75 & -55.75 & 0.05 \\
d\_03 & 7.00 & 58.50 & -1.49 & -60.99 & 0.03 \\
d\_04 & 5.73 & 13.73 & 1.73 & -5.26 & 0.03 \\
d\_05 & 11.2 & 19.23 & 2.23 & -8.76 & 0.02 \\
d\_06 & 10.00 & 33.50 & 0.50 & -34.49 & 0.09 \\
d\_07 & 9.23 & 20.73 & 2.23 & -8.76 & 0.07 \\
d\_08 & 11.50 & 24.00 & 3.00 & -17.99 & 0.02 \\
d\_10 & 10.23 & 32.23 & 2.73 & -20.76 & 0.055 \\
d\_13 & 9.23 & 22.73 & -0.76 & -8.76 & 0.05 \\
d\_14 & 8.50 & 23.50 & 3.50 & -9.99 & 0.031 \\
d\_15 & 8.23 & 28.23 & -0.26 & -26.76 & 0.07\\
d\_16 & 8.73 & 25.23 & 3.23 & -7.76 & 0.047 \\
d\_19 & 8.73 & 16.23 & 1.24 & -5.76 & 0.07 \\
d\_20 & 10.74 & 49.24 & 4.24 & -15.25 & 0.07 \\
d\_21 & 9.73 & 38.74 & 4.23 & -19.26 & 0.06 \\
d\_22 & 10.24 & 19.74 & 5.24 & -0.25 & 0.03 \\
e\_02 & 7.49 & 12.49 & 3.49 & -4.00 & 0.08 \\
f\_02 & 7.49 & 12.49 & 3.49 & -4.00 & 0.08 \\
f\_03 & 7.99 & 16.49 & 3.49 & -1.00 & 0.03 \\
f\_04 & 7.00 & 19.50 & 4.50 & -4.99 & 0.03 \\
f\_05 & 6.99 & 14.49 & 3.99 & -4.00 & 0.040 \\
f\_06 & 7.50 & 17.00 & 4.50 & -4.49 & 0.027 \\
f\_09 & 7.26 & 12.26 & 3.76 & -1.73 & 0.03 \\
\end{longtable}
}
\end{document}
Here's an adaptation of your code that employs a longtable
environment. Observe that I had to fix a number of issues with your code in addition to changing over from a table
/tabular
combination to a longtable
. Among them are a replacement of all instances of $*$
with \times
and a replacement of all instances of & & & \\
with \addlinespace
, a macro provided by the booktabs
package.
The following screenshot shows just the first few rows of the resulting table.
\documentclass{article}
\usepackage{longtable,booktabs}
\newcommand{\vn}[1]{\mathit{#1}}
\begin{document}
\begin{longtable}{@{} l ccc @{}}
\caption{Results for Living Standard Indicators}
\label{tab:results}\\
\toprule
& \multicolumn{3}{c}{Dependent variables} \\
\cmidrule(l){2-4}
& $K_{i,t}$ & $H_{i,t}$ & $I_{i,t}$ \\
& Physical Capital & Human Capital & Instit.\ Capital \\
& (1) & (2) & (3) \\
\midrule
\endfirsthead
\multicolumn{4}{@{}l}{Table \thetable, continued}\\
\addlinespace
\toprule
& \multicolumn{3}{c}{Dependent variables} \\
\cmidrule(l){2-4}
& $K_{i,t}$ & $H_{i,t}$ & $I_{i,t}$ \\
& Physical Capital & Human Capital & Instit.\ Capital \\
& (1) & (2) & (3) \\
\midrule
\endhead
\midrule
\endfoot
\bottomrule
\addlinespace
\multicolumn{4}{@{}l}{\textit{Note}: $^{*}\ p<0.1$; $^{**}\ p<0.05$; $^{***}\ p<0.01$}
\endlastfoot
$R_{i}$ & $-$0.10$^{***}$ & $-$0.05 & 0.08 \\
& (0.02) & (0.04) & (0.08) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}$ & $-$0.002 & $-$0.01$^{**}$ & $-$0.01 \\
& (0.002) & (0.004) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}$ & 0.13$^{*}$ & 0.69$^{***}$ & 0.22 \\
& (0.07) & (0.18) & (0.42) \\
\addlinespace
$R_{i}\times \vn{NR}_{i}$ & $-$0.50$^{***}$ & 0.18 & $-$0.98$^{*}$ \\
& (0.09) & (0.23) & (0.56) \\
\addlinespace
$R_{i}\times D_{i}$ & 0.01 & 0.05 & 0.11 \\
& (0.02) & (0.04) & (0.08) \\
\addlinespace
$R_{i}\times L_{i}$ & 0.0004 & $-$0.05 & $-$0.23$^{***}$ \\
& (0.01) & (0.03) & (0.06) \\
\addlinespace
$R_{i}\times V_{i}$ & 0.02$^{**}$ & $-$0.06$^{*}$ & $-$0.12$^{***}$ \\
& (0.01) & (0.03) & (0.04) \\
\addlinespace
$R_{i}\times C_{i}$ & 0.03$^{**}$ & $-$0.08$^{**}$ & $-$0.17$^{**}$ \\
& (0.01) & (0.04) & (0.07) \\
\addlinespace
$R_{i}\times M_{i}$ & $-$0.01 & $-$0.04$^{**}$ & 0.09$^{***}$ \\
& (0.01) & (0.02) & (0.03) \\
\addlinespace
$R_{i}\times S_{i}$ & 0.04$^{***}$ & 0.23$^{***}$ & 0.19$^{**}$ \\
& (0.02) & (0.04) & (0.08) \\
\addlinespace
$R_{i}\times \vn{Dem}_{i}$ & 0.05$^{***}$ & 0.07$^{***}$ & 0.07 \\
& (0.02) & (0.02) & (0.05) \\
\addlinespace
$R_{i}\times \vn{Right}_{i}$ & $-$0.02 & $-$0.03 & $-$0.20$^{*}$ \\
& (0.02) & (0.05) & (0.10) \\
\addlinespace
$R_{i}\times \vn{Left}_{i}$ & 0.02 & $-$0.03 & $-$0.08 \\
& (0.01) & (0.05) & (0.07) \\
\addlinespace
$R_{i}\times Y_{i,t}\times L_{i}$ & $-$0.01 & $-$0.37$^{*}$ & $-$0.52 \\
& (0.07) & (0.19) & (0.37) \\
\addlinespace
$R_{i}\times Y_{i,t}\times V_{i}$ & 0.001 & 0.51$^{***}$ & 0.18 \\
& (0.05) & (0.12) & (0.22) \\
\addlinespace
$R_{i}\times Y_{i,t}\times C_{i}$ & $-$0.08 & $-$0.33$^{**}$ & $-$0.80$^{**}$ \\
& (0.06) & (0.16) & (0.36) \\
\addlinespace
$R_{i}\times Y_{i,t}\times M_{i}$ & $-$0.01 & $-$0.17$^{**}$ & 0.14 \\
& (0.03) & (0.08) & (0.16) \\
\addlinespace
$R_{i}\times Y_{i,t}\times S_{i}$ & $-$0.01 & $-$0.86$^{***}$ & 0.87$^{**}$ \\
& (0.08) & (0.20) & (0.42) \\
\addlinespace
$R_{i}\times Y_{i,t}\times \vn{Dem}_{i}$ & 0.10$^{*}$ & $-$0.14 & 0.07 \\
& (0.05) & (0.09) & (0.27) \\
\addlinespace
$R_{i}\times Y_{i,t}\times \vn{Left}_{i}$ & 0.02 & $-$0.67$^{***}$ & 0.31 \\
& (0.05) & (0.20) & (0.29) \\
\addlinespace
$R_{i}\times Y_{i,t}\times \vn{Right}_{i}$ & 0.15$^{*}$ & 0.39 & 0.11 \\
& (0.08) & (0.24) & (0.53) \\
\addlinespace
$R_{i}\times Y_{i,t}\times D_{i}$ & $-$0.29$^{***}$ & $-$0.35$^{**}$ & 0.59$^{*}$ \\
& (0.07) & (0.16) & (0.32) \\
\addlinespace
$R_{i}\times Y_{i,t}\times \vn{NR}_{i}$ & 0.56 & 0.83 & 1.05 \\
& (0.39) & (1.15) & (2.35) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times L_{i}$ & $-$0.002 & 0.003 & $-$0.02$^{*}$ \\
& (0.002) & (0.005) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times V_{i}$ & $-$0.0001 & $-$0.004$^{*}$ & 0.004 \\
& (0.001) & (0.002) & (0.004) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times C_{i}$ & 0.003$^{**}$ & 0.01$^{*}$ & 0.01$^{*}$ \\
& (0.001) & (0.003) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times M_{i}$ & $-$0.001 & 0.003$^{*}$ & $-$0.001 \\
& (0.001) & (0.002) & (0.004) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times S_{i}$ & $-$0.0005 & 0.01$^{***}$ & $-$0.01$^{**}$ \\
& (0.002) & (0.003) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times \vn{Dem}_{i}$ & $-$0.001 & 0.001 & 0.01 \\
& (0.001) & (0.002) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times D_{i}$ & 0.001 & 0.01 & $-$0.01 \\
& (0.002) & (0.004) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times \vn{NR}_{i}$ & $-$0.01 & $-$0.004 & 0.02 \\
& (0.01) & (0.04) & (0.08) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times \vn{Left}_{i}$ & 0.004$^{**}$ & 0.01$^{**}$ & 0.02$^{***}$ \\
& (0.001) & (0.005) & (0.01) \\
\addlinespace
$R_{i}\times Y_{i,t}^{2}\times \vn{Right}_{i}$ & $-$0.0003 & $-$0.003 & 0.01 \\
& (0.001) & (0.003) & (0.01) \\
\addlinespace
Constant & 0.05$^{***}$ & 0.22$^{***}$ & 0.42$^{***}$ \\
& (0.01) & (0.03) & (0.05) \\
\midrule
$F$-Statistic & 20.67$^{***}$ & 84.70$^{***}$ & 39.09$^{***}$ \\
Observations & 1,053 & 1,053 & 1,053 \\
$R^{2}$ & 0.28 & 0.56 & 0.44 \\
Adjusted $R^{2}$ & 0.25 & 0.54 & 0.42 \\
Res.\ Std.\ Error & 0.08 & 0.16 & 0.26 \\
\quad ($\vn{df} = 1{,}002$)
\end{longtable}
\end{document}
Best Answer
The columns should be specified as
S
-type, with atable-format
setting telling the number of digits:8
means eight digits in the integer part, no decimal part;2.1
means two digits in the integer part and one in the decimal part.With
booktabs
the table will be better; you probably want to repeat the header after a page break.Note that there's no need to use a
center
environment around alongtable
.