Dear all,
I have a panel data set. Each observation is organized by firmId and year. Some other variables include firms’ industry classification code (SIC) storage type integer.
I need to define a binary variable set equal to one if a firm’s SIC code between 2833 and 2836, 3570 and 3577, 3600 and 3674; and zero otherwise.
I plan to use
gen sic_dum=0
replace sic_dum =1 if (sic>=2833 & sic <=2836) | sic>= 3570 & sic <=3577 | sic>= 3600 & sic <=3674)
But I am not sure whether & takes precedence than | using these conditional statement).
Thank you,
Rochelle
Related Posts with Define a binary variable using and / or
Issue replicating stcox results with clogit using discrete time dataDear Stata Folk Here is some background on what I am doing. I'm conducting an event history analysi…
How to perform unit root tests for highly unbalanced panel with many time gaps?Dear all, My panel is highly unbalanced, with total observations of 350 and lots of time gaps. Thes…
BLP CrossectionalI am working on a project where I observe brands over years. I seek to use BLP for demand estimation…
Visualizing cross-level interaction in a mixed modelDear All, Apologies in advance if I am not including all necessary information, this is my first ti…
ageHello I have a research question involving annual savings by individuals and that I have a panel dat…
Subscribe to:
Post Comments (Atom)
0 Response to Define a binary variable using and / or
Post a Comment