worldbank/iefieldkit

[iecorrect]: [drop] functionality handles wildcards and [n_obs] incorrectly

Closed this issue · 2 comments

Using the following sheet, the command neither respects the intended total number of observations to drop, nor does it correctly implement the logic in the second row (zero observations should be dropped).

make foreign n_obs initials notes
* 1 22    
Test 0 0    
iecorrect apply using "/users/bbdaniels/desktop/correct.xlsx" , idvar(make foreign)  noi
    No corrections of type numeric.
    No corrections of type string.
    Number of observations to be dropped: 22


** Drop observations 
drop if (foreign == 1)
(22 observations deleted)
drop if (foreign == 0)
(52 observations deleted)

Corresponding correction required at the helpfile below, including indicating whether n_obs is required or not (and whether or not it is required to be accurate -- I would make this check the default, but skippable by entering wildcard * in the cell):

{dlgtab:Dropping observations:}
{pstd}Corrections made by {it:dropping} observations are implemented through the
{it:drop} tab of the Excel spreadsheet. This tab only has one {bf:required} column:{p_end}
{phang2}{it:idvalue}, which should be filled with the value of the ID variable in the observations to be dropped.{p_end}

@luizaandrade I just wanted to confirm that we are NOT allowing wildcards in the n_obs column here. Otherwise it now works correctly.

that is correct. this is now also being tested in f2c851f