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

ieduplicates : error when two vars only differ in case #238

Open kbjarkefur opened 1 year ago

kbjarkefur commented 1 year ago

https://github.com/worldbank/iefieldkit/blob/eb2ee624ddd20a42ff8a1aca647cc7cf28d35f0c/src/ado_files/ieduplicates.ado#L250-L253

Error happens if these two conditions are satisfied:

  1. The dataset has two vars that will have the same name if both converted to lower case (examples region/REGION, region/Region or rEgion/reGion )
  2. Both are included in ID_varname, uniquevars() or keepvars() OR one var is lower case (region) not included in the command but the var is included in ID_varname, uniquevars() or keepvars() .

For a reason I do not remember, the command change all variables in the report to lower case.

Two options to be investigated to solve this.

  1. Test if this is the case and provide user with a helpful error message
  2. See if the command can be modified so it can handle these cases without error.