worldbank / iefieldkit

Stata commands designed for Impact Evaluations field work. These are tools that are used during/after a survey in the field for data quality monitoring.
MIT License
38 stars 18 forks source link

[iecorrect]: Wrong observations corrected with errors in ID variables #227

Closed bbdaniels closed 1 year ago

bbdaniels commented 2 years ago

Using the following correction sheet:

make foreign varname value valuecurrent initials notes
Test 1 headroom 5   BD OK to go!
Test * headroom 3 3    

The second line is correctly ignored, but the first line appears to be implemented ignoring the unmatched value of Test in make.

iecorrect apply using "/users/bbdaniels/desktop/correct.xlsx" , idvar(make foreign)  noi
    Variables for corrections of type numeric: headroom
    No corrections of type string.
    No observations to be dropped.

** Correct entries in numeric variables 
replace headroom = 5 if (foreign == 1)
(22 real changes made)
replace headroom = 3 if (headroom == float(3)) & (make == "Test")
(0 real changes made)
luizaandrade commented 2 years ago

the fix for #228 also fixed this.