I use Stata 14. I have a panel dataset. I want to estimate for each id/country in the panel dataset.
The syntax of -mswitch- is
Code:
mswitch dr depvar [nonswitch_varlist] [if] [in] [, options]
Code:
mswitch dr gcf if id==1, switch(gds)
sample may not include multiple panels
r(459);
r(459);
Code:
clear all input year gcf gds id 1970 24.4401 25.3058 1 1971 24.113 23.5123 1 1972 23.8915 24.2514 1 1973 20.8938 22.797 1 1974 22.2603 22.8739 1 1975 29.441 29.2862 1 1976 30.7294 33.9832 1 1977 30.9417 33.2312 1 1978 27.8002 30.6931 1 1979 25.8568 26.038 1 1980 25.2578 23.8361 1 1981 22.6911 22.2402 1 1982 21.7549 24.3244 1 1983 20.8878 24.2031 1 1984 19.9641 22.7975 1 1985 17.5891 23.0518 1 1986 17.4618 19.2997 1 1987 19.5549 19.8523 1 1988 18.64 21.9598 1 1989 15.5147 21.9936 1 1990 13.997 19.7252 1 1991 14.637 16.234 1 1992 16.7024 15.1678 1 1993 19.6881 17.2837 1 1994 19.9656 16.8912 1 1995 18.5004 18.0898 1 1996 19.6239 18.9746 1 1997 20.8261 18.6116 1 1998 20.9708 18.4519 1 1999 17.8629 16.1345 1 2000 17.5335 16.8838 1 2001 15.626 16.9317 1 2002 10.8539 25.8663 1 2003 14.147 25.3641 1 2004 17.5513 24.5539 1 2005 18.8883 24.8287 1 2006 18.6805 24.3004 1 2007 20.0991 24.4794 1 2008 19.5728 23.2919 1 2009 16.0531 21.118 1 2010 17.7055 20.6022 1 2011 18.3985 20.0907 1 2012 16.502 18.4512 1 2013 17.3058 17.2062 1 2014 17.2629 17.667 1 2015 17.0707 15.9958 1 2016 17.027 16.0728 1 1970 33.0302 32.6584 2 1971 32.1507 31.5676 2 1972 30.4769 30.9131 2 1973 28.4367 30.8837 2 1974 30.6222 31.9681 2 1975 26.8495 27.2389 2 1976 26.4694 26.2507 2 1977 27.0078 25.7491 2 1978 25.8578 24.2256 2 1979 27.8961 25.8894 2 1980 27.1315 26.7765 2 1981 28.7249 26.0932 2 1982 29.8832 26.0973 2 1983 25.3424 22.185 2 1984 26.6757 24.7847 2 1985 28.0719 25.797 2 1986 28.5564 24.5973 2 1987 27.4192 24.2044 2 1988 28.0229 26.5603 2 1989 29.6652 28.1336 2 1990 28.9971 27.609 2 1991 24.266 24.6199 2 1992 22.3902 22.0242 2 1993 23.6479 22.8305 2 1994 24.3169 23.9467 2 1995 26.047 24.0792 2 1996 24.8513 24.3973 2 1997 24.9167 25.1915 2 1998 25.691 24.8117 2 1999 26.2287 23.7805 2 2000 26.32 24.1593 2 2001 23.4898 23.5761 2 2002 24.5032 24.4951 2 2003 26.0271 23.9203 2 2004 27.1452 24.4285 2 2005 27.526 24.7821 2 2006 27.5974 25.7799 2 2007 27.5122 25.8658 2 2008 28.6065 26.0559 2 2009 27.3251 27.5371 2 2010 26.7663 25.7351 2 2011 26.4142 27.382 2 2012 27.6497 27.4007 2 2013 27.8095 26.5114 2 2014 26.6506 26.2223 2 2015 26.1433 24.6219 2 2016 25.2955 23.0301 2 end
0 Response to Help on -mswitch- command to estimate Markov Switching Regression Models
Post a Comment