Announcement

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

  • Issue with -@span- in -estout-

    Hi everyone,

    I am trying to create a table in LaTeX using -estout- to export my results. In the following example, there is no problem:

    Code:
    sysuse auto
    eststo: quietly reg price weight if foreign==0
    eststo: quietly reg price weight mpg if foreign==0
    eststo: quietly reg price weight if foreign==1
    eststo: quietly reg price weight mpg if foreign==1
    estout using "example.tex", ///
    cells(b(star) t(par)) stats(r2 N) ///
    prehead("\begin{tabular}{lc*{@M}{c}}" "\hline\hline") posthead(\hline) prefoot(\hline) postfoot(\hline\hline) ///
    mgroups("Domestic" "Foreign", pattern(1 0 1 0) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) ///
    style(tex) label nolegend collabels(none) mlabel(none) numbers eqlabels(none) varlabels(_cons Constant) starlevels(* 0.10 ** 0.05 *** 0.01) replace
    eststo clear
    Now, I add a hypothesis column to the table, but -@span- does not understand there is an extra column that has been added, and consequently the line segments below the header are one column off. Is there a way to make -@span- increase by one, so that I do not have to manually change -erepeat(\cmidrule(lr){@span})-?

    Code:
    sysuse auto
    eststo: quietly reg price weight if foreign==0
    eststo: quietly reg price weight mpg if foreign==0
    eststo: quietly reg price weight if foreign==1
    eststo: quietly reg price weight mpg if foreign==1
    estout using "example.tex", ///
    cells(b(star) t(par)) stats(r2 N) ///
    prehead("\begin{tabular}{lc*{@M}{c}}" "\hline\hline") posthead(\hline) prefoot(\hline) postfoot(\hline\hline) ///
    mgroups("Domestic" "Foreign", pattern(1 0 1 0) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) ///
    style(tex) label nolegend collabels(none) mlabel(none) numbers eqlabels(none) varlabels(_cons Constant) starlevels(* 0.10 ** 0.05 *** 0.01) replace ///
    labcol(+ +, title("" Hyp.))
    eststo clear
    In LaTeX, I am using:

    Code:
    \documentclass{article}
    \usepackage{booktabs}
    \begin{document}
    \input{example}
    \end{tabular}
    \end{document}
    Any idea is appreciated. Thanks,

    Albert
    Last edited by Albert Sfredo; 09 Jul 2016, 12:34.

  • #2
    I think this constitutes a bug. I've reported it at the GitHub repository.

    Comment


    • #3
      Nils,

      Thank you for trying to disseminate the issue further and hopefully reaching someone that can help me. I'll keep an eye on the GitHub website too. Thanks,

      Albert

      Comment


      • #4
        Ben Jann fixed this issue in estout 3.21.

        Comment


        • #5
          Nils, I apologize for the late reply.

          By the time, I ended up doing some work around it, but it is working perfectly now. Thank you, and Ben for updating the code.

          Albert

          Comment

          Working...
          X