I'm perplexed by some unexpected results I'm getting with the inrange function. The data below simulates the basic issue. My understanding is that Stata always interprets missing values as infinitely large. If that's true, why do row 3 and row 4 below evaluate to "Y" in the gen between... command?
I've reviewed Nick Cox's relevant Stata Tip 39 but I still don't understand why I'm getting the results produced above for rows 3 and 4. It seems like those rows should not evaluate to "Y".
Code:
input a z b 1 50 100 1 50 . . 50 100 . 50 . end gen between="Y" if inrange(z, a, b)
Comment