Hi!
I have a panel (id year) data with variables including msa (categorical 1,2, 3), wm_38 (binary) , and wm_310 (binary).
A problem is that a value of the wm_38 is not consistent in a way that in id 1. If you look at the wm_310 value over the years for id1, the value is all zero between 2004-2007 and turns on after that.
However, the value is turned on and off for id2 between 2012 and 2014. This is the problem that I've been trying to fix. I am not able to identify a sort of consistent pattern for all ids in the data set (300k+ obs).
Would there be a way to fix a random event across the ids and years?
Another example is following
I have a panel (id year) data with variables including msa (categorical 1,2, 3), wm_38 (binary) , and wm_310 (binary).
A problem is that a value of the wm_38 is not consistent in a way that in id 1. If you look at the wm_310 value over the years for id1, the value is all zero between 2004-2007 and turns on after that.
However, the value is turned on and off for id2 between 2012 and 2014. This is the problem that I've been trying to fix. I am not able to identify a sort of consistent pattern for all ids in the data set (300k+ obs).
Would there be a way to fix a random event across the ids and years?
Code:
clear input byte id int year byte(msa wm_38 wm_310) 1 2004 1 0 0 1 2005 1 0 0 1 2006 1 0 0 1 2007 1 0 0 1 2008 1 0 1 1 2009 1 0 1 1 2010 1 0 1 1 2011 1 0 1 1 2012 1 0 1 1 2013 1 0 1 1 2014 1 0 1 1 2015 1 0 1 1 2016 1 0 1 1 2017 1 0 1 1 2018 1 0 1 1 2019 1 0 1 1 2020 1 0 1 2 2004 1 0 0 2 2005 1 0 0 2 2006 1 0 0 2 2007 1 0 0 2 2008 1 0 0 2 2009 1 0 0 2 2010 1 0 0 2 2011 1 0 0 2 2012 1 1 0 2 2013 1 0 0 2 2014 1 1 0 2 2015 1 1 0 2 2016 1 1 0 2 2017 1 1 0 2 2018 1 1 0 2 2019 1 1 0 2 2020 1 1 0 3 2004 1 0 0 3 2005 1 0 0 3 2006 1 0 0 3 2007 1 0 0 3 2008 1 0 0 3 2009 1 0 0 3 2010 1 0 0 3 2011 1 0 0 3 2012 1 0 0 3 2013 1 0 0 3 2014 1 0 0 3 2015 1 0 0 3 2016 1 0 0 3 2017 1 0 0 3 2018 1 0 0 3 2019 1 0 0 3 2020 1 0 0 . . . . . end
Code:
input byte id int year byte(msa gro_2 gro_4 gro_6 gro_8 gro_10) 1 2004 1 1 0 6 4 5 1 2005 1 1 0 5 4 6 1 2006 1 1 0 5 4 6 1 2007 1 1 0 4 4 6 1 2008 1 1 0 5 4 7 1 2009 1 1 0 5 4 7 1 2010 1 1 0 5 4 7 1 2011 1 1 0 5 4 7 1 2012 1 1 0 5 4 7 1 2013 1 1 0 4 4 9 1 2014 1 1 0 4 4 9 1 2015 1 1 0 4 4 10 1 2016 1 1 0 4 5 10 1 2017 1 1 0 4 4 10 1 2018 1 1 0 4 4 10 1 2019 1 1 0 4 4 10 1 2020 1 1 0 4 4 10 2 2004 1 3 0 2 4 5 2 2005 1 2 0 4 4 5 2 2006 1 2 0 4 4 5 2 2007 1 1 0 4 4 5 2 2008 1 2 0 4 4 5 2 2009 1 2 0 4 4 5 2 2010 1 2 0 4 4 5 2 2011 1 2 0 4 4 4 2 2012 1 2 0 4 4 4 2 2013 1 2 0 5 3 4 2 2014 1 2 0 5 3 4 2 2015 1 2 0 5 3 4 2 2016 1 2 1 5 3 4 2 2017 1 2 0 5 3 4 2 2018 1 2 0 5 3 4 2 2019 1 2 0 5 3 4 2 2020 1 2 0 5 3 4 3 2004 1 3 11 5 12 6 3 2005 1 0 0 0 0 0 3 2006 1 0 0 0 0 0 3 2007 1 3 12 4 13 7 3 2008 1 3 13 5 13 8 3 2009 1 3 13 5 14 8 3 2010 1 3 13 4 14 8 3 2011 1 3 13 4 14 8 3 2012 1 3 13 4 15 8 3 2013 1 2 13 7 13 9 3 2014 1 3 13 8 14 9 3 2015 1 3 13 8 14 9 3 2016 1 3 13 8 14 9 3 2017 1 3 13 8 14 9 3 2018 1 3 13 8 14 9 3 2019 1 3 14 8 14 9 3 2020 1 3 14 8 14 9 . . . . . . . . end

Comment