I want to create the wanted dummy to equal 1 if scaledummy is equal 1 in 3 continuous years. If the scaledummy is equal 1 in year 1,2 and 3, the wanted dummy should be equal 1 in year 3 on panel level.
Best regards,
Ole Karlsen
firm | year | scaledummy | wanted |
1 | 2015 | 0 | 0 |
1 | 2016 | 1 | 0 |
1 | 2017 | 1 | 0 |
1 | 2018 | 1 | 1 |
1 | 2004 | 0 | 0 |
2 | 2005 | 1 | 0 |
2 | 2006 | 1 | 0 |
2 | 2007 | 0 | 0 |
2 | 2008 | 0 | 0 |
3 | 2004 | 0 | 0 |
3 | 2005 | 1 | 0 |
3 | 2006 | 1 | 0 |
3 | 2007 | 1 | 1 |
3 | 2008 | 1 | 1 |
3 | 2009 | 0 | 0 |
0 Response to Dummy based on other dummy variable (PANEL DATA)
Post a Comment