Hi All,
I am using Stata 18 and I'm still in the stata use growth process. I am trying to generate a shift-share instrumental variable. The variable is given as;
IV = (∑_(x∈N,x≠i)〖DEPTHext Exp_est/Exp_xst 〗)/K_et
I need to find four things;
1. DEPTH_ext: The highest enforceable depth (Depth_Core_Enf) of previous FTAs (in force before the enforcement of the current FTA. FTAs are identified by ID), that include environmental provisions (EnvProvs) with all other third parties (i.e other importers apart from the bilateral importer)
2. Exp_est: This is the export value of the exporter in a particular year (Exports) at the sectoral level (HS4_Green)
3. Exp_xst: The is the sum of the export values of all other third party exporters in a particular year (Exports) at the sectoral level (HS4_Green)
4. K_et: This is the number of dimensions of environmental provisions in FTAs that the exporter has signed with third party countries in a particular year.
N:B: I put the variable names in bracket.
I provide a data example below of the data.
Please any recommendations on how to proceed?
I am using Stata 18 and I'm still in the stata use growth process. I am trying to generate a shift-share instrumental variable. The variable is given as;
IV = (∑_(x∈N,x≠i)〖DEPTHext Exp_est/Exp_xst 〗)/K_et
I need to find four things;
1. DEPTH_ext: The highest enforceable depth (Depth_Core_Enf) of previous FTAs (in force before the enforcement of the current FTA. FTAs are identified by ID), that include environmental provisions (EnvProvs) with all other third parties (i.e other importers apart from the bilateral importer)
2. Exp_est: This is the export value of the exporter in a particular year (Exports) at the sectoral level (HS4_Green)
3. Exp_xst: The is the sum of the export values of all other third party exporters in a particular year (Exports) at the sectoral level (HS4_Green)
4. K_et: This is the number of dimensions of environmental provisions in FTAs that the exporter has signed with third party countries in a particular year.
N:B: I put the variable names in bracket.
I provide a data example below of the data.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int Year str44 Exporter int ExpCode str44 Importer int ImpCode str4 HS4_Green double Export int(ID Year_Force) byte(Depth_Core_Enf FTA) float EnvProvs_Present 2002 "Afghanistan" 4 "Nigeria" 566 "0101" 1020 . . 0 0 0 2002 "Afghanistan" 4 "Switzerland" 757 "0101" 10609 . . 0 0 0 2005 "Afghanistan" 4 "Canada" 124 "0101" 8256 . . 0 0 0 2005 "Afghanistan" 4 "Gambia" 270 "0101" 3030 . . 0 0 0 2005 "Afghanistan" 4 "India" 699 "0101" 1158 180 2003 2 1 1 2007 "Afghanistan" 4 "Fmr Sudan" 736 "0101" 780 . . 0 0 0 2016 "Afghanistan" 4 "Czechia" 203 "0101" 98 . . 0 0 0 2002 "Albania" 8 "Greece" 300 "0101" 666 . . 0 0 0 2006 "Albania" 8 "Malta" 470 "0101" 23 121 2006 12 1 1 2008 "Albania" 8 "Nigeria" 566 "0101" 26 . . 0 0 0 2008 "Albania" 8 "Thailand" 764 "0101" 1149 . . 0 0 0 2013 "Albania" 8 "France" 251 "0101" 663993 121 2006 12 1 1 2016 "Albania" 8 "Czechia" 203 "0101" 51 121 2006 12 1 1 2001 "Algeria" 12 "Niger" 562 "0101" 245 . . 0 0 0 2002 "Algeria" 12 "Germany" 276 "0101" 11000 . . 0 0 0 2003 "Algeria" 12 "France" 251 "0101" 6786 . . 0 0 0 2004 "Algeria" 12 "France" 251 "0101" 1244 . . 0 0 0 2005 "Algeria" 12 "Brazil" 76 "0101" 48500 19 1989 1 1 0 2005 "Algeria" 12 "France" 251 "0101" 3733 114 2005 10 1 1 2006 "Algeria" 12 "France" 251 "0101" 13811 114 2005 10 1 1 2008 "Algeria" 12 "France" 251 "0101" 50099 114 2005 10 1 1 2008 "Algeria" 12 "Nigeria" 566 "0101" 13683 19 1989 1 1 0 2008 "Algeria" 12 "Spain" 724 "0101" 214 114 2005 10 1 1 2009 "Algeria" 12 "France" 251 "0101" 2776 114 2005 10 1 1 2010 "Algeria" 12 "France" 251 "0101" 5302 114 2005 10 1 1 2011 "Algeria" 12 "France" 251 "0101" 7618 114 2005 10 1 1 2012 "Algeria" 12 "France" 251 "0101" 71624 114 2005 10 1 1 2013 "Algeria" 12 "France" 251 "0101" 13280 114 2005 10 1 1 2013 "Algeria" 12 "Qatar" 634 "0101" 1319 118 1998 1 1 1 2014 "Algeria" 12 "France" 251 "0101" 8898 114 2005 10 1 1 2014 "Algeria" 12 "Germany" 276 "0101" 6112 114 2005 10 1 1 2015 "Algeria" 12 "France" 251 "0101" 91183 114 2005 10 1 1 2016 "Algeria" 12 "France" 251 "0101" 132346 114 2005 10 1 1 2000 "Andorra" 20 "France" 251 "0101" 702 38 1991 10 1 1 2000 "Andorra" 20 "Spain" 724 "0101" 167416 38 1991 10 1 1 2001 "Andorra" 20 "France" 251 "0101" 896 38 1991 10 1 1 2001 "Andorra" 20 "Spain" 724 "0101" 121202 38 1991 10 1 1 2001 "Andorra" 20 "Switzerland" 757 "0101" 5979 . . 0 0 0 2002 "Andorra" 20 "France" 251 "0101" 944 38 1991 10 1 1 2002 "Andorra" 20 "Spain" 724 "0101" 454 38 1991 10 1 1 2002 "Andorra" 20 "Thailand" 764 "0101" 5997 . . 0 0 0 2003 "Andorra" 20 "France" 251 "0101" 6786 38 1991 10 1 1 2003 "Andorra" 20 "Spain" 724 "0101" 1133 38 1991 10 1 1 2004 "Andorra" 20 "France" 251 "0101" 3732 38 1991 10 1 1 2004 "Andorra" 20 "Spain" 724 "0101" 112124 38 1991 10 1 1 2005 "Andorra" 20 "Albania" 8 "0101" 8028 . . 0 0 0 2005 "Andorra" 20 "France" 251 "0101" 7466 38 1991 10 1 1 2005 "Andorra" 20 "Spain" 724 "0101" 128322 38 1991 10 1 1 2006 "Andorra" 20 "Cuba" 192 "0101" 17012 . . 0 0 0 2006 "Andorra" 20 "France" 251 "0101" 2511 38 1991 10 1 1 2006 "Andorra" 20 "Spain" 724 "0101" 144900 38 1991 10 1 1 2007 "Andorra" 20 "France" 251 "0101" 1373 38 1991 10 1 1 2007 "Andorra" 20 "Spain" 724 "0101" 107322 38 1991 10 1 1 2008 "Andorra" 20 "Spain" 724 "0101" 887 38 1991 10 1 1 2009 "Andorra" 20 "France" 251 "0101" 1388 38 1991 10 1 1 2009 "Andorra" 20 "Slovakia" 703 "0101" 140 38 1991 10 1 1 2009 "Andorra" 20 "Spain" 724 "0101" 102614 38 1991 10 1 1 2010 "Andorra" 20 "France" 251 "0101" 6627 38 1991 10 1 1 2010 "Andorra" 20 "Spain" 724 "0101" 57747 38 1991 10 1 1 2010 "Andorra" 20 "Switzerland" 757 "0101" 4050 . . 0 0 0 2011 "Andorra" 20 "France" 251 "0101" 1809 38 1991 10 1 1 2011 "Andorra" 20 "Spain" 724 "0101" 49206 38 1991 10 1 1 2011 "Andorra" 20 "Switzerland" 757 "0101" 4676 . . 0 0 0 2011 "Andorra" 20 "Thailand" 764 "0101" 6028 . . 0 0 0 2012 "Andorra" 20 "Andorra" 20 "0101" 2121 . . 0 0 0 2012 "Andorra" 20 "France" 251 "0101" 3022 38 1991 10 1 1 2012 "Andorra" 20 "Spain" 724 "0101" 579 38 1991 10 1 1 2013 "Andorra" 20 "France" 251 "0101" 1594 38 1991 10 1 1 2013 "Andorra" 20 "Spain" 724 "0101" 398 38 1991 10 1 1 2014 "Andorra" 20 "France" 251 "0101" 2417 38 1991 10 1 1 2014 "Andorra" 20 "Spain" 724 "0101" 796 38 1991 10 1 1 2015 "Andorra" 20 "Nepal" 524 "0101" 29 . . 0 0 0 2015 "Andorra" 20 "Spain" 724 "0101" 58926 38 1991 10 1 1 2016 "Andorra" 20 "Czechia" 203 "0101" 21 38 1991 10 1 1 2016 "Andorra" 20 "Spain" 724 "0101" 41358 38 1991 10 1 1 2017 "Andorra" 20 "France" 251 "0101" 564 38 1991 10 1 1 2017 "Andorra" 20 "Spain" 724 "0101" 64572 38 1991 10 1 1 2000 "Angola" 24 "Namibia" 516 "0101" 136 . . 0 0 0 2001 "Angola" 24 "Namibia" 516 "0101" 220 . . 0 0 0 2002 "Angola" 24 "Namibia" 516 "0101" 134 . . 0 0 0 2008 "Angola" 24 "Mauritius" 480 "0101" 5750 95 2000 9 1 1 2014 "Angola" 24 "Sao Tome and Principe" 678 "0101" 743 . . 0 0 0 2000 "Antigua and Barbuda" 28 "Montserrat" 500 "0101" 3545 9 1973 9 1 1 2003 "Antigua and Barbuda" 28 "United Kingdom" 826 "0101" 7842 . . 0 0 0 2005 "Antigua and Barbuda" 28 "Barbados" 52 "0101" 14400 . . 0 0 0 2005 "Antigua and Barbuda" 28 "Canada" 124 "0101" 72400 . . 0 0 0 2005 "Antigua and Barbuda" 28 "USA" 842 "0101" 6945 . . 0 0 0 2006 "Antigua and Barbuda" 28 "Dominica" 212 "0101" 889 9 1973 9 1 1 2006 "Antigua and Barbuda" 28 "Saint Lucia" 662 "0101" 1488 9 1973 9 1 1 2008 "Antigua and Barbuda" 28 "Switzerland" 757 "0101" 15860 . . 0 0 0 2009 "Antigua and Barbuda" 28 "Slovakia" 703 "0101" 175 . . 0 0 0 2009 "Antigua and Barbuda" 28 "Switzerland" 757 "0101" 6954 . . 0 0 0 2010 "Antigua and Barbuda" 28 "Barbados" 52 "0101" 13000 . . 0 0 0 2011 "Antigua and Barbuda" 28 "South Africa" 710 "0101" 117195 . . 0 0 0 2016 "Antigua and Barbuda" 28 "Ghana" 288 "0101" 38513 . . 0 0 0 2004 "Azerbaijan" 31 "Russian Federation" 643 "0101" 800 218 1993 5 1 1 2005 "Azerbaijan" 31 "Turkey" 792 "0101" 6784 . . 0 0 0 2006 "Azerbaijan" 31 "Bulgaria" 100 "0101" 2856 . . 0 0 0 2006 "Azerbaijan" 31 "Kazakhstan" 398 "0101" 12220 45 1994 10 1 1 2007 "Azerbaijan" 31 "Georgia" 268 "0101" 13171 45 1994 10 1 1 end
Please any recommendations on how to proceed?