Graphics, Figures & Tables ⇒ Table from Stata
-
- Posts: 1
- Joined: Wed May 03, 2023 10:40 am
Table from Stata
I am running some regressions in Stata and use esttab to output the results into a Latex table.
I attach here the table that I get. But when I include that table into my tex document I get the following error:
table/mutual_fund_regression.tex
! Package array Error: Illegal pream-token (D): `c' used.
See the array package documentation for explanation.
Type H <return> for immediate help.
...
l.3 \begin{tabular}{l*{2}{D{.}{.}{-1}}}
?
Any ideas what the problem is here and how it can be fixed?
Many thanks in advance
Costas Antoniou
- Attachments
-
- mutual_fund_regression.tex
- (1.07 KiB) Downloaded 142 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Table from Stata
welcome to the forum!
The problem in this line
\begin{tabular}{l*{2}{D{.}{.}{-1}}}
is, that the D column type is not defined.You can write, for example,
\begin{tabular}{l*{2}{c}}
instead.Stefan
Table from Stata
\usepackage{dcolumn}
to your preamble, then a "D" column is specified 
KR
Rainer
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Table from Stata
Code: Select all
\documentclass{article}\usepackage{booktabs,dcolumn}\begin{document}{\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}\begin{tabular}{l*{2}{D{.}{.}{-1}}}\hline\hline&\multicolumn{2}{c}{Proportion Sold} \\\cmidrule(lr){2-3}&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} \\\hlineretpos & 0.032\sym{***}& \\& (0.010) & \\[1em]retneg & 0.033\sym{**} & \\& (0.016) & \\[1em]absret & & 0.009 \\& & (0.010) \\\hlineObservations & 1872832.000 & 1872832.000 \\$R^2$ & 0.300 & 0.300 \\Fund $\times$ Date F.E& F.E. "Yes" & F.E. "Yes" \\Stock $\times$ year F.E.& F.E. "Yes" & F.E. "Yes" \\Stock $\times$ date F.E.& F.E. "No" & \\\hline\hline\end{tabular}}\end{document}
\multicolumn
at such cells, like\multicolumn{1}{c}{F.E. "Yes"}
.Stefan