I've enlisted policy as a binary variable which I need to take 1 year forward. Like in my data for county 1003 the policy takes value 1 at year 2021. But, I need to create a new variable where the policy will take the value 1 for county 1003 at year =2022. Same goes for each observation. I have a repeated cross section dataset.
Can anyone kindly take me how I can execute it? Here is the sample data for your convenience.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float policy double county int year 0 1003 2002 1 1003 2021 0 2012 2002 0 1003 2002 1 1004 2015 0 1004 2004 0 1013 2002 1 1013 2018 1 10003 2004 0 12003 2009 0 10003 2000 1 12003 2014 0 10101 2021 1 12003 2014 end
0 Response to Changing a binary policy variable shifting it to next year for repeated cross section data
Post a Comment