Skip to content

Commit

Permalink
Merge pull request #164 from worldbank/develop
Browse files Browse the repository at this point in the history
Version 6.0 - merge from Develop

Addressing issue #135, , #137, #139, #141, #142. #145, #146, #153. #158 and partially addressing #152.
  • Loading branch information
kbjarkefur committed Oct 22, 2018
2 parents 02fae52 + ec8253c commit e4ee5f4
Show file tree
Hide file tree
Showing 26 changed files with 2,794 additions and 958 deletions.
28 changes: 14 additions & 14 deletions README.md
Expand Up @@ -2,47 +2,47 @@
=====

### **Install and Update**
To install **ietoolkit**, type **`ssc install ietoolkit`** in Stata. If you see anything mentioned here (in the master branch) that you do not see reflected in the commands in ietoolkit in Stata on your computer, then you might not have the latest version of **ietoolkit** installed. To update all files associated with **ietoolkit** type **`adoupdate ietoolkit, update`** in Stata. (It is wise to be in the habit of regularly checking if any of your .ado files installed in Stata need updates by typing **`adoupdate`**.)
To install **ietoolkit**, type **`ssc install ietoolkit`** in Stata. If you see anything mentioned here (in the master branch) that you do not see reflected in the commands in **ietoolkit** in Stata on your computer, then you might not have the latest version of **ietoolkit** installed. To update all files associated with **ietoolkit** type **`adoupdate ietoolkit, update`** in Stata. (It is wise to be in the habit of regularly checking if any of your .ado files installed in Stata need updates by typing **`adoupdate`**.)

Stata version 11 or later is required for this package of commands.

### **Background**
These commands are developed by people that work at or with the unit for Development Impact Evaluations (DIME) at the The World Bank. While the commands are developed with best practices for impact evaluations in mind, we still hope and think that these commands can be useful outside our field as well.
These commands are developed by people that work at or with the Development Impact Evaluations (DIME) unit at the World Bank. While the commands are developed with best practices for impact evaluations in mind, these commands can be useful outside that field as well.

### **Bug Reports and Feature Requests**
If you are familiar with GitHub go to the **Contributions** section below for advanced instructions.

An easy but still very efficient way to provide any feedback on these commands is to create an *issue* in GitHub. You can read *issues* submitted by other users or create a new *issue* in the top menu below [**worldbank**/**ietoolkit**](https://github.com/worldbank/ietoolkit) at [https://github.com/worldbank/ietoolkit](https://github.com/worldbank/ietoolkit). While the word *issue* has a negative connotation outside GitHub, it can be used for any kind of feedback. If you have an idea for a new command, or a new feature on an existing command, creating an *issue* is a great tool for suggesting that. Please read already existing *issues* to check whether someone else has made the same suggestion or reported the same error before creating a new *issue*.

While we have a slight preference of receiving any kind of feedback here on GitHub, you are still very welcomed to send a regular email with your feedback to lcardosodeandrad@worldbank.org.
While we have a slight preference for receiving feedback here on GitHub, you are still very welcome to send a regular email with your feedback to [dimeanalytics@worldbank.org](mailto:dimeanalytics@worldbank.org).

### **Content**

**ietoolkit** provides a set of commands that address different aspects of data management and data analysis in relation to Impact Evaluations. The list of commands will be extended continuously, and suggestions for new commands are greatly appreciated. Some of the commands are related to standardized best practices developed at DIME (The World Bank’s unit for Impact Evaluations). For these commands, the corresponding help files provide justifications for the standardized best practices applied.

- **ietoolkit** returns meta info on the version of _ietoolkit_ installed. Can be used to ensure that the team uses the same version.
- **ieduplicates** and **iecompdup** are useful tools to identify and correct for duplicates, particulary in primary survey data
- **iefolder** sets up project folders and creates master do-files that links to all sub-folders
- **ietoolkit** returns meta info on the version of _ietoolkit_ installed. Can be used to ensure that the team uses the same version.
- **iebaltab** is a tool for multiple treatment arm balance tables
- **iematch** is an algortihm for matching observations in one group to "the most similar" observations in another group
- **iegraph** produces graphs of estimation results in common impact evaluation regression models
- **ieddtab** is a tool for difference-in-difference regression tables
- **ieduplicates** and **iecompdup** are useful tools to identify and correct for duplicates, particulary in primary survey data
- **ieboilstart** standardizes the boilerplate code at the top of all do-files
- **iedropone** drops observations and controls that the correct number was dropped
- **iefolder** sets up project folders and master do-files according to DIME's recommended folder structure
- **iegitaddmd** adds placeholder README.md files to all empty subfolders allowing them to be synced on GitHub
- **iematch** is an algorithm for matching observations in one group to the "most similar" observations in another group
- **iegraph** produces graphs of estimation results in common impact evaluation regression models
- **iedropone** drops observations and controls that the correct number was dropped
- **ieboilsave** performs checks before saving a data set

### **Contributions**
If you are not familiar with GitHub see the **Bug reports and feature requests** section above for a less technical but still very helpful way to contribute to **ietoolkit**.

GitHub is a wonderful tool for collaboration on code. We appreciate contributions directly to the code and will of course give credit to anyone providing contributions that we merge to the master branch. If you have any questions on anything in this section, please do not hesitate to email lcardosodeandrad@worldbank.org. See [CONTRIBUTING.md](https://github.com/worldbank/ietoolkit/blob/master/CONTRIBUTING.md) for some more details on for example naming conventions.
GitHub is a wonderful tool for collaboration on code. We appreciate contributions directly to the code and will of course give credit to anyone providing contributions that we merge to the master branch. If you have any questions on anything in this section, please do not hesitate to email [dimeanalytics@worldbank.org](mailto:dimeanalytics@worldbank.org). See [CONTRIBUTING.md](https://github.com/worldbank/ietoolkit/blob/master/CONTRIBUTING.md) for some more details on for example naming conventions.

The Stata files on the `master` branch are the files most recently released on the SSC server. README, LICENSE and similar files are updated directly to `master` in between releases. Check out any of the `develop` branches (if there are any) if you want to see what future updates we are currently working on.

Please make pull requests to the `master` branch **only** if you wish to contribute to README, LICENSE or similar meta data files. If you wish to make a contribution to any Stata file, then please **do not** use the `master` branch. If you wish to make a contribution to any Stata files that we have published at least once, then please fork from and make your pull request to the `develop` branch. The `develop` branch includes all minor edits we have made to already published commands since the last release that we will include in the next version released on the SSC server. If your addition is related to a specific issue in this repository, then see the naming convention in the [CONTRIBUTING.md](https://github.com/worldbank/ietoolkit/blob/master/CONTRIBUTING.md) file.

All Stata commands we are working on that we have yet to release a first version of, are found in the branches called `develop-NAME` where *NAME* corresponds to the working name of the command that is yet to be published. If you wish to contribute to any of those commands, then please fork from the branch of the command you want to contribute to, and only make edits to the .ado/.do and .sthlp that correspond to that command. If you want to make contributions to multiple commands that have yet to be released, then you will have to fork from and make pull request to multiple branches.

If you wish to make a contribution by making *forks and pull requests* but are not exactly sure how to do so, feel free to send an email to lcardosodeandrad@worldbank.org.
If you wish to make a contribution by making *forks and pull requests* but are not exactly sure how to do so, feel free to send an email to [dimeanalytics@worldbank.org](mailto:dimeanalytics@worldbank.org).

### Other DIME Anlytics Repositories
* [Stata adofiles repository](https://github.com/worldbank/stata)
Expand All @@ -53,7 +53,7 @@ If you wish to make a contribution by making *forks and pull requests* but are n
**ietoolkit** is developed under MIT license. See http://adampritchard.mit-license.org/ or see [the `LICENSE` file](https://github.com/worldbank/ietoolkit/blob/master/LICENSE) for details.

### **Main Contact**
Luiza Cardoso de Andrade (lcardosodeandrad@worldbank.org)
Luiza Cardoso de Andrade ([dimeanalytics@worldbank.org](mailto:dimeanalytics@worldbank.org))

### **Authors**
Kristoffer Bjärkefur, Mrijan Rimal, and Luiza Cardoso de Andrade.
Kristoffer Bjärkefur, Luiza Cardoso de Andrade, Benjamin Daniels, Mrijan Rimal
25 changes: 12 additions & 13 deletions src/ado_files/iebaltab.ado
@@ -1,4 +1,4 @@
*! version 5.5 26APR2018 DIME Analytics lcardosodeandrad@worldbank.org
*! version 6.0 19OCT2018 DIME Analytics dimeanalytics@worldbank.org

capture program drop iebaltab
program iebaltab
Expand All @@ -25,7 +25,7 @@
///
/*Statistics and data manipulation*/ ///
FIXedeffect(varname) ///
COVariates(varlist) ///
COVariates(varlist ts fv) ///
COVARMISSOK ///
vce(string) ///
BALMISS(string) ///
Expand Down Expand Up @@ -83,9 +83,8 @@ qui {
version 11

*Remove observations excluded by if and in
if ("`if'`in'"!="") {
keep `if' `in'
}
marksample touse, novarlist
keep if `touse'

if 1 {

Expand Down Expand Up @@ -493,7 +492,7 @@ qui {

*Testing that no label is missing
if "`label'" == "" {
noi display as error "{phang}For variable [`name'] listed in rowlabels(`rowlabels') you have not specified any label. Labels are requried for all variables listed in rowlabels(). The variable name itself will be used for any variables omitted from rowlabels(). See also option {help dmtab:rowvarlabels}"
noi display as error "{phang}For variable [`name'] listed in rowlabels(`rowlabels') you have not specified any label. Labels are requried for all variables listed in rowlabels(). The variable name itself will be used for any variables omitted from rowlabels(). See also option {help iebaltab:rowvarlabels}"
noi tab `grpvar', nol
error 198
}
Expand Down Expand Up @@ -552,7 +551,7 @@ qui {
else {

*Error for vce() incorrectly applied
noi display as error "{phang}The vce type `vce_type' in vce(`vce') is not allowed. Only robust, cluster and bootstrap is allowed. See {help vce_option :help vce_option} for more information."
noi display as error "{phang}The vce type `vce_type' in vce(`vce') is not allowed. Only robust, cluster and bootstrap are allowed. See {help vce_option :help vce_option} for more information."
error 198

}
Expand Down Expand Up @@ -676,14 +675,14 @@ qui {
if `MISSMINMEAN_USED' == 0 local replaceoptions `" `replaceoptions' minobsmean(10) "'

*Excute the command. Code is found at the bottom of this ado file
if (`COVMISS_USED' | `COVMISSREG_USED') iereplacemiss `covancevar', `replaceoptions'
if (`COVMISS_USED' | `COVMISSREG_USED') iereplacemiss `covariates', `replaceoptions'

if `COVARMISSOK_USED' != 1 {

cap assert `covar' < .
if _rc == 9 {

noi display as error "{phang}The variable `covar' specified in covariates() has missing values for one or several observations. This would cause observations to be dropped in the estimation regressions. To allow for observations to be dropped see option covarmissok and to make the command treat missing values as zero see option covmiss() and covmissreg(). Click {stata tab `covar' `if' `in', m} to see the missing values.{p_end}"
noi display as error "{phang}The variable `covar' specified in covariates() has missing values for one or more observations. This would cause observations to be dropped in the estimation regressions. To allow for observations to be dropped see option covarmissok and to make the command treat missing values as zero see option covmiss() and covmissreg(). Click {stata tab `covar' `if' `in', m} to see the missing values.{p_end}"
error 109
}
}
Expand Down Expand Up @@ -2225,7 +2224,7 @@ qui {
*Remove the first comman before the first variable
local fmiss_error_list = subinstr("`fmiss_error_list'" ,",","",1)

noi di as error "{phang}F-test is possible but perhaps not advisable. Some observations have missing values in some of the balance variables and therfore dropped from the f-stat regression. This happened in the f-tests for the following group(s): [`fmiss_error_list']. Solve this by manually restricting the balance table using if or in, or disable the f-test, or by using option {help dmtab:balmiss()}. Suppress this error message by using option {help dmtab:fmissok}"
noi di as error "{phang}F-test is possible but perhaps not advisable. Some observations have missing values in some of the balance variables and therfore dropped from the f-stat regression. This happened in the f-tests for the following group(s): [`fmiss_error_list']. Solve this by manually restricting the balance table using if or in, or disable the f-test, or by using option {help iebaltab:balmiss()}. Suppress this error message by using option {help iebaltab:fmissok}"
error 416
}

Expand Down Expand Up @@ -2286,7 +2285,7 @@ qui {

if `warn_ftest_num' > 0 {

noi di as text "{pmore}{bf:F-Test for Joint Orthogonality:} The variance all groups is zero for the varible indicated and a test of joint orthogonality for all groups is therefore not valid. Tests are reported as N/A in the table.{p_end}"
noi di as text "{pmore}{bf:F-Test for Joint Orthogonality:} The variance all groups is zero for the variable indicated and a test of joint orthogonality for all groups is therefore not valid. Tests are reported as N/A in the table.{p_end}"
noi di as text ""

noi di as text "{col 9}{c TLC}{hline 25}{c TRC}"
Expand All @@ -2306,7 +2305,7 @@ qui {

if `warn_joint_novar_num' > 0 {

noi di as text "{pmore}In the following tests, F-tests were not valid as all variables were omitted in the joint significance test due to colliniarity. Tests are reported as N/A in the table.{p_end}"
noi di as text "{pmore}In the following tests, F-tests were not valid as all variables were omitted in the joint significance test due to collinearity. Tests are reported as N/A in the table.{p_end}"
noi di as text ""

noi di as text "{col 9}{c TLC}{hline 12}{c TRC}"
Expand Down Expand Up @@ -2710,7 +2709,7 @@ program define iereplacemiss

*Test that there are enough observations to base the mean on
if `r(N)' < `minobs' {
noi display as error "{phang}Not enough observations. There are less than `minobs' observations with a non missing value in `varlist'. Missing values can therefore not be set to the mean. Click {stata tab `varlist', missing} for detailed information.{p_end}"
noi display as error "{phang}Not enough observations. There are less than `minobs' observations with a nonmissing value in `varlist'. Missing values can therefore not be set to the mean. Click {stata tab `varlist', missing} for detailed information.{p_end}"
error 2001
}

Expand Down
2 changes: 1 addition & 1 deletion src/ado_files/ieboilsave.ado
@@ -1,4 +1,4 @@
*! version 5.5 26APR2018 DIME Analytics lcardosodeandrad@worldbank.org
*! version 6.0 19OCT2018 DIME Analytics dimeanalytics@worldbank.org

capture program drop ieboilsave
program ieboilsave , rclass
Expand Down

0 comments on commit e4ee5f4

Please sign in to comment.