Dear All,
I have a panel of a large number of countries (130). Since the task has to be done manually, I was wondering if there is any way to generate the variables I want. In the dataex, given below, variables to be generated are "low_regime" and "high_regime".
low_regime if fprob is 0. For "Chile", we can see that fprob is 0 from 2004 to 2011.
high_regime if fprob is 1. For "Chile", we can see that fprob is 0 from 1990 to 2003 and 2012-2018.
The year range (2012-2018) captures the continuous 1s or 0s.
For "Canada", we can see that two-year ranges are there in each regime (low_regime high_regime)
I would be grateful if you can help me with this.
Thank you.
I have a panel of a large number of countries (130). Since the task has to be done manually, I was wondering if there is any way to generate the variables I want. In the dataex, given below, variables to be generated are "low_regime" and "high_regime".
low_regime if fprob is 0. For "Chile", we can see that fprob is 0 from 2004 to 2011.
high_regime if fprob is 1. For "Chile", we can see that fprob is 0 from 1990 to 2003 and 2012-2018.
The year range (2012-2018) captures the continuous 1s or 0s.
For "Canada", we can see that two-year ranges are there in each regime (low_regime high_regime)
I would be grateful if you can help me with this.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str6 country int year byte(id fprob) str20(low_regime high_regime) "Chile" 1990 1 1 "2004-2011" "1990-2003; 2012-2018" "Chile" 1991 1 1 "" "" "Chile" 1992 1 1 "" "" "Chile" 1993 1 1 "" "" "Chile" 1994 1 1 "" "" "Chile" 1995 1 1 "" "" "Chile" 1996 1 1 "" "" "Chile" 1997 1 1 "" "" "Chile" 1998 1 1 "" "" "Chile" 1999 1 1 "" "" "Chile" 2000 1 1 "" "" "Chile" 2001 1 1 "" "" "Chile" 2002 1 1 "" "" "Chile" 2003 1 1 "" "" "Chile" 2004 1 0 "" "" "Chile" 2005 1 0 "" "" "Chile" 2006 1 0 "" "" "Chile" 2007 1 0 "" "" "Chile" 2008 1 0 "" "" "Chile" 2009 1 0 "" "" "Chile" 2010 1 0 "" "" "Chile" 2011 1 0 "" "" "Chile" 2012 1 1 "" "" "Chile" 2013 1 1 "" "" "Chile" 2014 1 1 "" "" "Chile" 2015 1 1 "" "" "Chile" 2016 1 1 "" "" "Chile" 2017 1 1 "" "" "Chile" 2018 1 1 "" "" "Canada" 1990 2 0 "1990-1991; 1994-2008" "1992-1993; 2009-2018" "Canada" 1991 2 0 "" "" "Canada" 1992 2 1 "" "" "Canada" 1993 2 1 "" "" "Canada" 1994 2 0 "" "" "Canada" 1995 2 0 "" "" "Canada" 1996 2 0 "" "" "Canada" 1997 2 0 "" "" "Canada" 1998 2 0 "" "" "Canada" 1999 2 0 "" "" "Canada" 2000 2 0 "" "" "Canada" 2001 2 0 "" "" "Canada" 2002 2 0 "" "" "Canada" 2003 2 0 "" "" "Canada" 2004 2 0 "" "" "Canada" 2005 2 0 "" "" "Canada" 2006 2 0 "" "" "Canada" 2007 2 0 "" "" "Canada" 2008 2 0 "" "" "Canada" 2009 2 1 "" "" "Canada" 2010 2 1 "" "" "Canada" 2011 2 1 "" "" "Canada" 2012 2 1 "" "" "Canada" 2013 2 1 "" "" "Canada" 2014 2 1 "" "" "Canada" 2015 2 1 "" "" "Canada" 2016 2 1 "" "" "Canada" 2017 2 1 "" "" "Canada" 2018 2 1 "" "" end
Comment