Switching from Stata to R
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 Quarto
. 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 data.table
for much of my data management, after some dabbling with the tidyverse
. I think former Stata users will find some aspects of the data.table
syntax more familiar than dplyr
.
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:
- Stata2R: 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
data.table
and modelling withfixest
. 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 R for Stata users and conveRt. - Exploring Complex Survey Data Analysis Using R: 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
svy
manual in Stata. marginaleffects
: If you ever use margins in Stata then the equivalent in R ismarginaleffects
(there’s also a package calledmargins
, but I didn’t find it as flexible; you might prefer it, andconveRt
makes extensive use of it)modelsummary
: 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 usefulmodelsummary
package (closest Stata analogue is probablyestout
) that helps you create really nice tables reporting on your data and your regression models.gtsummary
is also fantastic and can be easier for doing some things, especially with survey data.
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!
Citation
@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}
}