Saturday, August 24, 2013

Exporting Results of Linear Regression with Robust Standard Errors


12 comments:

  1. Isn't it dangerous to write,
    ifelse(temp < 75, rnorm(500, mean = 0, sd = 25), ifelse(temp > 95, rnorm(500, mean = 0, sd = 25), rnorm(500, mean = 0, sd = 8)))

    ReplyDelete
    Replies
    1. Yeah you're right, that was a little weird. I changed it, thanks.

      Delete
  2. I assume you made this post in knitr. I am trying to convert a knitr html to blogger post but am having trouble with the latex to display. Any advice?

    ReplyDelete
    Replies
    1. Yeah well I do it in this very hacky way where I just save the html file in a public folder and then I refer to it in an iframe statement. Not great, if you find a better way, let me know.

      Delete
  3. Very cool. I've used outreg (part of the rockchalk package) for output in the past. Have you used it and have any opinions on how it compares to stargazer?
    One frustrating thing about our field is that although LaTex is clearly superior in lots of ways for article formatting, many of the journals just want you to submit everything in Word. Stata has a really great package, xml_tab, to output nicely formatted tables to an Excel file which are then easy to paste into Word. I wonder if there's anything similar for R?

    ReplyDelete
    Replies
    1. I haven't used outreg, I'll take a look. I agree about the word/latex journal situation. With stargazer you can export as ASCII text, which you can cut and paste into word or paste into excel and then fix the formatting on it which adds an extra step. I don't know of any direct way to export to excel.

      There are a bunch of programs that convert from pdf to word. Pandoc is one program that I will test out soon - I'll let you know if the results are good.
      http://johnmacfarlane.net/pandoc/demos.html

      Delete
  4. In addition to the options you suggested another useful library on the latex side for tables is pgfplotstable. I tend to run similar analyses where I have preformatted the latex document's table. With pgfplotstable I can directly pull in a text file generated in R and have it format itself, so no copy and pasting. Its really handy if I adjust things, all I have to do is tell latex to rebuild the document and the table is done for me.

    ReplyDelete
  5. Hi, thanks for the post. I have a problem. If I save the output type="latex" and out ="test.tex" than the output includes automatically \documentclass{article} and begin{document} into the file. Therefore I cannot use the \input command in latex. Do you have any suggestions how to surpress that stargazer includes automatically latex preemble commands? Thanks!

    ReplyDelete
    Replies
    1. I talked to the author of the package, who's a friend of mine, and he says the following:

      "The current version does not have an argument that would remove these lines from .tex output, but the feature will be included in the next release (hopefully soon). One thing you could nevertheless do right now is to save stargazer output as a vector of strings into an object, and then subset to only include the lines you're interested in. If you
      have any further questions or comments, please do not hesitate to e-mail the package author directly."

      Here is contact information: http://cran.r-project.org/web/packages/stargazer/index.html

      Delete
  6. Your dazzling work has won my heart. I’ll come soon to your site with new hope.
    mango exporter pakistan

    ReplyDelete
  7. According to the showed database it can be seen as the value of Exporting in the economic Growth.

    ReplyDelete