Hi all,

I am attempting to create a dummy variable within stata for modeately negative real interst rates. This will take the value the value 0, if real interest rates are >-5, for example, -4 or 7. The variable should equal 1 if real interest rats are between -5 and -20. However, when I try to do this, despite success with other dummies and inrange, it keeps telling me (0 real changes made) and when browsing, where it should equal 1 it is denoted as '.' . See below,

generate modIRreal = 0 if IRreal>-5
replace modIRreal = 1 if inrange(IRreal, -5, -20)
replace modIRreal = . if missing(IRreal)


When I did a similar exercise for inflation levels, where the values were positive, I wrote the following and it all worked.

generate modinflation = 0 if inflation<20
replace modinflation = 1 if inrange(inflation, 20, 40)
replace modinflation = 0 if inflation>40
replace modinflation = . if missing(inflation)

Am I perhaps doing something wrong with my negative numbers for modIRreal?

Thanks in advance,
Adam