the sample produced by this code

replace region =. if region==-1
drop if region==.
sum if region ==1

differ from the sample produced by this code

keep if region ==1
sum

I thought perhaps it was specific to the keep command, but

drop if region != 1
sum

produced the same sample as the keep command.

Is there something in the keep/drop command that changes the storage type of the variable but this doesn't happen with the replace command?


Thank you!