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
R-sq and adj R-sq in xtreg, fixed effectDear all, I am currently working on a panel data set in which i create a regression by code xtreg x…
pubbias command in midas not workingHi, I am using midas command to do meta analysis of diagnostic accuracy studies. All commands are wo…
Saving part of a datasetHi, I have 33 variables and 1000 participants. The 33rd variable has 20 participants with data enter…
sttocc matching for both analysis time and calendar time - nested case control studyHi folks, Apologies in advance for the rookie question! I am designing a nested case-control study …
Splitting string into column vectorDear Statalist, I am currently working with a dataset consisting of research articles, where a give…
Subscribe to:
Post Comments (Atom)
0 Response to inrange including negative values
Post a Comment