Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Stata to LaTeX

  • 20-11-2009 2:39pm
    #1
    Closed Accounts Posts: 6,609 ✭✭✭


    Any templates for creating tables dsiplaying regression results? There seems to be a standard and I would like to follow it.


Comments

  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Outtex or EST2TEX will do, but outtex > est2tex imho.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Outtex or EST2TEX will do, but outtex > est2tex imho.

    Ok, I'm not a techie (though not clueless either), so I will require a bit of assistance here. I believe that this is something that I must install into Stata? Or is it?

    :confused:

    Ok, just to update. I made outtex.ado with the code I copied into notepad, and placed it into Stata9\ado\update\o. When I try to run outtex I get:
    outtex
    unexpected end of file
    (error occurred while loading outtex.ado)
    r(612);


    [P] error . . . . . . . . . . . . . . . . . . . . . . . . Return code 612
    unexpected end of file;
    You used infile with a dictionary, and the file containing the
    dictionary ended before the `}' character. Perhaps you forgot
    to type the closing brace, or perhaps you are missing a hard
    return at the end of your file. You may also get this message
    if you issued the command #delimit ; in a do-file and then
    subsequently forgot to use `;' before the `end' statement.


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Yes. You should have been taught this in your tutorials, to be fair.

    In Stata, enter ssc inst outtex, which will install it. Open your data, run your regression, then use the commands listed in the PDF to get the correct output. The output is TeX code so you can copy and paste it straight into your text editor.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    I believe I missed that tutorial. ;)

    Thanks for your help.


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Ok, just to update. I made outtex.ado with the code I copied into notepad, and placed it into Stata9\ado\update\o.
    No need to go to all that trouble, just get Stata to install it directly.
    When I try to run outtex I get:
    You need to run outtex immediately after running a regression. Also it's not just a case of entering the command outtex, you need to specify some parameters as well.
    I believe I missed that tutorial. ;)
    Waster :pac:


  • Advertisement
  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Yeah, the install command worked. In fact, the ADO file I placed in the folder stopped it from running even after I followed your instructions, so its best if people just avoid everything I did.

    :)


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Good god, it's so pretty.

    :)


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Good lord! Getting text to go where you want it is difficult, isn't it? Subsections seem to wander around also. I have been using outtex, and I haven't changed the output one bit, but when I try to arrange the tables under different sections and add some text underneath (or before) it just migrates. In addition, I can't use pagebreaks.


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Good lord! Getting text to go where you want it is difficult, isn't it?
    Stop trying to get it to go where you want it to! Just leave it be, stop micro-managing, honestly!
    Subsections seem to wander around also.
    Are you using \subsection{Mary Had a Little Lamb} command? If so, by "wandering around" do you mean the alignment within a page or do you mean jumping several pages? If it's the former, it's not a problem. If it's the latter, you're doing something wrong.
    I have been using outtex, and I haven't changed the output one bit, but when I try to arrange the tables under different sections and add some text underneath (or before) it just migrates.
    That's LaTeX being clever and it's not a problem. See the outtex output that begins with \begin{table}[htbp]\centering? Lob on a \label{little_lamb} after that line (and be sure there isn't another label in there). Now, instead of writing "As the results below show...", run with "As the results in Table \ref{little_lamb} show..." Done. Don't worry about whether it's above, below, behind, on top or even rooted in the anus of where you want it to be. Stop worrying about that sort of thing, that's one of the best things about LaTeX.
    In addition, I can't use pagebreaks.
    You shouldn't be going near them. Honestly, really, sincerely, just let LaTeX do its thing. Knuth knows best. Beyond that, if you really don't trust the prettiness of the package, the command \newpage is pretty foolproof.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Ok, I will try that out. But seriously, this isn't a case of me wanting too much control. For example, I want output like:
    Section 3

    Blah, blah, blah:

    "TABLE1"

    Natter, natter, natter.

    Subsection 3.1

    Blah, blah:

    "TABLE2"

    Natter, natter.

    But what I am getting is:
    Section 3

    Blah, blah, blah:

    "TABLE1"

    Subsection 3.1

    Natter, natter, natter (meant to be in above section).

    Blah, blah:

    "TABLE2"

    Natter, natter.

    So, while I don't mind the text moving around the tables so much (as you said, I can just make reference to each table), I do mind not being able to put relevant text in their relevant sections, and the same with tables. Perhaps I should just have a single section for tables and keep the text completely seperate.


  • Advertisement
  • Technology & Internet Moderators Posts: 28,811 Mod ✭✭✭✭oscarBravo


    ...I do mind not being able to put relevant text in their relevant sections...
    Yeah, I'd mind that too :)

    Can you share some of the LaTeX source so we can try to figure out why it's doing that? I've never seen LaTeX do that.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    I will dig it out.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Ok, since I am at college I had to start using that USBTeX thing I posted in resources. Anyway, it seems to have fixed the problem.


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Ok, since I am at college I had to start using that USBTeX thing I posted in resources. Anyway, it seems to have fixed the problem.

    Like oB, never heard of TeX being that stupid before so I blame USBTeX :). I've never had any problems with this online compiler if you need to compile from a college PC.


Advertisement