I'm trying to use GMM to estimate a model on the following data:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str3 country int year float(y k l) double pop
"AUS" 2010 12062    125   1266931           22031800
"AUS" 2011 12097    125 1331552.4           22340000
"AUS" 2012 11804    125 1372073.3           22733500
"AUS" 2013 11927    320   1383774           23128100
"AUT" 2010  6105    156    400250            8363400
"AUT" 2011  5910    157    407280            8391600
"AUT" 2012  5929    161    414700            8430000
"AUT" 2013  5954    163    419940            8479800
"BEL" 2010  7634    116    529000           10895600
"BEL" 2011  7406    118    545900           11038300
"BEL" 2012  7407    118    558500           11106900
"BEL" 2013  7423    121    567700           11159400
"CAN" 2010 22427    281   1782535           34004900
"CAN" 2011 22418    293   1817985           34339300
"CAN" 2012 22698    308   1832145           34714200
"CAN" 2013 22866    312   1856910           35083000
"CZE" 2010 14061     66    298508           10474400
"CZE" 2011 13344     72    306410           10496100
"CZE" 2012 13458     73    310430           10510800
"CZE" 2013 13556     78    312427           10514300
"DEU" 2010 76107   2211   4875000           81776900
"DEU" 2011 73488   2317   4965000           80275000
"DEU" 2012 71494   2305   5086000           80425800
"DEU" 2013 70713   2332   5192000           80645600
"ESP" 2010 27978    558   1327400           46576900
"ESP" 2011 27643    643   1353300           46742700
"ESP" 2012 27190    691   1311000           46773100
"ESP" 2013 26921    715   1294000           46620000
"EST" 2010  2015     11     33800            1331500
"EST" 2011  1867     13     34120            1327400
"EST" 2012  1882     13     34820            1322700
"EST" 2013  1728     15     36040            1318000
"FIN" 2010  4325    100    372000            5363400
"FIN" 2011  4163    109    382000            5388300
"FIN" 2012  4150    117    392400            5414000
"FIN" 2013  4010    120    395900            5439000
"GBR" 2010 52018 411.32   3642401           62766400
"GBR" 2011 49173 440.52   3689673           63258800
"GBR" 2012 48532  456.1   3710859           63700200
"GBR" 2013 48319 461.53   3808592           64128300
"HUN" 2010 17497     30    265258           10000000
"HUN" 2011 17220     30    276400            9971700
"HUN" 2012 17143     28    270666            9920400
"HUN" 2013 16603     30    279869            9893100
"ISL" 2010   132      7     20200             318000
"ISL" 2011   128      7     19800             319000
"ISL" 2012   132      7     19900             320700
"ISL" 2013   148      7     20200             323800
"KOR" 2010 26747    985   1162000           49554100
"KOR" 2011 26118   1062   1328200           49936600
"KOR" 2012 26250   1173   1415300           50199900
"KOR" 2013 25569   1228   1565500           50428900
"LTU" 2010  5975     15  87619.26            3097300
"LTU" 2011  5808     18  87363.11            3028100
"LTU" 2012  5708     30  85478.87            2987800
"LTU" 2013  5563     31  84770.83            2957700
"LUX" 2010   328      7     32115             507000
"LUX" 2011   306      7     33880 518299.99999999994
"LUX" 2012   279      7     36024             530900
"LUX" 2013   321      7     38707             543400
"NLD" 2010 11417    203   1394000 16615400.000000002
"NLD" 2011 11124    215   1420000 16693099.999999998
"NLD" 2012 11223    198   1436000           16755000
"NLD" 2013 10701    193   1427000           16804400
"SVN" 2010  1731     16  54797.85            2048600
"SVN" 2011  1693     18  55898.38 2052800.0000000002
"SVN" 2012  1641     18  57453.17 2057199.9999999998
"SVN" 2013  1646     19  57681.16            2060000
"TUR" 2010 49379    678    590375           73142200
"TUR" 2011 50573    709    692675           74223600
"TUR" 2012 50149    720    807950           75175800
"TUR" 2013 59183    751    858125           76147600
end
My code looks like this:

Code:
*====================
* Prepare data for modelling
*====================
* Encode country
encode country, gen(country_encoded)

* Transform variables into ln form (I'm estimating a Cobb-Douglas model)
foreach var in y k l d pop {
    gen ln`var' = ln(`var')
}

* Do xtset
xtset country_encoded year


*====================
* Apply one-step difference GMM
*====================
xtabond2 lny l.lny lnk lnl lnpop i.year, gmm(l.lny lnk lnl lnpop, collapse) iv(i.year) noleveleq nodiffsargan robust small
I wanted to check on the distribution of my residuals, and was surprised to find that they are all negative:

Code:
predict r, residuals
histogram r
I've never encountered this kind of result before. What is going on here and how should I amend it?


Thanks!