Difference between revisions of "Stata Coding Practices"

Jump to: navigation, search
Line 25: Line 25:


We have developed a repository where we collect [https://github.com/worldbank/Stata-IE-Visual-Library Stata Graph examples] on GitHub. Feel free to submit your own example codes there.  
We have developed a repository where we collect [https://github.com/worldbank/Stata-IE-Visual-Library Stata Graph examples] on GitHub. Feel free to submit your own example codes there.  
== Snippets of Code with Best Practices with Explanations ==
The following code examples have been written in a way that it they should be easy to experiment with and be possible to build on to fit many different contexts. Download the files and read the instructions.
* [https://gist.github.com/kbjarkefur/1f880b78029eaf78416d12dfd2076985 Intro to how to write programs (also called commands or functions) in Stata]
* [https://gist.github.com/kbjarkefur/16b63c1fc89ab52c3d4cae9c74288452 Share functions (sub-programs) between command in the same package]


== Additional Resources ==
== Additional Resources ==

Revision as of 17:45, 13 November 2018

This page list a lot of resources both developed at DIME but also by other people or organizations.

ietoolkit

At DIME we have developed a packge of Stata commands specially developed for impact evaluations but could also be useful in other contexts as well. The package is called ietoolkit and can be installed from the SSC server. To install the package, type ssc install ietoolkit in your Stata command window.

Please visit our github page for details: https://github.com/worldbank/ietoolkit

ietoolkit provides a set of commands that address different aspects of data management and data analysis in relation to Impact Evaluations. These include the following:

  1. iebaltab is a tool for multiple treatment arm balance tables
  2. ieboilsave performs checks before saving a data set
  3. ieboilstart standardizes the boilerplate code at the top of all do-files
  4. iedropone drops observations and controls that the correct number was dropped
  5. ieduplicates and iecompdup are useful tools to identify and correct for duplicates, particulary in primary survey data
  6. iefolder sets up project folders and creates master do-files that links to all sub-folders
  7. iegitaddmd adds a placeholder file to empty folders so that folder structures with empty folders can be shared on GitHub
  8. iegraph produces graphs of estimation results in common impact evaluation regression models
  9. iematch is an algortihm for matching observations in one group to "the most similar" observations in another group

Stata Command Repository

Repository with a large number of Stata ado files. These commands cannot be installed through SSC but click the link for installation instructions. This repository contains a broad variety of Stata commands (adofiles) which are useful in data management, statistical analysis, and the production of graphics. In many cases, these adofiles reduce the production of routine items from a tedious programming task to a single command line – such as data import and cleaning; production of summary statistics tables; and categorical bar charts with confidence intervals.

DIME's Stata IE Visual Library

We have developed a repository where we collect Stata Graph examples on GitHub. Feel free to submit your own example codes there.

Snippets of Code with Best Practices with Explanations

The following code examples have been written in a way that it they should be easy to experiment with and be possible to build on to fit many different contexts. Download the files and read the instructions.

Additional Resources