hi, suppose that for each company-date combination I have a dummy variable called Duality and a description of a director: company date duality description A 31/12/2010 1 chairman ahah A 31/12/2009 1 chariman 57hf A 31/12/2009 1 ceo kgk9g9g B 20/10/2014 0 ceo gk9 C 13/2/2002 0 chairman chairmans I would like to create a new dummy variable ceo_dummy such that: whenever the word 'ceo' appears in the description ceo_dummy=1, BUT, if for any company-date duality=1 and there is no description entry with the word 'ceo', then whenever the word 'chairman' appears in the description ceo_dummy=1. so the result shuold be the following: company date duality description ceo_dummy A 31/12/2010 1 chairman ahah 1 A 31/12/2009 1 chariman 57hf 0 A 31/12/2009 1 ceo kgk9g9g 1 B 20/10/2014 0 ceo gk9 1 C 13/2/2002 0 chairman chairmans 0 like this every company-date combination has only one ceo_dummy=1 thank you!
... View more