Could someone please assist me in creating dummy variables based on two conditions (State = and Year >=)? I am using panel data and would like to create a dummy variable for the revocation of a policy. In other words, certain states revoked this policy at different points in time and I would like to add this variable but am having a very hard time getting it written correctly.
Here is what I am looking for... hypothetically, in 2015 Arizona revokes policy, all others keep it. In 2016 Deleware revokes policy, all others keep it. In 2017 California revokes policy, all others keep it. And so on...
Any help would be greatly appreciated!
|2015| AL| 1|
|2015| AR| 0|
|2015| CA| 1|
|2015| CO| 1|
|2015| DE| 1|
|2016| AL| 1|
|2016| AR| 0|
|2016| CA| 1|
|2016| CO| 1|
|2016| DE| 0|
|2017| AL| 1|
|2017| AR| 0|
|2017| CA| 0|
|2017| CO| 1|
|2017| DE| 0|
|2018| AL| 1|
|2018| AR| 0|
|2018| CA| 0|
|2018| CO| 0|
|2018| DE| 0 |
|2019| AL| 0|
|2019| AR| 0|
|2019| CA| 0|
|2019| CO| 0|
|2019| DE| 0|