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
Related Posts with inrange including negative values
Error message when introducing factor variables in stcox on imputed dataDear Statalist, I'm running stcox on multiply imputed data. I have used the same model and syntax o…
Testing multiple coefficients equal to 1 with testHi all. I am running a panel regression with over 60 dummy variable coefficients that I'd like to te…
Transfer post hoc data into wordHow can be able to transfer post hoc results in word from STATA? Any view? …
Treatment of missings in geodistI have encountered the following issue using geodist from SSC, by Robert Picard: When all coordinate…
Calculating standard deviations from wtp commandHi all I am needing to calculate the standard deviations from my wtp estimates. I have used the wtp…
Subscribe to:
Post Comments (Atom)
0 Response to inrange including negative values
Post a Comment