<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Jake Anders</title>
<link>https://jakeanders.uk/posts.html</link>
<atom:link href="https://jakeanders.uk/posts.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.9.37</generator>
<lastBuildDate>Mon, 14 Jul 2025 23:00:00 GMT</lastBuildDate>
<item>
  <title>Switching from Stata to R</title>
  <dc:creator>Jake Anders</dc:creator>
  <link>https://jakeanders.uk/posts/2025-07-15-stata-to-r-resources.html</link>
  <description><![CDATA[ 




<p>I used to use Stata for my statistical analysis, but I have now switched to R for the vast majority of my work. A key reason for this is pushing towards writing reproducible papers, which I do using <code>Quarto</code>. One of the things about R is that there can be a lot of alternative ways of doing things and eco-systems. I basically converged on using <code>data.table</code> for much of my data management, after some dabbling with the <code>tidyverse</code>. I think former Stata users will find some aspects of the <code>data.table</code> syntax more familiar than <code>dplyr</code>.</p>
<p>My R skills are entirely self-taught using online resources, so for anyone who might be the same, here are some that I found really useful using the transition:</p>
<ul>
<li><a href="https://stata2R.github.io">Stata2R</a>: As the name suggests, this is aimed at someone getting started with R as a Stata user and focuses on this in two ways, through data management stuff with <code>data.table</code> and modelling with <code>fixest</code>. A couple of other guides in a similar spirit but which just didn’t quite click for me in the same way (this is very possibly entirely path-dependent because of which one I came across first, and you might well prefer them) are <a href="https://www.matthieugomez.com/statar/index.html">R for Stata users</a> and <a href="https://chrishanretty.co.uk/conveRt">conveRt</a>.</li>
<li><a href="https://tidy-survey-r.github.io/tidy-survey-book/">Exploring Complex Survey Data Analysis Using R</a>: If you’re going to be doing secondary analysis of large-scale surveys with weights and whatnot, I found this a really useful book for understanding how to think about this in R, which is pretty different from Stata’s approach to it. Think of these as the analogue to the <code>svy</code> manual in Stata.</li>
<li><a href="https://marginaleffects.com"><code>marginaleffects</code></a>: If you ever use margins in Stata then the equivalent in R is <code>marginaleffects</code> (there’s also a package called <code>margins</code>, but I didn’t find it as flexible; you might prefer it, and <code>conveRt</code> makes extensive use of it)</li>
<li><a href="https://modelsummary.com/vignettes/get_started.html"><code>modelsummary</code></a>: Kind of a bonus one, as I don’t really think Stata has anything so good for making tables: this is a guide to the really useful <code>modelsummary</code> package (closest Stata analogue is probably <code>estout</code>) that helps you create really nice tables reporting on your data and your regression models. <a href="https://www.danieldsjoberg.com/gtsummary/"><code>gtsummary</code></a> is also fantastic and can be easier for doing some things, especially with survey data.</li>
</ul>
<p>I might add to this list in future, it’s certainly not intended as exhaustive right now, but even if not I hope it might be useful to someone out there!</p>



<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-citation"><h2 class="anchored quarto-appendix-heading">Citation</h2><div><div class="quarto-appendix-secondary-label">BibTeX citation:</div><pre class="sourceCode code-with-copy quarto-appendix-bibtex"><code class="sourceCode bibtex">@online{anders2025,
  author = {Anders, Jake},
  title = {Switching from {Stata} to {R}},
  date = {2025-07-15},
  url = {https://jakeanders.uk/posts/2025-07-15-stata-to-r-resources},
  langid = {en}
}
</code></pre><div class="quarto-appendix-secondary-label">For attribution, please cite this work as:</div><div id="ref-anders2025" class="csl-entry quarto-appendix-citeas">
Anders, Jake. 2025. <span>“Switching from Stata to R.”</span> July 15.
<a href="https://jakeanders.uk/posts/2025-07-15-stata-to-r-resources">https://jakeanders.uk/posts/2025-07-15-stata-to-r-resources</a>.
</div></div></section></div> ]]></description>
  <category>stata</category>
  <category>r</category>
  <guid>https://jakeanders.uk/posts/2025-07-15-stata-to-r-resources.html</guid>
  <pubDate>Mon, 14 Jul 2025 23:00:00 GMT</pubDate>
</item>
</channel>
</rss>
