Announcement

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

  • In Stata, how to transfer matrix to LaTeX table?

    I have a matrix, which contains all the numbers I want. Now I need to design a table in LaTeX and use these numbers. In other words, I will edit table headers and so on in LaTeX, but the inside numbers are from Stata.

  • #2
    The community-contributed estout package (from the Stata Journal or SSC) can do that.

    Comment


    • #3
      Cross-posted at https://stackoverflow.com/questions/...to-latex-table

      Please note our policy on cross-posting, which is that you are asked to tell us about it.

      Comment


      • #4
        Hi Wouter, estpost is my first choice but I after I google,

        I think estpost ttest supports only the "Two-sample t test using groups", and hence the required option by(groupvar). It is not in my case. So I don't know how I should do.

        Comment


        • #5
          Hi Nick, I see. I don't know such a policy. I'm sorry. I'm in a rush to figure it out and got zero response here. Thus, I was trying to post outside.

          Comment


          • #6
            https://www.statalist.org/forums/help#crossposting explains. (The question on SO is now closed in any case.)

            Comment


            • #7
              You say in #1 that you already constructed a matrix which you want to export to latex. So this should do it:
              Code:
              esttab matrix(matname) using myfile, latex
              Or you can use estout instead of esttab for more flexibility.

              Comment


              • #8
                Hi Nick, thanks. Now I understand the rule.

                Comment


                • #9
                  Hi Wouter, -estout matrix(matname)- can do it. Thank you!

                  Comment


                  • #10
                    Both estout and esttab can transfer matrix to LaTeX. Which one should I use?

                    Comment


                    • #11
                      Using esttab gets you a nicely formatted table with minimal amount of coding. Estout usually requires more coding to get what you want but is more flexible. So it is essentially a trade-off between the flexibility of estout vs. the ease of use of esttab.

                      Comment


                      • #12
                        Very clear answer. Thank you so much!

                        Comment

                        Working...
                        X