Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • stata regression results into Latex

    Hello Stata Community,

    I am running some regressions and want to output the table into latex. I am using the table below:

    esttab using "mutual_fund_regression.tex", replace ///
    b(3) se(3) ///
    keep(retpos retneg absret) ///
    star(* 0.10 ** 0.05 *** 0.01) ///
    label noobs nonotes nomtitle collabels(none) mgroups("Proportion Sold" "Proportion Bought", pattern(1 0 1 0 1 0) ///
    prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) alignment(D{.}{.}{-1}) ///
    stats(N r2 Fundxdate Stockxyear Stockxdate, label ("Observations" "\$R^2$" "Fund $\times$ Date F.E" "Stock $\times$ year F.E." "Stock $\times$ date F.E.")) sfmt(0)

    I attach here the table that I get. But when i include that tabe 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
    Attached Files

  • #2
    Hello again. I have found that the issue is with alignment(D{.}{.}{-1}). When i delete this, the Latex table works and has the expected c and not D.

    Comment


    • #3
      \usepackage{dcolumn} also fixes the problem.

      Comment

      Working...
      X