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
Certainty equivalent - Portfolio ReturnsHi, I am looking for a Stata package that would calculate portfolio returns certainty equivalent us…
Binary DV with reghdfe with too many negative predictionsHi Everyone, I want to run a probability model by using high-dimensional fixed effects to understan…
Do I need to cluster the standard errors?Dear all, I have a panel data set of a study where 69 individuals were observed over 8 points in tim…
Combined plots with no marginHi, I would like to combine 3 plots with no margin (or as little as possible) and 1 unique legend t…
Generate a variableHello, I use Stata for the empirical part of my bachelor thesis and have not used Stata before so I…
Subscribe to:
Post Comments (Atom)
0 Response to inrange including negative values
Post a Comment