Rob Hicks (Posts about stata)http://rlhick.people.wm.edu/enSat, 28 Sep 2024 18:30:54 GMTNikola (getnikola.com)http://blogs.law.harvard.edu/tech/rssUsing stata_kernel and Jupyter Lab (or Notebook) for reproducible research goodnesshttp://rlhick.people.wm.edu/posts/stata_kernel_jupyterlab.html<div><p>
The method outlined in this post is in my opinion the very best way to run <code>Stata</code> and generate dynamic and reproducible research documents that you can share with co-authors, instructors, etc. This method requires some setup including the installation of python. We cover in detail most of these steps.
</p>
<p><a href="http://rlhick.people.wm.edu/posts/stata_kernel_jupyterlab.html">Read more…</a> (3 min remaining to read)</p></div>jupyter labstatahttp://rlhick.people.wm.edu/posts/stata_kernel_jupyterlab.htmlTue, 07 Jul 2020 09:45:50 GMTUsing stata_kernel and Emacs Orgmode for reproducible research goodnesshttp://rlhick.people.wm.edu/posts/stata_kernel_emacs.html<div><p>
This post is hopefully the last in a series of posts outlining how to
use <code>Stata</code> in a proper dynamic document/reproducible research
setting using Emacs. As of the summer of 2020, I am only using <a href="https://github.com/kylebarron/stata_kernel"><code>stata_kernel</code></a> for
my own work and no longer recommend using <a href="http://rlhick.people.wm.edu/posts/stata-and-literate-programming-in-emacs-org-mode.html">my customized
<code>ob-ipython.el</code></a> for reasons described <a href="https://gitlab.com/robhicks/ob-stata.el/-/issues/10#note_374134363">here</a>.
</p>
<p>
This post shows the installation steps to get this working and some
usability recommendations if using Org-mode. Before proceeding with
anything below, make sure you complete the <a href="http://rlhick.people.wm.edu/posts/stata_kernel_jupyterlab.html#Python%20Preliminaries">"Python Preliminaries"
steps</a> first.
</p>
<p><a href="http://rlhick.people.wm.edu/posts/stata_kernel_emacs.html">Read more…</a> (6 min remaining to read)</p></div>orgmodestatahttp://rlhick.people.wm.edu/posts/stata_kernel_emacs.htmlTue, 07 Jul 2020 09:31:50 GMTTeaching with Statahttp://rlhick.people.wm.edu/posts/stata-teaching.html<div><p>
This post skews towards recommending the stata add-on "markstat". For most of my students this is still recommended. For those that have some python interest/skills and especially those that have already installed jupyter notebook or lab, <a href="http://rlhick.people.wm.edu/posts/stata_kernel_jupyterlab.html">I highly recommend <code>stata_kernel</code> and jupyter notebook (or lab)</a>.
</p>
<p>
This post is a followup to two earlier blog posts on reproducible research found <a href="http://rlhick.people.wm.edu/posts/stata-and-literate-programming-in-emacs-org-mode.html">here</a> and <a href="http://rlhick.people.wm.edu/posts/reproducible-research.html">here</a>. This post focuses on my usage of Stata for classroom assignments turned in by students. These assignments entail
</p>
<ol class="org-ol">
<li>Model Description including mathematical equations (Latex)</li>
<li>Data Summaries and Figures</li>
<li>Stata Code</li>
<li>Stata Results</li>
<li>Quality publishing system to produce a problem set document containing all of the above elements</li>
<li>Easy for students to use (given a willingness to learn the markdown syntax)</li>
</ol>
<p>
These are different from my own research requirements. For me, emacs org-mode is the best tool for the reasons I outline in the prior posts linked above. For my students, however, learning Emacs and org-mode is totally impractical. This post quickly surveys the three available options: Markdoc, Markstat, and Jupyter Notebook.
</p>
<p><a href="http://rlhick.people.wm.edu/posts/stata-teaching.html">Read more…</a> (2 min remaining to read)</p></div>jupyterliterate programmingreproducible researchstatahttp://rlhick.people.wm.edu/posts/stata-teaching.htmlFri, 28 Sep 2018 16:15:50 GMTStata and Literate Programming in Emacs Org-Modehttp://rlhick.people.wm.edu/posts/stata-and-literate-programming-in-emacs-org-mode.html<div><p>
<b><b>Important Note:</b></b> The following post is outdated and is no longer the recommended approach for running stata in orgmode. Please <a href="http://rlhick.people.wm.edu/posts/stata_kernel_emacs.html">see this post on using <code>emacs</code> with <code>jupyter</code> and the <code>stata_kernel</code></a> for a method that works and that is more robust moving forward.
</p>
<p>
Stata is a statistical package that lots of people use, and Emacs Org-mode is a great platform for organizing, publishing, and blogging your research. In one of <a href="http://rlhick.people.wm.edu/posts/reproducible-research.html">my older posts</a>, I outlined the relative benefits of Org-mode compared to other packages for literate programming. At that time, I argued it was the best way to write literate programming documents with Stata (if you are willing to pay the fixed costs of learning Emacs). I still believe that, and I use it a lot for writing course notes, emailing students with code and results, and even for drafting manuscripts for publishing.
</p>
<p>
Despite how good Emacs Org-mode is for research involving Stata, Stata is still something of a second class citizen compared to packages like <code>R</code> or <code>Python</code>. While it is functional, it can be a little rough around the edges, and since not many people use Stata with Emacs finding answers can be tough. This post does 3 things:
</p>
<ol class="org-ol">
<li>Demonstrates some issues using stata in org-mode</li>
<li>Introduces an updated version of <code>ob-stata.el</code>. With only minor modifications, this version avoids some issues with the current version of <code>ob-stata</code> found <a href="https://github.com/aspiers/orgmode/blob/master/contrib/lisp/ob-stata.el">here</a>. My version of <code>ob-stata.el</code> <a href="https://gitlab.com/robhicks/ob-stata.el">can be downloaded from gitlab</a>.</li>
<li>Provides full setup instructions that enables code-highliting in html and latex export.</li>
</ol>
<p><a href="http://rlhick.people.wm.edu/posts/stata-and-literate-programming-in-emacs-org-mode.html">Read more…</a> (6 min remaining to read)</p></div>emacsorgmodereproducible researchstatahttp://rlhick.people.wm.edu/posts/stata-and-literate-programming-in-emacs-org-mode.htmlWed, 28 Feb 2018 10:34:32 GMTReproducible Research and Literate Programming for Econometricshttp://rlhick.people.wm.edu/posts/reproducible-research.html<div><p>
<a href="http://rlhick.people.wm.edu/posts/reproducible-research.html#orgca36989">Jump straight to the discussion on Stata and Emacs Org Mode</a>
</p>
<p>
This post describes my experience implementing reproducible research and literate programming methods for commonly used econometric software packages. Since literate programming aims to store the accumulated scientific knowledge of the research project in one document, the software package must allow for the reproduction of data cleaning and data analysis steps, store the record of methods used, generate results dynamically and use these for the writeup, and be executable by including the computational environment.
</p>
<p>
Perhaps most importantly, this dynamic document can be executed to produce the <b>academic paper</b>. The researcher shares this file with other researchers rather than the only a pdf of the paper, making the research fully reproducible by executing the dynamic document. It is my view that this will be expected in most scientific journals over the next few decades.
</p>
<p><a href="http://rlhick.people.wm.edu/posts/reproducible-research.html">Read more…</a> (12 min remaining to read)</p></div>emacsmatlaborgmodepythonreproducible researchstatahttp://rlhick.people.wm.edu/posts/reproducible-research.htmlThu, 02 Mar 2017 10:30:50 GMTComparing Stata and Ipython Commands for OLS Modelshttp://rlhick.people.wm.edu/posts/comparing-stata-and-ipython-commands-for-ols-models.html<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>In this note, I'll explore the Ipython <code>statsmodels</code> package for estimating linear regression models (OLS). The goal is to completely map stata commands for <code>reg</code> into something implementable in Ipython.</p>
<p><a href="http://rlhick.people.wm.edu/posts/comparing-stata-and-ipython-commands-for-ols-models.html">Read more…</a> (6 min remaining to read)</p></div></div></div>bootstrapeconometricsipythonstatahttp://rlhick.people.wm.edu/posts/comparing-stata-and-ipython-commands-for-ols-models.htmlMon, 02 Mar 2015 12:15:41 GMT