Dear Statalisters,
I am trying to analyze the relationship between corruption and the distribution of government spending (Similar to Mauro 1998 - Corruption and the composition of government expenditure). I have compiled a panel dataset covering 15 years (2002 to 2016) and 70 countries. I run a regression for each of the ten COFOG categories for Government Spending as shares of total expenditure as the dependent variables. My main explanatory variable is the respective country's Corruption Perceptions Index (CPI) score. As reverse causality between corruption and government expenditure is highly likely, I use IV regression. I calculated my IV using the distance weighted corruption scores for all neighboring countries. The simple correlation between my IV and the CPI is quite high at 0.786.
To make use of my panel data I employ country and time fixed effects. As well I use heteroskedasticity robust and country and year clustered standard errors.
Now to the problem: When I run my regressions using xtivreg2 with the "fe" option respective ivreg2 with the "gmm2s" option specified, Stata gives me hugely different results: With gmm2s almost all of my coefficients are highly significant, with fe only one is significant at the 10% level. I enclose a pdf with my results tables. I installed both xtivreg2 and ivreg2 from SSC and they are up-to-date.
From everything I read, I understand that GMM and IV/2SLS estimators are basically the same, or rather that IV/2SLS is just a type of GMM. Furthermore, in every paper I read, both methods lead to similar results.
I coded my regression as follows:
Before I tsset on ID (i.e. Country) and year. I run the code in a for loop, hence the 'var` for the dependent variables.
I have been trying to understand what is going on but have been really stuck for a while now. I am not sure whether I coded it wrong or if I made a methodological error?
I am using Stata13 on a Windows10 machine. Here is an example of my data:
Many thanks in advance for your kind advice!
Jan Schaeffer
I am trying to analyze the relationship between corruption and the distribution of government spending (Similar to Mauro 1998 - Corruption and the composition of government expenditure). I have compiled a panel dataset covering 15 years (2002 to 2016) and 70 countries. I run a regression for each of the ten COFOG categories for Government Spending as shares of total expenditure as the dependent variables. My main explanatory variable is the respective country's Corruption Perceptions Index (CPI) score. As reverse causality between corruption and government expenditure is highly likely, I use IV regression. I calculated my IV using the distance weighted corruption scores for all neighboring countries. The simple correlation between my IV and the CPI is quite high at 0.786.
To make use of my panel data I employ country and time fixed effects. As well I use heteroskedasticity robust and country and year clustered standard errors.
Now to the problem: When I run my regressions using xtivreg2 with the "fe" option respective ivreg2 with the "gmm2s" option specified, Stata gives me hugely different results: With gmm2s almost all of my coefficients are highly significant, with fe only one is significant at the 10% level. I enclose a pdf with my results tables. I installed both xtivreg2 and ivreg2 from SSC and they are up-to-date.
From everything I read, I understand that GMM and IV/2SLS estimators are basically the same, or rather that IV/2SLS is just a type of GMM. Furthermore, in every paper I read, both methods lead to similar results.
I coded my regression as follows:
Code:
ivreg2 `var' (CPI = IV), gmm2s cluster (ID year) robust savefirst
Code:
xtivreg2 `var' (CPI = IV), fe cluster (year ID) robust savefirst
I have been trying to understand what is going on but have been really stuck for a while now. I am not sure whether I coded it wrong or if I made a methodological error?
I am using Stata13 on a Windows10 machine. Here is an example of my data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str52 Country float year byte CPI float IV double(Def EA EP Edu GPS HCA Hlth POS RCR SP) "Afghanistan" 2002 . 13.502937 . . . . . . . . . . "Afghanistan" 2003 . 18.256355 . . . . . . . . . . "Afghanistan" 2004 . 21.43846 . . . . . . . . . . "Afghanistan" 2005 25 21.11627 . . . . . . . . . . "Afghanistan" 2006 . 22.192823 6.84630832558248 46.5880039094788 1.66911454846346 14.5592117941593 10.9662312663437 1.61546347510791 4.31095810530298 9.71345044339749 .972549272786926 2.75876155756912 "Afghanistan" 2007 18 21.07421 7.73539335967631 47.1101282966548 .368395470847833 10.8146920706438 10.8209650456363 3.20131998133724 6.15589888485298 9.05331624207382 1.22324399739208 3.51664665088456 "Afghanistan" 2008 15 20.85459 47.8218668018144 14.2715540287994 .155303665713179 4.86058590791011 3.13503225823767 1.16316377625054 2.56499195802473 23.6183402214321 .4273362114067 1.98182517041115 "Afghanistan" 2009 13 20.41347 42.1706361009489 14.3832480052546 .302205078482242 6.49249018389726 6.51945268257043 1.56872166647425 2.99976620035497 23.4258449744048 .502628677819409 1.6350093191469 "Afghanistan" 2010 14 19.918335 32.5085926672591 17.8422826624462 .135352782086689 6.39557980576893 6.10551240345088 .743801612919448 3.04431778828851 26.3746433497822 .457875592573258 6.39204133542459 "Afghanistan" 2011 15 21.06303 38.6247663147717 16.3221328596051 .380190783911167 5.14692144999987 6.39992579830307 .721719583846175 3.87748324249504 25.9549579068444 .438365768618009 2.13353629160537 "Afghanistan" 2012 8 21.667673 40.3969784083658 16.7650380299055 .408603790817356 6.48944774239507 7.90441554676573 .800284941128998 3.24378014947284 21.160031314141 .500400254550701 2.33101982245687 "Afghanistan" 2013 8 21.917454 46.5546897080793 14.2485296294801 .450150802950162 7.13206748119137 4.64059578767446 .543220500666209 2.73507253711256 21.771577771497 .450356865318098 1.47373462833609 "Afghanistan" 2014 12 22.546684 41.7984957954042 14.8772127536461 .314221019249529 7.96457023998253 5.47729125866935 .369797504383419 3.53929806239456 21.0581300567916 .405761355824917 4.19522195365377 "Afghanistan" 2015 11 24.23024 46.1164233069571 12.1715957260998 .16531831269788 7.28490510882091 5.060319108312 .520694510422267 2.72108057033441 22.9329579183658 .391425852258695 2.63527958573105 "Afghanistan" 2016 15 25.6007 37.3035001069052 15.9318979928737 .269838780622273 8.26023620713397 6.79074903268655 2.73897766352441 3.92739628011947 18.7185658670827 .597086047432034 5.46175202161988 "Albania" 2002 25 6.594713 . . . . . . . . . . "Albania" 2003 25 16.446033 . . . . . . . . . . "Albania" 2004 25 18.132002 . . . . . . . . . . "Albania" 2005 24 18.132002 3.60581622278706 11.2867961942622 0 11.3716508755551 24.6586154325117 6.05113059590345 9.31341061107304 6.10122132026769 1.34886412630922 26.2624946213306 "Albania" 2006 26 18.289017 4.42280875027065 15.2282009022408 0 10.7679859569293 21.5727127015723 5.64796204020895 8.24125759007432 6.2635800211516 1.26675222714221 26.5887398104097 "Albania" 2007 29 21.132 4.02462692801843 18.1492268259956 .030736636412457 11.0750175496421 19.042570714206 4.43687645297166 8.43992796887516 5.31210292167944 1.12711608812803 27.1088031291296 "Albania" 2008 34 22.55349 3.40580016908109 22.8246515195295 .0577530607225356 10.7907087218161 20.3772527926595 4.70522318710067 7.60096205034124 4.61074122560039 1.13799475962007 24.5023944692901 "Albania" 2009 32 21.98332 . . . . . . . . . . "Albania" 2010 33 22.776747 3.61728696690827 14.295138040557 .037462334066292 11.485734451774 19.7190324945028 6.34742242853653 8.86554279664468 5.24608410022532 1.0641474604338 27.7145261557673 "Albania" 2011 31 21.776745 3.34494701887437 14.1980639874626 .185978866588984 11.1068433591533 20.5774669900822 6.24145940775739 9.27542251930438 5.53056374300326 1.20586322875569 28.3333908790178 "Albania" 2012 33 23.776745 3.36459092559053 12.7949135098585 .124346162400934 11.6269949410275 19.2700829913816 6.01203558651293 9.86364261045901 5.58416214737468 1.26309939117122 30.0961290979273 "Albania" 2013 31 24.826303 3.42980908924066 10.392243493398 .159066614924018 11.5800327547777 20.8071420138291 6.25814682439259 9.62522538173046 5.24179350684102 1.03663433005858 31.4699110852596 "Albania" 2014 33 25.71885 2.79085141228179 11.5649797192095 .224410767202612 10.9884602842099 18.9412097842987 7.34805784646596 9.37606589851103 5.7875450934818 1.45216183221064 31.526257362128 "Albania" 2015 36 24.925425 2.41990236058681 13.8951282014849 .325414524297922 10.4410240987607 18.8953418071092 6.50455238753217 9.24666518805152 5.90590615787375 1.51891007306724 30.8471552012358 "Albania" 2016 39 22.50393 2.42979524119768 10.4784436506289 .641341192353308 10.8297873725573 19.6422861577714 5.95415407686172 9.82697287648183 5.98079417190399 1.49380308144698 32.7226221787969 "Armenia" 2002 . 23.558104 . . . . . . . . . . "Armenia" 2003 30 19.44727 . . . . . . . . . . "Armenia" 2004 31 21.00281 . . . . . . . . . . "Armenia" 2005 29 24.00281 . . . . . . . . . . "Armenia" 2006 29 27.78076 . . . . . . . . . . "Armenia" 2007 30 30.4486 . . . . . . . . . . "Armenia" 2008 29 33.116684 . . . . . . . . . . "Armenia" 2009 27 35.337635 . . . . . . . . . . "Armenia" 2010 26 34.00414 . . . . . . . . . . "Armenia" 2011 26 35.448105 . . . . . . . . . . "Armenia" 2012 34 43.33775 . . . . . . . . . . "Armenia" 2013 36 42.11559 15.3290451095954 12.2912651102813 1.34049443232767 8.7497508441792 18.8566114061854 2.67500414981889 5.4833096521036 7.70461668199534 2.25361066514991 25.3162919483632 "Armenia" 2014 37 43.5587 . . . . . . . . . . "Armenia" 2015 35 43.22471 . . . . . . . . . . "Armenia" 2016 33 46.22422 . . . . . . . . . . "Australia" 2002 86 . 4.64636865656006 11.919157151195 1.32518220319959 15.5220664162464 11.8959608506308 1.66751470346149 16.6957243980186 4.6620822795229 2.43374088984002 29.2318283174451 "Australia" 2003 88 . 5.14783281179512 11.7410544858254 1.40564693414297 15.5881447322253 11.4915038202376 1.65985205977759 17.0338916298487 4.78227868042477 2.41852904741105 28.7316238336997 "Australia" 2004 88 . 4.65109299184633 11.8086472245844 1.35894485851967 15.4839677855035 10.5971020292465 1.72510963266803 17.1383789371884 4.8958698080803 2.52480282793924 29.8160839044237 "Australia" 2005 88 . 4.72978645993675 11.2417166543835 1.49325671141461 15.7886553537389 10.8688689248987 1.7351879320478 17.9862491020869 4.77425453776521 2.41122710127216 28.9707972224554 "Australia" 2006 87 . 4.9036502756378 11.5997454309801 1.55589330187062 15.5906088442392 10.7831484608164 1.80000058120781 18.0255789556277 4.83187111135651 2.49977478197442 28.4097282562894 "Australia" 2007 86 . 5.06486311433947 11.8892067884796 1.74877486731632 15.0610358292763 10.8028466436316 1.84459081505113 17.9250762111484 5.078512872257 2.47676195625119 28.1080632599369 "Australia" 2008 87 . 4.79181158700189 12.4346616317202 1.75121733081586 15.0429792308457 10.3396104541389 2.04884229355063 18.3029414687469 5.07776011129882 2.4987578256981 27.711418066183 "Australia" 2009 87 . 4.86139202855443 11.8176410145476 1.78703152885187 14.7641555351252 9.73122059380239 1.89497593423828 17.5741712184306 4.72056676220864 2.32134551944189 30.5277161862528 "Australia" 2010 87 . 4.92874326816222 12.1018395268276 2.02046722923052 17.0788199999186 10.6762978250516 2.00011397820574 17.823138389895 4.77548328794558 2.43262056248245 26.1626794647909 "Australia" 2011 88 . 4.73144416725303 11.212489508402 2.28653838325686 17.0881720680224 11.0229138438695 1.77964639680241 18.3710061660551 4.80471574311528 2.41776816330645 26.285305559917 "Australia" 2012 85 . 4.54717827360008 11.6322147553118 2.56848753131301 15.3571415548757 11.8052339679194 1.4590861522642 18.931109547233 4.73824690880848 2.33657979850281 26.6249038275715 "Australia" 2013 81 . 4.54379195593551 11.4713623845315 2.6435825348557 15.5233375408801 11.4132695507488 1.41950915141431 18.8421596190258 4.67970049916805 2.27530265649205 27.1879841069482 "Australia" 2014 80 . 4.57732578904825 11.6893126235758 2.58302330787621 14.9941811482876 11.9312948269468 1.41139196161096 18.5112967751086 4.5713445905186 2.22603120134936 27.5047977756777 "Australia" 2015 79 . 4.80806224793038 11.3638625026534 1.99350589046911 14.8430866588835 12.0490938760348 1.44674697516451 18.5045637868818 4.71917453831458 2.17924140309913 28.0924962852897 "Australia" 2016 79 . 5.0901627610345 10.9559295425995 2.05691086987642 14.8360406556765 11.635025389692 1.34725410119525 19.0296424854715 4.78069321820981 2.27341087228913 27.9949301039554 "Austria" 2002 78 56.25388 1.53759667744255 9.71065046788369 .960240704028822 10.1533944716582 15.8155088219951 1.02205576665389 14.3331069463757 2.80079436206475 2.71194440434788 40.9547073775494 "Austria" 2003 80 56.65109 1.6085490706922 10.1209800700796 1.05699911227307 10.2611612263589 15.0328051202223 1.03906259675419 14.4712464344962 2.79019390729678 2.65178197049094 40.9672289161905 "Austria" 2004 84 57.99797 1.54220629360301 15.9646003293765 .935964509553889 9.15804658536465 13.9967262359006 .812963724268996 14.0060807267947 2.69252403857989 2.55739934075456 38.3334959086411 "Austria" 2005 87 59.50623 1.53114975424199 12.7014334644972 1.01002302515014 9.40018339678868 15.0777941562519 .829084163345961 14.5539860523822 2.68266923462237 2.60571840155853 39.6079660562609 "Austria" 2006 86 61.27622 1.41870888253999 12.6839200008607 .975002958657812 9.53098874077669 15.2739309043031 .733635839863712 14.563697213 2.69957213541638 2.65808043765134 39.4624554670988 "Austria" 2007 81 62.39697 1.53609482352879 12.0083958452123 .94101319403366 9.52664781494426 15.2449335966206 .790606609340073 14.9674565405168 2.64011710590091 2.88508543101171 39.4596561994043 "Austria" 2008 81 62.22738 1.79897450890918 12.6872825988944 .922334010071836 9.72389205702091 14.3841861786863 .757546362963186 15.0752928510729 2.66763623347205 2.68694787291889 39.2959073259903 "Austria" 2009 79 60.51109 1.31030770464403 14.2334706358159 1.01398538219516 9.45890149825973 14.1772824396969 .785959561346251 14.5219929717813 2.59652740486347 2.56874839282018 39.3328175782502 "Austria" 2010 79 57.92597 1.21930282760488 12.3689119898549 1.08452655084324 9.69633282200473 14.4078267740162 .729203781551095 14.9099691396342 2.58112040539351 2.43981639318722 40.562995721931 "Austria" 2011 78 55.94764 1.22354716975387 12.0804247359371 .954487440168511 9.80373425751294 14.3755105090733 .713426617775779 15.0520577325541 2.60213495790427 2.48462074072016 40.710062181805 "Austria" 2012 69 59.53315 1.16057465751996 12.3558296731399 .937289572097736 9.76944767773454 14.1088895784757 .723301643683391 15.0175762875888 2.61418147608926 2.44891776431584 40.8639916693548 "Austria" 2013 69 58.35 1.20459408996249 12.2869255293537 .871736276338455 9.73317887917109 13.8845054283913 .674223289888015 15.0735978630092 2.56051927613791 2.42841118981397 41.2823021950488 "Austria" 2014 72 59.4973 1.10536359388068 14.0812630931919 .868010308274402 9.42169883622377 12.9154921996975 .65976876711619 15.1211811469844 2.5388318515614 2.32852686720545 40.9598633358643 "Austria" 2015 76 59.96737 1.08790964453304 12.0501076120903 .795552276353583 9.64895381749253 13.1567074182361 .687143649452905 16.0645096759849 2.63114234950523 2.38043246473676 41.4975410916147 "Austria" 2016 75 59.91586 1.18647108945428 11.3546417195142 .748816036650011 9.7816320860484 12.8226114564386 .677693526056699 16.3414032594351 2.68795004068577 2.40834687521964 41.9904339104974 "Azerbaijan" 2002 20 14.372604 . . . . . . . . . . "Azerbaijan" 2003 18 25.585766 . . . . . . . . . . "Azerbaijan" 2004 19 26.94309 . . . . . . . . . . "Azerbaijan" 2005 22 27.13792 . . . . . . . . . . "Azerbaijan" 2006 24 29.34548 . . . . . . . . . . "Azerbaijan" 2007 21 32.11936 . . . . . . . . . . "Azerbaijan" 2008 19 33.86517 10.9977399627759 41.3221217761234 .0814278117521936 8.5042209518745 7.81374634405743 1.58950412124435 2.97710050518479 4.58405344323318 1.21809359212975 18.6926681733581 "Azerbaijan" 2009 23 33.534477 9.92522832959754 34.6609347295172 .0920009367368104 10.0456659195075 6.49442976146666 1.87681910943093 3.46007159345622 5.62376635107557 1.37248670168278 22.9333244120304 "Azerbaijan" 2010 24 31.93348 8.86807939113565 35.6461722131025 .0850619310550664 9.18668855394717 10.3193553201015 1.60946127443665 3.27861513206984 5.18057006416953 1.30726757200418 21.6952693627817 "Azerbaijan" 2011 24 33.01817 7.90251687663098 41.9627864574484 .0708929820634897 7.77655000767519 10.6039496179396 1.94984995295284 2.96988864528784 4.32095655139038 1.15889519439324 21.2837137142181 "Azerbaijan" 2012 27 41.65646 7.17837594738106 37.7480566869899 .0643938038850928 7.73798876685866 13.8201368623864 2.36315039019579 3.18340479682733 4.93225874043675 1.27101103382719 21.7012229712119 "Azerbaijan" 2013 28 41.5962 7.09061927533129 43.1874955392192 .0675659600789856 7.11869245592749 10.2376704018271 2.05457616634549 3.0095401232365 5.16927176266267 1.34798848523779 20.7165798301335 "Azerbaijan" 2014 29 42.46894 7.24723943031556 38.4456052302022 .0714248301279457 7.69959668779254 16.5434191542348 2.14893505578279 3.26030541257363 5.45304769750156 1.44421006518706 17.6862164362819 "Azerbaijan" 2015 29 41.38997 8.44640400621518 35.5116138673634 .0217729085636808 8.26628267173382 16.6473679522579 2.07040566887365 3.60292152845818 5.68520332927566 1.39000227625862 18.3580257909999 "Azerbaijan" 2016 30 42.16488 10.5228194936354 26.8526016173023 .120156937076488 9.44595080966843 13.2748172415511 2.40364360260991 3.68053824653366 6.45919265948145 3.52201186736552 23.7182675247757 "Belarus" 2002 48 38.23063 . . . . . . . . . . "Belarus" 2003 42 37.26974 2.25164676494124 19.1175220213884 1.05527865349153 13.9697123158727 10.5311471193367 7.04025153956435 10.4166385452332 4.22142491943845 3.08193053172539 28.4445375376474 "Belarus" 2004 33 37.177883 2.24361150959711 19.6664764932482 1.34809976000464 14.3527898943525 10.0491752394977 6.52401827182453 10.4916087311298 4.63716629755289 3.33321439501513 27.9228974465648 "Belarus" 2005 26 38.50352 2.42482104347737 19.6401414947874 1.23426727543602 14.2633959097108 10.7963659808016 5.94560352158953 10.3433494718632 4.72286595274479 3.3463019059526 27.7262193788257 "Belarus" 2006 21 40.70657 2.72122742849481 20.9922973383343 1.21252209169288 14.2933787917632 8.09213294681557 6.28147493324987 10.4007504271279 4.96542421842884 3.62239424044247 28.0828578288791 "Belarus" 2007 21 41.54042 2.50074040109793 24.1013716052751 1.10882550892847 13.0917242794761 6.73488424641909 6.95036080959317 10.1133625466623 4.65422572909536 3.81882856743186 26.9256763060206 "Belarus" 2008 20 41.62697 2.26615128801824 27.4503332496337 .877983775458354 12.1249325295535 6.37945497719351 8.001251144279 9.04358719356554 4.15254311682817 4.05036053438571 25.6534021910842 "Belarus" 2009 24 41.65626 2.08549950947834 24.0730618301028 .625508756268623 12.17981716643 7.28134801140691 7.67747439233202 9.37884267355631 4.21926912272791 4.04865837756153 28.430556147973 "Belarus" 2010 25 42.27288 2.20462942265083 17.7566682678096 .67729298502799 13.4379811445627 7.09725004685269 8.99205320730633 10.1129272539386 4.55297519502494 3.71823173849419 31.4499253568218 "Belarus" 2011 24 41.79477 2.55882958052349 15.4580409189622 .530346325294319 14.5316721911076 7.93279231912219 7.63369527946051 10.8630472053949 4.52641444736541 3.91048119785118 32.0546805349183 end
Jan Schaeffer