Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

could you please help me with the following matter? I am trying to create a long table using the longtable environment. But I keep getting errors. Thank you. Here is my code:

\documentclass[11pt, draft, titlepage]{article}
\bibliographystyle{plainnat}
\setlength{\oddsidemargin}{0.05in}
\setlength{\evensidemargin}{0.04in} \setlength{\textwidth}{6.6 in}
\setlength{\textheight}{600pt} \setlength{\topmargin}{0 in}
\setlength{\headheight}{0 in}
\setlength{\parindent}{0.5 cm}
\newcommand {\st}{\setlength{\baselineskip}{24pt}}
\newcommand{\fn}{\footnote}
\usepackage[dvips]{graphicx}
\usepackage[dvips]{lscape}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{array}
\usepackage{booktabs, multicol, multirow, afterpage, bigstrut}
\usepackage{longtable}


\begin{document}

\begin{longtable}{l|l|l|l|l|l|l}
\caption{Results from OLS Estimation}
\begin{small}
\hline
\hline
          & \multicolumn{3}{c}{Males} & \multicolumn{3}{c}{Females} \\
\hline
          & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\
          & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} \\

\hline
\endfirsthead

\hline \multicolumn{7}{|r|}{{\tablename} \thetable{} -- Continued} \\ \hline
          & \multicolumn{3}{c}{Males} & \multicolumn{3}{c}{Females} \\
\hline
          & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)} \\
          & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} & \multicolumn{1}{c}{OLS-NGive} & \multicolumn{1}{c}{OLS-GGive} & \multicolumn{1}{c}{OLS-GRec} \\

\hline
\endhead

\hline \multicolumn{7}{|r|}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline
\endlastfoot

    Log wage & \multicolumn{1}{c}{0.2754**} & \multicolumn{1}{c}{0.1301*} & \multicolumn{1}{c}{-0.1309**} & \multicolumn{1}{c}{0.3629**} & \multicolumn{1}{c}{0.2700**} & \multicolumn{1}{c}{-0.0815+} \\
          & \multicolumn{1}{c}{(0.0814)} & \multicolumn{1}{c}{(0.0613)} & \multicolumn{1}{c}{(0.0494)} & \multicolumn{1}{c}{(0.0803)} & \multicolumn{1}{c}{(0.0625)} & \multicolumn{1}{c}{(0.0473)} \\
    Age   & \multicolumn{1}{c}{0.0128} & \multicolumn{1}{c}{0.0589} & \multicolumn{1}{c}{0.0432} & \multicolumn{1}{c}{0.0879} & \multicolumn{1}{c}{0.0226} & \multicolumn{1}{c}{-0.0691} \\
          & \multicolumn{1}{c}{(0.0880)} & \multicolumn{1}{c}{(0.0740)} & \multicolumn{1}{c}{(0.0473)} & \multicolumn{1}{c}{(0.0812)} & \multicolumn{1}{c}{(0.0600)} & \multicolumn{1}{c}{(0.0520)} \\
    Age sq & \multicolumn{1}{c}{0.0001} & \multicolumn{1}{c}{-0.0004} & \multicolumn{1}{c}{-0.0005} & \multicolumn{1}{c}{-0.0007} & \multicolumn{1}{c}{-0.0002} & \multicolumn{1}{c}{0.0005} \\
          & \multicolumn{1}{c}{(0.0008)} & \multicolumn{1}{c}{(0.0006)} & \multicolumn{1}{c}{(0.0004)} & \multicolumn{1}{c}{(0.0007)} & \multicolumn{1}{c}{(0.0005)} & \multicolumn{1}{c}{(0.0005)} \\
    Educ  & \multicolumn{1}{c}{0.0174} & \multicolumn{1}{c}{-0.0721} & \multicolumn{1}{c}{-0.1064**} & \multicolumn{1}{c}{-0.1381} & \multicolumn{1}{c}{-0.2056*} & \multicolumn{1}{c}{-0.0770**} \\
          & \multicolumn{1}{c}{(0.0609)} & \multicolumn{1}{c}{(0.0543)} & \multicolumn{1}{c}{(0.0245)} & \multicolumn{1}{c}{(0.0902)} & \multicolumn{1}{c}{(0.0848)} & \multicolumn{1}{c}{(0.0258)} \\
    Educ sq & \multicolumn{1}{c}{0.0003} & \multicolumn{1}{c}{0.0051*} & \multicolumn{1}{c}{0.0055**} & \multicolumn{1}{c}{0.0051} & \multicolumn{1}{c}{0.0095**} & \multicolumn{1}{c}{0.0047**} \\
          & \multicolumn{1}{c}{(0.0026)} & \multicolumn{1}{c}{(0.0022)} & \multicolumn{1}{c}{(0.0013)} & \multicolumn{1}{c}{(0.0036)} & \multicolumn{1}{c}{(0.0032)} & \multicolumn{1}{c}{(0.0013)} \\
    Non-labor inc & \multicolumn{1}{c}{0.0027*} & \multicolumn{1}{c}{0.0024*} & \multicolumn{1}{c}{-0.0003} & \multicolumn{1}{c}{0.0010} & \multicolumn{1}{c}{0.0013+} & \multicolumn{1}{c}{0.0002} \\
          & \multicolumn{1}{c}{(0.0012)} & \multicolumn{1}{c}{(0.0010)} & \multicolumn{1}{c}{(0.0005)} & \multicolumn{1}{c}{(0.0008)} & \multicolumn{1}{c}{(0.0007)} & \multicolumn{1}{c}{(0.0004)} \\
    HH wealth & \multicolumn{1}{c}{0.0079} & \multicolumn{1}{c}{0.0160*} & \multicolumn{1}{c}{0.0077} & \multicolumn{1}{c}{0.0022} & \multicolumn{1}{c}{0.0004} & \multicolumn{1}{c}{-0.0012} \\
          & \multicolumn{1}{c}{(0.0093)} & \multicolumn{1}{c}{(0.0068)} & \multicolumn{1}{c}{(0.0050)} & \multicolumn{1}{c}{(0.0043)} & \multicolumn{1}{c}{(0.0038)} & \multicolumn{1}{c}{(0.0019)} \\
    Nwhite & \multicolumn{1}{c}{0.9998**} & \multicolumn{1}{c}{0.7522**} & \multicolumn{1}{c}{-0.2394**} & \multicolumn{1}{c}{0.6197**} & \multicolumn{1}{c}{0.4897**} & \multicolumn{1}{c}{-0.1332*} \\
          & \multicolumn{1}{c}{(0.1271)} & \multicolumn{1}{c}{(0.1149)} & \multicolumn{1}{c}{(0.0470)} & \multicolumn{1}{c}{(0.1142)} & \multicolumn{1}{c}{(0.0968)} & \multicolumn{1}{c}{(0.0572)} \\
    Hisp  & \multicolumn{1}{c}{0.6440**} & \multicolumn{1}{c}{0.4753**} & \multicolumn{1}{c}{-0.1572**} & \multicolumn{1}{c}{0.6450**} & \multicolumn{1}{c}{0.6302**} & \multicolumn{1}{c}{-0.0371} \\
          & \multicolumn{1}{c}{(0.1728)} & \multicolumn{1}{c}{(0.1607)} & \multicolumn{1}{c}{(0.0559)} & \multicolumn{1}{c}{(0.1904)} & \multicolumn{1}{c}{(0.1719)} & \multicolumn{1}{c}{(0.0701)} \\
    Married & \multicolumn{1}{c}{-0.3104*} & \multicolumn{1}{c}{-0.3796**} & \multicolumn{1}{c}{-0.0801} & \multicolumn{1}{c}{0.2232*} & \multicolumn{1}{c}{-0.0784} & \multicolumn{1}{c}{-0.3247**} \\
          & \multicolumn{1}{c}{(0.1472)} & \multicolumn{1}{c}{(0.1296)} & \multicolumn{1}{c}{(0.0853)} & \multicolumn{1}{c}{(0.1107)} & \multicolumn{1}{c}{(0.0858)} & \multicolumn{1}{c}{(0.0662)} \\
    Poor health & \multicolumn{1}{c}{-0.0069} & \multicolumn{1}{c}{0.0406} & \multicolumn{1}{c}{0.0520} & \multicolumn{1}{c}{-0.0710} & \multicolumn{1}{c}{0.0845} & \multicolumn{1}{c}{0.1645**} \\
          & \multicolumn{1}{c}{(0.1004)} & \multicolumn{1}{c}{(0.0801)} & \multicolumn{1}{c}{(0.0576)} & \multicolumn{1}{c}{(0.1052)} & \multicolumn{1}{c}{(0.0844)} & \multicolumn{1}{c}{(0.0590)} \\
    Children (0-5) & \multicolumn{1}{c}{-0.1143} & \multicolumn{1}{c}{-0.0376} & \multicolumn{1}{c}{0.0835} & \multicolumn{1}{c}{0.0154} & \multicolumn{1}{c}{-0.0310} & \multicolumn{1}{c}{-0.0397} \\
          & \multicolumn{1}{c}{(0.1293)} & \multicolumn{1}{c}{(0.0927)} & \multicolumn{1}{c}{(0.0825)} & \multicolumn{1}{c}{(0.1083)} & \multicolumn{1}{c}{(0.0919)} & \multicolumn{1}{c}{(0.0561)} \\
    Children (6-18) & \multicolumn{1}{c}{-0.1533*} & \multicolumn{1}{c}{-0.0320} & \multicolumn{1}{c}{0.1166**} & \multicolumn{1}{c}{-0.1228+} & \multicolumn{1}{c}{-0.0113} & \multicolumn{1}{c}{0.1015*} \\
          & \multicolumn{1}{c}{(0.0675)} & \multicolumn{1}{c}{(0.0513)} & \multicolumn{1}{c}{(0.0400)} & \multicolumn{1}{c}{(0.0652)} & \multicolumn{1}{c}{(0.0487)} & \multicolumn{1}{c}{(0.0407)} \\
    N of own sis & \multicolumn{1}{c}{-0.0388} & \multicolumn{1}{c}{-0.0311} & \multicolumn{1}{c}{0.0098} & \multicolumn{1}{c}{0.0632*} & \multicolumn{1}{c}{-0.0008} & \multicolumn{1}{c}{-0.0510**} \\
          & \multicolumn{1}{c}{(0.0281)} & \multicolumn{1}{c}{(0.0221)} & \multicolumn{1}{c}{(0.0152)} & \multicolumn{1}{c}{(0.0250)} & \multicolumn{1}{c}{(0.0208)} & \multicolumn{1}{c}{(0.0121)} \\
    N of own bro & \multicolumn{1}{c}{0.0514+} & \multicolumn{1}{c}{0.0228} & \multicolumn{1}{c}{-0.0270+} & \multicolumn{1}{c}{0.0099} & \multicolumn{1}{c}{-0.0128} & \multicolumn{1}{c}{-0.0206} \\
          & \multicolumn{1}{c}{(0.0268)} & \multicolumn{1}{c}{(0.0223)} & \multicolumn{1}{c}{(0.0138)} & \multicolumn{1}{c}{(0.0271)} & \multicolumn{1}{c}{(0.0224)} & \multicolumn{1}{c}{(0.0138)} \\
    N of spouse sis & \multicolumn{1}{c}{0.0115} & \multicolumn{1}{c}{-0.0176} & \multicolumn{1}{c}{-0.0275*} & \multicolumn{1}{c}{-0.0105} & \multicolumn{1}{c}{0.0042} & \multicolumn{1}{c}{0.0197} \\
          & \multicolumn{1}{c}{(0.0270)} & \multicolumn{1}{c}{(0.0221)} & \multicolumn{1}{c}{(0.0136)} & \multicolumn{1}{c}{(0.0277)} & \multicolumn{1}{c}{(0.0226)} & \multicolumn{1}{c}{(0.0146)} \\
    N of spouse bro & \multicolumn{1}{c}{0.0052} & \multicolumn{1}{c}{0.0026} & \multicolumn{1}{c}{0.0002} & \multicolumn{1}{c}{0.0247} & \multicolumn{1}{c}{0.0168} & \multicolumn{1}{c}{-0.0091} \\
          & \multicolumn{1}{c}{(0.0311)} & \multicolumn{1}{c}{(0.0252)} & \multicolumn{1}{c}{(0.0159)} & \multicolumn{1}{c}{(0.0292)} & \multicolumn{1}{c}{(0.0246)} & \multicolumn{1}{c}{(0.0141)} \\
    N of parents & \multicolumn{1}{c}{0.2854**} & \multicolumn{1}{c}{0.3605**} & \multicolumn{1}{c}{0.0725*} & \multicolumn{1}{c}{0.2085**} & \multicolumn{1}{c}{0.2918**} & \multicolumn{1}{c}{0.0849*} \\
          & \multicolumn{1}{c}{(0.0621)} & \multicolumn{1}{c}{(0.0469)} & \multicolumn{1}{c}{(0.0367)} & \multicolumn{1}{c}{(0.0625)} & \multicolumn{1}{c}{(0.0466)} & \multicolumn{1}{c}{(0.0367)} \\
    Mothers/parents & \multicolumn{1}{c}{0.2108+} & \multicolumn{1}{c}{0.2918**} & \multicolumn{1}{c}{0.0499} & \multicolumn{1}{c}{0.2833*} & \multicolumn{1}{c}{0.3428**} & \multicolumn{1}{c}{0.0369} \\
          & \multicolumn{1}{c}{(0.1190)} & \multicolumn{1}{c}{(0.0862)} & \multicolumn{1}{c}{(0.0772)} & \multicolumn{1}{c}{(0.1119)} & \multicolumn{1}{c}{(0.0799)} & \multicolumn{1}{c}{(0.0753)} \\
    Parents' age & \multicolumn{1}{c}{-0.0137*} & \multicolumn{1}{c}{-0.0052} & \multicolumn{1}{c}{0.0076*} & \multicolumn{1}{c}{-0.0088} & \multicolumn{1}{c}{0.0022} & \multicolumn{1}{c}{0.0096*} \\
          & \multicolumn{1}{c}{(0.0067)} & \multicolumn{1}{c}{(0.0056)} & \multicolumn{1}{c}{(0.0036)} & \multicolumn{1}{c}{(0.0068)} & \multicolumn{1}{c}{(0.0055)} & \multicolumn{1}{c}{(0.0038)} \\
    Parents' educ & \multicolumn{1}{c}{-0.0619**} & \multicolumn{1}{c}{-0.0140} & \multicolumn{1}{c}{0.0437**} & \multicolumn{1}{c}{-0.0506**} & \multicolumn{1}{c}{-0.0064} & \multicolumn{1}{c}{0.0444**} \\
          & \multicolumn{1}{c}{(0.0168)} & \multicolumn{1}{c}{(0.0139)} & \multicolumn{1}{c}{(0.0080)} & \multicolumn{1}{c}{(0.0158)} & \multicolumn{1}{c}{(0.0128)} & \multicolumn{1}{c}{(0.0083)} \\
    At least one parent &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{} &  \\
    single & \multicolumn{1}{c}{0.2178*} & \multicolumn{1}{c}{0.3229**} & \multicolumn{1}{c}{0.1104+} & \multicolumn{1}{c}{0.1486+} & \multicolumn{1}{c}{0.2837**} & \multicolumn{1}{c}{0.1480**} \\
          & \multicolumn{1}{c}{(0.0945)} & \multicolumn{1}{c}{(0.0706)} & \multicolumn{1}{c}{(0.0575)} & \multicolumn{1}{c}{(0.0873)} & \multicolumn{1}{c}{(0.0668)} & \multicolumn{1}{c}{(0.0524)} \\
    needs care & \multicolumn{1}{c}{0.0447} & \multicolumn{1}{c}{-0.0174} & \multicolumn{1}{c}{-0.0586} & \multicolumn{1}{c}{0.0251} & \multicolumn{1}{c}{0.0068} & \multicolumn{1}{c}{-0.0297} \\
          & \multicolumn{1}{c}{(0.0892)} & \multicolumn{1}{c}{(0.0735)} & \multicolumn{1}{c}{(0.0459)} & \multicolumn{1}{c}{(0.0857)} & \multicolumn{1}{c}{(0.0694)} & \multicolumn{1}{c}{(0.0466)} \\
    cannot be & \multicolumn{1}{c}{0.0740} & \multicolumn{1}{c}{0.1054} & \multicolumn{1}{c}{0.0193} & \multicolumn{1}{c}{-0.0068} & \multicolumn{1}{c}{-0.0029} & \multicolumn{1}{c}{0.0188} \\
    left alone & \multicolumn{1}{c}{(0.0981)} & \multicolumn{1}{c}{(0.0797)} & \multicolumn{1}{c}{(0.0511)} & \multicolumn{1}{c}{(0.0913)} & \multicolumn{1}{c}{(0.0733)} & \multicolumn{1}{c}{(0.0499)} \\
    homeowner & \multicolumn{1}{c}{-0.0436} & \multicolumn{1}{c}{0.0117} & \multicolumn{1}{c}{0.0492} & \multicolumn{1}{c}{0.0185} & \multicolumn{1}{c}{0.0415} & \multicolumn{1}{c}{0.0276} \\
          & \multicolumn{1}{c}{(0.0957)} & \multicolumn{1}{c}{(0.0814)} & \multicolumn{1}{c}{(0.0448)} & \multicolumn{1}{c}{(0.0897)} & \multicolumn{1}{c}{(0.0745)} & \multicolumn{1}{c}{(0.0461)} \\
    poorer & \multicolumn{1}{c}{0.8224**} & \multicolumn{1}{c}{0.7197**} & \multicolumn{1}{c}{-0.1096*} & \multicolumn{1}{c}{0.8435**} & \multicolumn{1}{c}{0.6969**} & \multicolumn{1}{c}{-0.1552**} \\
          & \multicolumn{1}{c}{(0.0828)} & \multicolumn{1}{c}{(0.0671)} & \multicolumn{1}{c}{(0.0434)} & \multicolumn{1}{c}{(0.0798)} & \multicolumn{1}{c}{(0.0668)} & \multicolumn{1}{c}{(0.0397)} \\
    richer & \multicolumn{1}{c}{-0.9860**} & \multicolumn{1}{c}{-0.4509**} & \multicolumn{1}{c}{0.5021**} & \multicolumn{1}{c}{-1.0081**} & \multicolumn{1}{c}{-0.4896**} & \multicolumn{1}{c}{0.4862**} \\
          & \multicolumn{1}{c}{(0.0851)} & \multicolumn{1}{c}{(0.0636)} & \multicolumn{1}{c}{(0.0525)} & \multicolumn{1}{c}{(0.0805)} & \multicolumn{1}{c}{(0.0590)} & \multicolumn{1}{c}{(0.0495)} \\
\hline
    Observations & \multicolumn{1}{c}{11,387} & \multicolumn{1}{c}{11,387} & \multicolumn{1}{c}{11,387} & \multicolumn{1}{c}{13,275} & \multicolumn{1}{c}{13,275} & \multicolumn{1}{c}{13,275} \\
    R-squared & \multicolumn{1}{c}{0.0956} & \multicolumn{1}{c}{0.0875} & \multicolumn{1}{c}{0.0570} & \multicolumn{1}{c}{0.0929} & \multicolumn{1}{c}{0.0819} & \multicolumn{1}{c}{0.0555} \\
\hline
\hline
\end{small}
\label{tab:OLSresults}
\end{longtable}

\end{document}
share|improve this question
1  
Welcome to TeX.SX! Would you be able to reduce your code to a minimal working example (MWE) and describe a little bit more precisely which errors you get? It would make it easier for people to help you. –  Corentin Feb 7 at 18:52
    
Not sure you really need to use multicolumn in every data cell. If I were you, I would start from a minimal table and added elements 1 by 1. This is how you work in Latex - by small increments, baby steps. Do you really expect someone inspecting your large MWE with repeated similar elements, looking for a bug somewhere? –  ajeh Feb 7 at 18:59

3 Answers 3

First... an advise keep it simple! if you are adding a single value, don't use \multicolumn.

\documentclass[11pt, draft, titlepage]{article}
\setlength{\oddsidemargin}{0.05in}
\setlength{\evensidemargin}{0.04in} \setlength{\textwidth}{6.6 in}
\setlength{\textheight}{600pt} \setlength{\topmargin}{0 in}
\setlength{\headheight}{0 in}
\setlength{\parindent}{0.5 cm}
\usepackage{array}
\usepackage{longtable}


\begin{document}




\begin{longtable}{|c|c|c|c|c|c|c|}
  \hline
  & \multicolumn{3}{c|}{Males} & \multicolumn{3}{c|}{Females} \\
  \hline
  & {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} \\
  & {OLS-NGive} & {OLS-GGive} & {OLS-GRec} & {OLS-NGive} & {OLS-GGive} & {OLS-GRec} \\
  \hline
  \endfirsthead
  \hline
  & \multicolumn{3}{c|}{Males} & \multicolumn{3}{c|}{Females} \\
  \hline
  & {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} \\
  & {OLS-NGive} & {OLS-GGive} & {OLS-GRec} & {OLS-NGive} & {OLS-GGive} & {OLS-GRec} \\
  \hline
  \endhead
  \hline \multicolumn{7}{r}{(Continued on next page)} \\ 
  \endfoot    
  \hline 
  \endlastfoot
  Log wage & {0.2754**} & {0.1301*} & {-0.1309**} & {0.3629**} & {0.2700**} & {-0.0815+} \\
  & {(0.0814)} & {(0.0613)} & {(0.0494)} & {(0.0803)} & {(0.0625)} & {(0.0473)} \\
    Age   & {0.0128} & {0.0589} & {0.0432} & {0.0879} & {0.0226} & {-0.0691} \\
    & {(0.0880)} & {(0.0740)} & {(0.0473)} & {(0.0812)} & {(0.0600)} & {(0.0520)} \\
    Age sq & {0.0001} & {-0.0004} & {-0.0005} & {-0.0007} & {-0.0002} & {0.0005} \\
    & {(0.0008)} & {(0.0006)} & {(0.0004)} & {(0.0007)} & {(0.0005)} & {(0.0005)} \\
    Educ  & {0.0174} & {-0.0721} & {-0.1064**} & {-0.1381} & {-0.2056*} & {-0.0770**} \\
    & {(0.0609)} & {(0.0543)} & {(0.0245)} & {(0.0902)} & {(0.0848)} & {(0.0258)} \\
    Educ sq & {0.0003} & {0.0051*} & {0.0055**} & {0.0051} & {0.0095**} & {0.0047**} \\
    & {(0.0026)} & {(0.0022)} & {(0.0013)} & {(0.0036)} & {(0.0032)} & {(0.0013)} \\
    Non-labor inc & {0.0027*} & {0.0024*} & {-0.0003} & {0.0010} & {0.0013+} & {0.0002} \\
    & {(0.0012)} & {(0.0010)} & {(0.0005)} & {(0.0008)} & {(0.0007)} & {(0.0004)} \\
    HH wealth & {0.0079} & {0.0160*} & {0.0077} & {0.0022} & {0.0004} & {-0.0012} \\
    & {(0.0093)} & {(0.0068)} & {(0.0050)} & {(0.0043)} & {(0.0038)} & {(0.0019)} \\
    Nwhite & {0.9998**} & {0.7522**} & {-0.2394**} & {0.6197**} & {0.4897**} & {-0.1332*} \\
    & {(0.1271)} & {(0.1149)} & {(0.0470)} & {(0.1142)} & {(0.0968)} & {(0.0572)} \\
    Hisp  & {0.6440**} & {0.4753**} & {-0.1572**} & {0.6450**} & {0.6302**} & {-0.0371} \\
    & {(0.1728)} & {(0.1607)} & {(0.0559)} & {(0.1904)} & {(0.1719)} & {(0.0701)} \\
    Married & {-0.3104*} & {-0.3796**} & {-0.0801} & {0.2232*} & {-0.0784} & {-0.3247**} \\
    & {(0.1472)} & {(0.1296)} & {(0.0853)} & {(0.1107)} & {(0.0858)} & {(0.0662)} \\
    Poor health & {-0.0069} & {0.0406} & {0.0520} & {-0.0710} & {0.0845} & {0.1645**} \\
    & {(0.1004)} & {(0.0801)} & {(0.0576)} & {(0.1052)} & {(0.0844)} & {(0.0590)} \\
    Children (0-5) & {-0.1143} & {-0.0376} & {0.0835} & {0.0154} & {-0.0310} & {-0.0397} \\
    & {(0.1293)} & {(0.0927)} & {(0.0825)} & {(0.1083)} & {(0.0919)} & {(0.0561)} \\
    Children (6-18) & {-0.1533*} & {-0.0320} & {0.1166**} & {-0.1228+} & {-0.0113} & {0.1015*} \\
    & {(0.0675)} & {(0.0513)} & {(0.0400)} & {(0.0652)} & {(0.0487)} & {(0.0407)} \\
    N of own sis & {-0.0388} & {-0.0311} & {0.0098} & {0.0632*} & {-0.0008} & {-0.0510**} \\
    & {(0.0281)} & {(0.0221)} & {(0.0152)} & {(0.0250)} & {(0.0208)} & {(0.0121)} \\
    N of own bro & {0.0514+} & {0.0228} & {-0.0270+} & {0.0099} & {-0.0128} & {-0.0206} \\
    & {(0.0268)} & {(0.0223)} & {(0.0138)} & {(0.0271)} & {(0.0224)} & {(0.0138)} \\
    N of spouse sis & {0.0115} & {-0.0176} & {-0.0275*} & {-0.0105} & {0.0042} & {0.0197} \\
    & {(0.0270)} & {(0.0221)} & {(0.0136)} & {(0.0277)} & {(0.0226)} & {(0.0146)} \\
    N of spouse bro & {0.0052} & {0.0026} & {0.0002} & {0.0247} & {0.0168} & {-0.0091} \\
    & {(0.0311)} & {(0.0252)} & {(0.0159)} & {(0.0292)} & {(0.0246)} & {(0.0141)} \\
    N of parents & {0.2854**} & {0.3605**} & {0.0725*} & {0.2085**} & {0.2918**} & {0.0849*} \\
    & {(0.0621)} & {(0.0469)} & {(0.0367)} & {(0.0625)} & {(0.0466)} & {(0.0367)} \\
    Mothers/parents & {0.2108+} & {0.2918**} & {0.0499} & {0.2833*} & {0.3428**} & {0.0369} \\
    & {(0.1190)} & {(0.0862)} & {(0.0772)} & {(0.1119)} & {(0.0799)} & {(0.0753)} \\
    Parents' age & {-0.0137*} & {-0.0052} & {0.0076*} & {-0.0088} & {0.0022} & {0.0096*} \\
    & {(0.0067)} & {(0.0056)} & {(0.0036)} & {(0.0068)} & {(0.0055)} & {(0.0038)} \\
    Parents' educ & {-0.0619**} & {-0.0140} & {0.0437**} & {-0.0506**} & {-0.0064} & {0.0444**} \\
    & {(0.0168)} & {(0.0139)} & {(0.0080)} & {(0.0158)} & {(0.0128)} & {(0.0083)} \\
    At least one parent &       & {} &       &       & {} &  \\
    single & {0.2178*} & {0.3229**} & {0.1104+} & {0.1486+} & {0.2837**} & {0.1480**} \\
    & {(0.0945)} & {(0.0706)} & {(0.0575)} & {(0.0873)} & {(0.0668)} & {(0.0524)} \\
    needs care & {0.0447} & {-0.0174} & {-0.0586} & {0.0251} & {0.0068} & {-0.0297} \\
    & {(0.0892)} & {(0.0735)} & {(0.0459)} & {(0.0857)} & {(0.0694)} & {(0.0466)} \\
    cannot be & {0.0740} & {0.1054} & {0.0193} & {-0.0068} & {-0.0029} & {0.0188} \\
    left alone & {(0.0981)} & {(0.0797)} & {(0.0511)} & {(0.0913)} & {(0.0733)} & {(0.0499)} \\
    homeowner & {-0.0436} & {0.0117} & {0.0492} & {0.0185} & {0.0415} & {0.0276} \\
    & {(0.0957)} & {(0.0814)} & {(0.0448)} & {(0.0897)} & {(0.0745)} & {(0.0461)} \\
    poorer & {0.8224**} & {0.7197**} & {-0.1096*} & {0.8435**} & {0.6969**} & {-0.1552**} \\
    & {(0.0828)} & {(0.0671)} & {(0.0434)} & {(0.0798)} & {(0.0668)} & {(0.0397)} \\
    richer & {-0.9860**} & {-0.4509**} & {0.5021**} & {-1.0081**} & {-0.4896**} & {0.4862**} \\
    & {(0.0851)} & {(0.0636)} & {(0.0525)} & {(0.0805)} & {(0.0590)} & {(0.0495)} \\
    \hline
    Observations & {11,387} & {11,387} & {11,387} & {13,275} & {13,275} & {13,275} \\
    R-squared & {0.0956} & {0.0875} & {0.0570} & {0.0929} & {0.0819} & {0.0555}\\
\end{longtable}

\end{document}

I removed the spurious \multicolumn{1}{#}{ } and some packages which do not contribute with the example... and your code works almost completely!

enter image description here

Cheers!

share|improve this answer

From the errors I received, you should:
(1) Add to the preamble

\usepackage{longtable}

(2) Move the small environment outside the longtable:

\begin{small}
\begin{longtable}{...}
...
\end{longtable}
\end{small}

(3) Follow the caption with \\ (and cancel the small with \normalsize):

\caption{{\normalsize Results from OLS Estimation}}\\

That's pretty much all that is needed. However, the code becomes much more readable if you make the most common cell format the default:

\begin{longtable}{c|c|c|c|c|c|c}

and then omit every \multicolumn{1}{c}.

share|improve this answer
    
Dear Dan,thank you very much for your suggestions. –  Lena Feb 10 at 10:46

In addition to moving the \small instruction outside the \longtable environment and not overusing the \multicolumn{1}{c}{...} instruction, you should consider using (i) the dcolumn package to align the columns of numeric data on the respective decimal markers and (ii) the booktabs package to produce better-looking horizontal lines in the table's header and footer zones. Once you start using the rule-drawing commands of this package, you'll never need to use vertical rules in a table again. :-)

enter image description here

enter image description here

\documentclass[11pt]{article}
\usepackage{longtable,dcolumn,booktabs}
\usepackage[hmargin=1in]{geometry} % choose page margins as needed for your document
\newcolumntype{d}{D..{2.6}}        % column type: decimal-aligned
\newcommand{\mcc}[1]{\multicolumn{1}{c}{#1}} % shortcut command

\begin{document}
{\small % \small is a switch, not an environment
\begin{longtable}{@{}l *{6}{d} @{}}
\caption{Results from OLS Estimation} \label{tab:OLSresults}\\

\toprule
& \multicolumn{3}{c}{Males} & \multicolumn{3}{c@{}}{Females} \\
\cmidrule(lr){2-4} \cmidrule(l){5-7}
& \mcc{(1)} & \mcc{(2)} & \mcc{(3)} & \mcc{(4)} & \mcc{(5)} & \multicolumn{1}{c@{}}{(6)} \\
& \mcc{OLS-NGive} & \mcc{OLS-GGive} & \mcc{OLS-GRec} & \mcc{OLS-NGive} & \mcc{OLS-GGive} & \multicolumn{1}{c@{}}{OLS-GRec} \\
\midrule
\endfirsthead

\multicolumn{7}{@{}l@{}}{\tablename\ \thetable\ -- Continued} \\ 
\toprule
& \multicolumn{3}{c}{Males} & \multicolumn{3}{c@{}}{Females} \\
\cmidrule(lr){2-4} \cmidrule(l){5-7}
& \mcc{(1)} & \mcc{(2)} & \mcc{(3)} & \mcc{(4)} & \mcc{(5)} & \multicolumn{1}{c@{}}{(6)} \\
& \mcc{OLS-NGive} & \mcc{OLS-GGive} & \mcc{OLS-GRec} & \mcc{OLS-NGive} & \mcc{OLS-GGive} & \multicolumn{1}{c@{}}{OLS-GRec} \\
\midrule
\endhead

\midrule[\heavyrulewidth]
\multicolumn{7}{r@{}}{Continued on next page} \\ 
\endfoot

\bottomrule
\endlastfoot

Log wage & 0.2754** & 0.1301* & -0.1309** & 0.3629** & 0.2700** & -0.0815+ \\
          & (0.0814) & (0.0613) & (0.0494) & (0.0803) & (0.0625) & (0.0473) \\
Age   & 0.0128 & 0.0589 & 0.0432 & 0.0879 & 0.0226 & -0.0691 \\
          & (0.0880) & (0.0740) & (0.0473) & (0.0812) & (0.0600) & (0.0520) \\
Age sq & 0.0001 & -0.0004 & -0.0005 & -0.0007 & -0.0002 & 0.0005 \\
          & (0.0008) & (0.0006) & (0.0004) & (0.0007) & (0.0005) & (0.0005) \\
Educ  & 0.0174 & -0.0721 & -0.1064** & -0.1381 & -0.2056* & -0.0770** \\
          & (0.0609) & (0.0543) & (0.0245) & (0.0902) & (0.0848) & (0.0258) \\
Educ sq & 0.0003 & 0.0051* & 0.0055** & 0.0051 & 0.0095** & 0.0047** \\
          & (0.0026) & (0.0022) & (0.0013) & (0.0036) & (0.0032) & (0.0013) \\
Non-labor inc & 0.0027* & 0.0024* & -0.0003 & 0.0010 & 0.0013+ & 0.0002 \\
          & (0.0012) & (0.0010) & (0.0005) & (0.0008) & (0.0007) & (0.0004) \\
HH wealth & 0.0079 & 0.0160* & 0.0077 & 0.0022 & 0.0004 & -0.0012 \\
          & (0.0093) & (0.0068) & (0.0050) & (0.0043) & (0.0038) & (0.0019) \\
Nwhite & 0.9998** & 0.7522** & -0.2394** & 0.6197** & 0.4897** & -0.1332* \\
          & (0.1271) & (0.1149) & (0.0470) & (0.1142) & (0.0968) & (0.0572) \\
Hisp  & 0.6440** & 0.4753** & -0.1572** & 0.6450** & 0.6302** & -0.0371 \\
          & (0.1728) & (0.1607) & (0.0559) & (0.1904) & (0.1719) & (0.0701) \\
Married & -0.3104* & -0.3796** & -0.0801 & 0.2232* & -0.0784 & -0.3247** \\
          & (0.1472) & (0.1296) & (0.0853) & (0.1107) & (0.0858) & (0.0662) \\
Poor health & -0.0069 & 0.0406 & 0.0520 & -0.0710 & 0.0845 & 0.1645** \\
          & (0.1004) & (0.0801) & (0.0576) & (0.1052) & (0.0844) & (0.0590) \\
Children (0--5) & -0.1143 & -0.0376 & 0.0835 & 0.0154 & -0.0310 & -0.0397 \\
          & (0.1293) & (0.0927) & (0.0825) & (0.1083) & (0.0919) & (0.0561) \\
Children (6--18) & -0.1533* & -0.0320 & 0.1166** & -0.1228+ & -0.0113 & 0.1015* \\
          & (0.0675) & (0.0513) & (0.0400) & (0.0652) & (0.0487) & (0.0407) \\
N of own sis & -0.0388 & -0.0311 & 0.0098 & 0.0632* & -0.0008 & -0.0510** \\
          & (0.0281) & (0.0221) & (0.0152) & (0.0250) & (0.0208) & (0.0121) \\
N of own bro & 0.0514+ & 0.0228 & -0.0270+ & 0.0099 & -0.0128 & -0.0206 \\
          & (0.0268) & (0.0223) & (0.0138) & (0.0271) & (0.0224) & (0.0138) \\
N of spouse sis & 0.0115 & -0.0176 & -0.0275* & -0.0105 & 0.0042 & 0.0197 \\
          & (0.0270) & (0.0221) & (0.0136) & (0.0277) & (0.0226) & (0.0146) \\
N of spouse bro & 0.0052 & 0.0026 & 0.0002 & 0.0247 & 0.0168 & -0.0091 \\
          & (0.0311) & (0.0252) & (0.0159) & (0.0292) & (0.0246) & (0.0141) \\
N of parents & 0.2854** & 0.3605** & 0.0725* & 0.2085** & 0.2918** & 0.0849* \\
          & (0.0621) & (0.0469) & (0.0367) & (0.0625) & (0.0466) & (0.0367) \\
Mothers/parents & 0.2108+ & 0.2918** & 0.0499 & 0.2833* & 0.3428** & 0.0369 \\
          & (0.1190) & (0.0862) & (0.0772) & (0.1119) & (0.0799) & (0.0753) \\
Parents' age & -0.0137* & -0.0052 & 0.0076* & -0.0088 & 0.0022 & 0.0096* \\
          & (0.0067) & (0.0056) & (0.0036) & (0.0068) & (0.0055) & (0.0038) \\
Parents' educ & -0.0619** & -0.0140 & 0.0437** & -0.0506** & -0.0064 & 0.0444** \\
          & (0.0168) & (0.0139) & (0.0080) & (0.0158) & (0.0128) & (0.0083) \\
At least one parent   & 0.2178* & 0.3229** & 0.1104+ & 0.1486+ & 0.2837** & 0.1480** \\
\ \ \ single  & (0.0945) & (0.0706) & (0.0575) & (0.0873) & (0.0668) & (0.0524) \\
Needs care & 0.0447 & -0.0174 & -0.0586 & 0.0251 & 0.0068 & -0.0297 \\
          & (0.0892) & (0.0735) & (0.0459) & (0.0857) & (0.0694) & (0.0466) \\
Cannot be & 0.0740 & 0.1054 & 0.0193 & -0.0068 & -0.0029 & 0.0188 \\
\ \ \ left alone & (0.0981) & (0.0797) & (0.0511) & (0.0913) & (0.0733) & (0.0499) \\
Homeowner & -0.0436 & 0.0117 & 0.0492 & 0.0185 & 0.0415 & 0.0276 \\
          & (0.0957) & (0.0814) & (0.0448) & (0.0897) & (0.0745) & (0.0461) \\
Poorer & 0.8224** & 0.7197** & -0.1096* & 0.8435** & 0.6969** & -0.1552** \\
          & (0.0828) & (0.0671) & (0.0434) & (0.0798) & (0.0668) & (0.0397) \\
Richer & -0.9860** & -0.4509** & 0.5021** & -1.0081** & -0.4896** & 0.4862** \\
          & (0.0851) & (0.0636) & (0.0525) & (0.0805) & (0.0590) & (0.0495) \\
\midrule
Observations & \mcc{11,387} & \mcc{11,387} & \mcc{11,387} & \mcc{13,275} & \mcc{13,275} & \multicolumn{1}{c@{}}{13,275} \\
R-squared & 0.0956 & 0.0875 & 0.0570 & 0.0929 & 0.0819 & 0.0555 \\
\end{longtable}
} % end of scope of \small instruction
\end{document}
share|improve this answer
    
Dear Mico, thank you very much. All the answers were really helpful. And I now have it working. I see the point in making the table simpler. My problem with this is that to create it I have used excel2latex macro, and the resulting massive use of multicolumn is from there. For me it is really crucial to get the process as automatic as possible because I often need to redo the tables many times before the publication. I guess I would have to look for a different way of transferring results from STATA to Latex. If you have a suggestion, I would really appreciate this. –  Lena Feb 10 at 10:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.