[Stata/R] Where to find replication code for Stata/R programming
One of the best ways to improve your programming/coding skills is by practicing with replication code. Luckily, various resources are available that provide replication codes for Stata/R programming. In this blog post, I will introduce some websites where you can find replication code for Stata/R programming.
What is a replication package?
In research, a replication package is a collection of data, code, and documentation that can be used to reproduce the analysis and findings of a published study.
1. OPEN ICPSR
The American Economics Association journals require authors to make their data and code available for replication. While data may not always be available, most replication codes are provided. They are usually published on Open ICPSR. You can access the website and search for your preferred analytical methodology along with replication codes. You can then practice by examining the relevant replication codes. Most economists use Stata as their primary language and R as a supplementary language for data visualization. Therefore, if you want to learn Stata programming, the replication codes in AER can be very helpful.
Alternatively, you can search for a paper on AER and then access the “materials” section to access the replication package.
Another way to find replication code for Stata/R programming is using the biggest code-sharing platform, GitHub. Many Stata/R codes are uploaded on GitHub, and you can find them by searching for the command (for example, “
table1_mc” in my case), clicking on the “Code” tab, and selecting Stata/R as the language. You can find many replication codes to practice with.
You can use Harvard Dataverse to find replication code for Stata/R programming. This platform is widespread, especially among political scientists. You can also find various
do file code samples by clicking the “Code” button when searching on this platform.
OSF is a data and code-sharing platform primarily used by psychologists (yes, different disciplines use different platforms). OSF may have limited filtering features compared to the other platforms mentioned above. However, you can still search for Stata/R code and explore the results on this platform.
Finally, Zenodo is a platform that seems less active than the sites mentioned above but is used in Europe. You can also search for code samples for some published papers on this platform.
Practicing with replication code is the fast way to improve your statistical programming skills 🙂 As the open science movement continues to expand, sharing code and data is becoming increasingly common and necessary. Practicing writing code with the intention of sharing it with others can also be helpful in improving your skills.