Dear all,
I am using the following data with permno for all the different companies and the dummy for plants inside of the Netherlands (=1) and plants outside of Netherlands (=0). My dataset is way longer than that but this is just an abstract.
permno firms in NE
19166 0
19166 0
19166 1
19166 0
11703 0
11703 1
11703 1
11703 0
11703 1
11703 0
11703 1
19133 0
19133 0
I am trying to create a new variable which allows me to code as "1" whatever permno has a firm in the Netherlands & Outside. If the permno only has in the Netherlands it remains 0. (see for example permno 19166 which has 3 firms outside of the Netherlands and 1 within the Netherlands and permno 19133 which only has firms in the Netherlands). We would therefore get a new column with a serie of 1 for the permno that has firms within the Netherlands AND outside the Netherlands and a serie of 0 for permno 19133.
Thank you for your help
Related Posts with Complex conditions/generation
Panel data analysisI am working on a dataset that you can find attached, which displays as dependent variable the votes…
How to reconvert the set of values that a variable can assume to a new set of values simultaneouslyHello, I have a variable called HighEd1 that can assume values from 1 to 8 and each value stands fo…
Generate dataset for simulation (non-i.i.d panel data)Hello everyone, Hope you all are well and keeping safe. I have a question for the community here a…
Survival analysis. Age as time variable. Need to include age in posterior analysis.Dear statalist community, Following the advice from the community given in my last post, I set up a…
Extracting hour dummies from datetime variableDear Statalisters, I am working with a panel data that includes a datime variable (Cdayhour, ex: 21f…
Subscribe to:
Post Comments (Atom)
0 Response to Complex conditions/generation
Post a Comment