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
-gsem- for dynamic multinomial logit model with random effectsDear All, I am trying to analyse, using panel data, the extent of state dependance to a previous si…
Command to list households with multiple heads/without heads in a survey dataBelow is a extract data from a survey conducted for various households within a community, please wh…
Calculating citation half-lifeDear all, Assume that you have the following problem. You have patent citations for firms in differ…
mata function available in different ado-filesDear all, I am trying to execute a mata function in different but related ado-files, but I don't kn…
Deleting rows with NAsDear Statalists, I would like to delete rows where are only 7 real values and the rest is NA, does a…
Subscribe to:
Post Comments (Atom)
0 Response to Define a binary variable using and / or
Post a Comment