I'm trying to build the following if statement in Stata:
I want Stata to restrict my sample with the following conditions keep if distance > 50 & distance < 60
but only if the binary variable category = 0
. How can I achieve this?
You can add an extra condition in your if-statement.
keep if category == 1 | (category == 0 & distance > 50 & distance < 60)