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
xline based on a conditionHi Stata Users, I am using Stata v15 and would like to have an xline on the first non-missing occurr…
Creating long format time series from start and end date in wide formatHello, I have a data set on judges with a term start year and term end year. I would like to have a…
Choice of model with binary outcome (conceptual problem)Hi I am trying to look at the determinants of finishing in the academic track conditional on choosi…
Added Variable Plot and PPMLHDFEI am using ppmlhdfe for a Poisson regression and I want to understand if some points might be influe…
Effect size estimation for non-inferiority trialHi everyone, I need your help calculating the estimated effect size for a non-inferiority hypothesis…
Subscribe to:
Post Comments (Atom)
0 Response to Define a binary variable using and / or
Post a Comment