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
two way fixed effects: Mundlak specification (time effects and fixed effects)Dear all, I am working with panel data and would like to proceed with a two-way fixed effects model:…
Import XML data with Stata - usexmlexDear Stata community, does anyone know how to import xml-data with Stata Version 16? I tried to in…
Question about Heterogeneous (and possible cross correlated) Dynamic Narrow PanelDear Statalist colleagues, I am working with a narrow panel dataset (N <10, T = 30), where I fin…
Create variable that calculates difference in matched observation and "normal observation" of a variableHi all, For my thesis I need to extract the difference in Issue Yield between green bonds and conve…
Paneldata regression with a loopDear all, I am using Stata MP 16.1. For my masterthesis I want to obtain elasticities for sector x …
Subscribe to:
Post Comments (Atom)
0 Response to inrange including negative values
Post a Comment