Author: benkriechel

  • Turning Footnotes into Endnotes …

    Submitting (LaTeX) written papers has some advantages: one usually does not have to change any formatting manually. LaTeX does that for us if it is instructed to do so. Journals often want the submissions to be formatted in a peculiar way. My challenge was to change footnotes to endnotes. I did remember that it was […]

  • Two ways to get your LaTeX document to Word

    Some LaTeX afficiendos might think … WHY? … but there is always a reason to transform your nicely layouted LaTeX file into something that resembles it in word. Journals that do not accept LaTeX files or PDFs as a submission is one, and probably the most important (and annoying) for researchers. Here is a solution […]

  • Preamble in do-files

    When writing a lot of do-files during a research process it is hard to keep track of what a do-file was for, what it needs in terms of input, and what it generates in terms of output. Especially, if you get your paper back from the (journal) referees with comments what you should change, and […]

  • Log-files

    Log-files are important in the workflow for two reasons: Most importantly they keep track of any messages that are “non-fatal”, i.e. that do not stop the progress of the do-file. However, quite often you want to ignore those messages, unless you expect an error to have occurred, then you search through your log files. Convenient […]

  • Putting a spell on data

    For those of you working with spell-data (could be panel, but I am thinking more of event-history data), there is a great tool that you should be aware of. You can get it at SSC by typing the following command: ssc install tsspell What can it do for you? Well, as I said it puts […]

  • capture and nostop

    In some instance the standard option that STATA stops whenever an error occurs is a (minor) annoyance. In one of my projects I was running the same set of regressions over several groups with loops. However, whenever STATA found a group that could not run the regressions it would stop, stating the error no observations. […]

  • Running regressions with similar sets of variables

    Quite often we run variations on regressions, including or excluding (sets of) variables. Copy-pasting the regression and eliminating the variables to be excluded is one way, but given that we speak of sets of variables why not use locals to do the work for you:

  • Repetitive tasks … let STATA do the work

    Especially in the process of data preparation, but also when one runs whole sets of analysis, we start repeating commands and sets of commands for similar variables. For example in one of my projects, I had to process salary information, that was monthly in wide format, and for several reasons I could not use reshape: […]

  • Why doesn’t this do-file run through …?

    Quite often a do-file is written to run on various data-files that all seem to be the same. Say, you have done it for one year of a data-set and want to repeat the same for the subsequent years that you have data. Now, a check whether the data actually has some data (given your […]

  • Cleaning up messy (string) variables

    Working on firm level data (again), I have the experience of cleaning up hundreds of different spelinngs of occupations that should eventually be categorized into a set of occupations that should only differ when actual different occupations are needed.Let me call the variable occupation. 34. slesar po remontu la 38. slesar po rem. la 44. […]