I have a panel data with 90 companies across 5 years. I have the financial variables for each firm each year and a dummy variable Invest equal to 1 if the firm has received an investment. I want to compute the probability for a firm i to go from in category 1 to switch to category 2, knowing that there are 2 categories (high revenue and low revenue firms).
I did some research and it appears that Markov switching model is the correct one to use. Could you please confirm that?
I am not sure how to run this kind of analysis on stata. Could you please help ? How should I organise my data and what is the correct function to use ?
This is a sample of my data thanks
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str12 Country str116 Company int FiscalYear byte Invest float(Currentassets_n CashandCashEquivalents_n NetCash_n EBITDA_n Netsalesrevenue_n GrossProfitMargin_n) "Mauritius" "Abc Motors Company Limited" 2014 0 19.98 0 -22.28 . 44.82 100 "Mauritius" "Abc Motors Company Limited" 2015 0 19.61 0 -27.88 . 52.63 100 "Mauritius" "Abc Motors Company Limited" 2016 0 25.27 0 -34.43 . 51.77 100 "Mauritius" "Abc Motors Company Limited" 2017 0 24.85 0 -33.07 . 51.55 100 "Mauritius" "Abc Motors Company Limited" 2018 0 26.34 0 -36.42 . 55.11 100 "Mauritius" "Abc Motors Company Limited" 2019 0 28.78 0 -36.19 . 56.7 100 "Egypt" "Abu Qir Fertilizers & Chemical Industries Co S.A.E (??? ??? ??????? ????????? ?????????)" 2014 0 561.73 26.48 -224.35 . 513.37 38.72 "Egypt" "Abu Qir Fertilizers & Chemical Industries Co S.A.E (??? ??? ??????? ????????? ?????????)" 2015 0 443.09 105.2 -138.66 147.43 481.37 38.93 "Egypt" "Abu Qir Fertilizers & Chemical Industries Co S.A.E (??? ??? ??????? ????????? ?????????)" 2016 0 388.63 98.24 -115.53 131.77 482.81 35.45 "Egypt" "Abu Qir Fertilizers & Chemical Industries Co S.A.E (??? ??? ??????? ????????? ?????????)" 2017 0 285.6 62.88 -91.67 120.38 406.28 35.73 "Egypt" "Abu Qir Fertilizers & Chemical Industries Co S.A.E (??? ??? ??????? ????????? ?????????)" 2018 0 342.22 46.47 -121.66 137.61 425.51 36.67 "Egypt" "Abu Qir Fertilizers & Chemical Industries Co S.A.E (??? ??? ??????? ????????? ?????????)" 2019 0 454.36 24.14 -135.94 171.37 487.14 41.1 "Nigeria" "Academy Press Plc" 2014 0 7.21 .09 -19.13 2.87 15.08 25.13 "Nigeria" "Academy Press Plc" 2015 0 5.49 .09 -17.37 4.2 14.17 43.42 "Nigeria" "Academy Press Plc" 2016 0 6.55 .14 -14.82 2.71 10.42 45.24 "Nigeria" "Academy Press Plc" 2017 0 3.82 .12 -9.69 1.23 7.56 37.1 "Nigeria" "Academy Press Plc" 2018 0 3.55 .2 -7.73 1.98 7.13 40.7 "Nigeria" "Academy Press Plc" 2019 0 3.92 .07 -7.61 1.2 7.95 35.01 "South Africa" "Acsion Limited" 2014 0 22.47 20.16 -63.67 . 0 . "South Africa" "Acsion Limited" 2015 0 3.61 1.46 -72.73 6.06 9.8 100 "South Africa" "Acsion Limited" 2016 0 2.39 1.01 -78.06 21.51 33.56 100 "South Africa" "Acsion Limited" 2017 0 3.44 1.27 -96.63 24.9 36.79 100 "South Africa" "Acsion Limited" 2018 0 20.78 18.06 -132.52 30.11 44.71 100 "South Africa" "Acsion Limited" 2019 0 12.04 5.35 -172.2 34.28 48.1 100 "South Africa" "Adapt It Holdings Limited" 2014 0 10.5 1.5 -9.21 5.37 39.1 45.45 "South Africa" "Adapt It Holdings Limited" 2015 0 12.57 2.37 -18.51 9.06 50.28 50.96 "South Africa" "Adapt It Holdings Limited" 2016 0 17.58 5.26 -28.6 11.78 54.94 60.96 "South Africa" "Adapt It Holdings Limited" 2017 0 27.19 7.5 -23.5 14.36 73.02 62.17 "South Africa" "Adapt It Holdings Limited" 2018 0 28.49 6.3 -41.89 19.61 102.97 60.17 "South Africa" "Adapt It Holdings Limited" 2019 0 32.81 4.13 -62.19 16.48 100.35 56.05 "South Africa" "Adcock Ingram Holdings Limited" 2014 0 251.2 23.35 -221.4 6.08 347.93 35.87 "South Africa" "Adcock Ingram Holdings Limited" 2015 0 232.15 12.04 -191.71 69.01 483.13 43.04 "South Africa" "Adcock Ingram Holdings Limited" 2016 0 234.43 13.59 -147.78 53.7 410.56 40.44 "South Africa" "Adcock Ingram Holdings Limited" 2017 0 254.28 45.26 -108.45 66.15 444.94 40.7 "South Africa" "Adcock Ingram Holdings Limited" 2018 0 263.25 29.44 -151.6 83.37 508.16 41.82 "South Africa" "Adcock Ingram Holdings Limited" 2019 0 251.52 31.68 -106.07 85.44 505.17 41.57 "South Africa" "Adcorp Holdings Limited" 2014 0 235.86 44 -211.95 42.91 1178.34 16.99 "South Africa" "Adcorp Holdings Limited" 2015 0 262.38 59.12 -200.67 54.59 1215.45 17.33 "South Africa" "Adcorp Holdings Limited" 2016 0 231.82 52.42 -210.77 46.62 1153.92 16.15 "South Africa" "Adcorp Holdings Limited" 2017 1 233.91 41.4 -208.61 19.39 1126.88 14.88 "South Africa" "Adcorp Holdings Limited" 2018 1 237.94 30.61 -196.15 25.41 1179.62 14.59 "South Africa" "Adcorp Holdings Limited" 2019 1 189.72 26.29 -154 34.24 1111.77 13.49 "South Africa" "Adrenna Property Group Limited" 2014 0 1.02 .01 -12.2 1.23 3.07 90.52 "South Africa" "Adrenna Property Group Limited" 2015 0 .47 .01 -9.98 . 2.39 83.52 "South Africa" "Adrenna Property Group Limited" 2016 0 .57 .07 -8.49 . 1.72 100 "South Africa" "Adrenna Property Group Limited" 2017 0 .73 .02 -7.39 . 1.83 100 "South Africa" "Adrenna Property Group Limited" 2018 0 1.61 .54 -8.03 1.29 2.1 100 "South Africa" "Adrenna Property Group Limited" 2019 0 .97 .34 -9.11 .73 2.05 100 "South Africa" "Advanced Health Ltd (AVL)" 2014 0 15.55 13.56 8.15 2.58 14.99 50.92 "South Africa" "Advanced Health Ltd (AVL)" 2015 0 11.68 9.42 4.15 2.62 15.74 55.3 "South Africa" "Advanced Health Ltd (AVL)" 2016 0 7.44 3.58 -9.84 -.3 16.64 50.9 "South Africa" "Advanced Health Ltd (AVL)" 2017 1 6.78 3.09 -15.61 -1.68 22.71 49.9 "South Africa" "Advanced Health Ltd (AVL)" 2018 1 7.04 3.01 -17.59 -.63 31.8 51.3 "South Africa" "Advanced Health Ltd (AVL)" 2019 1 7.53 3.2 -19.46 .79 34.29 52.98 "Mauritius" "Africa Clean Energy Solutions Limited" 2019 0 .5 .01 -.56 . 0 . "South Africa" "African & Overseas Enterprises Limited" 2014 0 14.58 5.53 .12 .09 47.36 49.24 "South Africa" "African & Overseas Enterprises Limited" 2015 0 14.37 6.68 1.45 4.92 45.1 61.62 "South Africa" "African & Overseas Enterprises Limited" 2016 0 12.59 5.73 .37 2.27 37.1 58.08 "South Africa" "African & Overseas Enterprises Limited" 2017 0 13.07 4.58 -.73 1.81 38.86 59.96 "South Africa" "African & Overseas Enterprises Limited" 2018 0 14.04 5.06 -.54 3.08 45.66 59.01 "South Africa" "African & Overseas Enterprises Limited" 2019 0 12.62 3.93 -7.85 5.33 47.87 56.03 "South Africa" "African Dawn Capital Limited" 2014 0 8.42 .5 -5.79 -4.27 .96 100 "South Africa" "African Dawn Capital Limited" 2015 0 6.86 1.34 -4.53 -4.05 1.53 98.4 "South Africa" "African Dawn Capital Limited" 2016 0 3.57 .19 -3.44 -1.95 1 93.76 "South Africa" "African Dawn Capital Limited" 2017 0 3.77 .15 -3.26 -1.67 1.12 97.7 "South Africa" "African Dawn Capital Limited" 2018 0 1.98 .04 -1.24 -1.85 .61 98.36 "South Africa" "African Dawn Capital Limited" 2019 0 1.27 .17 -.71 -1.29 .26 100 "Zimbabwe" "African Distillers Limited" 2014 1 13.32 .45 -5.99 3.46 23.95 49.12 "Zimbabwe" "African Distillers Limited" 2015 1 11.27 .51 -6.76 4.95 25.07 55.25 "Zimbabwe" "African Distillers Limited" 2016 1 11.19 2.54 -3.51 3.68 22.04 54.79 "Zimbabwe" "African Distillers Limited" 2017 1 16.55 4.25 -3.93 5 24.89 52.49 "Zimbabwe" "African Distillers Limited" 2018 1 30.78 2.83 -14.34 8.16 30.59 55.6 "Zimbabwe" "African Distillers Limited" 2019 1 59.68 11.86 -8.9 26.27 60.55 68.18 "South Africa" "African Media Entertainment Limited" 2014 0 15.46 10.03 1.85 6.35 23.93 74.32 "South Africa" "African Media Entertainment Limited" 2015 0 15.22 8.65 -.37 6.71 22.99 76.03 "South Africa" "African Media Entertainment Limited" 2016 0 10.8 7.66 2.38 5.31 17.28 76.04 "South Africa" "African Media Entertainment Limited" 2017 0 12.46 8.85 3.11 5.06 16.97 74.99 "South Africa" "African Media Entertainment Limited" 2018 0 12.84 8 .61 5.12 20.19 69.91 "South Africa" "African Media Entertainment Limited" 2019 0 9.39 5.51 .75 4.94 19.89 79.02 "South Africa" "African Rainbow Minerals Limited" 2014 0 601.22 202.57 -587.92 577.24 962.77 36.04 "South Africa" "African Rainbow Minerals Limited" 2015 0 461.99 184.39 -534.92 258.15 809.5 26.51 "South Africa" "African Rainbow Minerals Limited" 2016 0 307.06 17.07 -710.36 153.82 603.47 24.05 "South Africa" "African Rainbow Minerals Limited" 2017 0 325.11 29.74 -574.42 373.67 643.57 15.06 "South Africa" "African Rainbow Minerals Limited" 2018 0 460.15 157.17 -370.39 553.83 674.88 29.21 "South Africa" "African Rainbow Minerals Limited" 2019 0 571.43 240.09 -290.21 392.17 622.88 15.68 "South Africa" "Afrimat Limited" 2014 0 48.4 8.61 -54.82 33.7 189.01 29.05 "South Africa" "Afrimat Limited" 2015 0 43.69 6.79 -49.28 31.49 181.18 29.73 "South Africa" "Afrimat Limited" 2016 1 34.34 7.26 -37.42 29.48 145.84 31.49 "South Africa" "Afrimat Limited" 2017 1 57.61 18.8 -61.15 34.77 155.03 48.71 "South Africa" "Afrimat Limited" 2018 1 64.14 9.53 -91.14 36.36 181.87 48.96 "South Africa" "Afrimat Limited" 2019 1 64.62 13.74 -80.12 47.21 214.17 46.04 "South Africa" "Afrocentric Investment Corporation Limited" 2014 0 64.02 36.69 -4.59 45.97 188.46 100 "South Africa" "Afrocentric Investment Corporation Limited" 2015 0 46.54 27.29 -7.38 33.39 183.37 100 "South Africa" "Afrocentric Investment Corporation Limited" 2016 0 57.62 25.27 -76.19 26.69 217.24 81.99 "South Africa" "Afrocentric Investment Corporation Limited" 2017 0 87.27 27.65 -24.11 38.72 278.11 77.89 "South Africa" "Afrocentric Investment Corporation Limited" 2018 0 59.94 15.49 -23.1 49.52 327.32 78.05 "South Africa" "Afrocentric Investment Corporation Limited" 2019 0 76.73 18.75 -91.8 55.74 373.47 70.45 "South Africa" "Ah-Vest Limited" 2014 0 2.93 0 -3.91 -.94 11.91 32.03 "South Africa" "Ah-Vest Limited" 2015 0 2.77 .17 -4.6 .64 12.3 44.41 "South Africa" "Ah-Vest Limited" 2016 0 1.8 .05 -3.46 .39 9.82 33.75 end
0 Response to Markov switching model with panel data
Post a Comment