Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Structural approach with Poisson on panel data with endogenous regressor

    Dear Statalists,

    for my thesis, I want to perform a Poisson IV with fixed effects on a panel data set (See dataex code in the next comment for excerpt. Whole dataset comprises 4,410 obs., N=105 counties, T=42, dependent variable =count, endogenous variable= continuous). As the command ivpoisson is invalid with fixed effect dummies, I wanted to apply a control function approach. Hereby, I include a prediction of the first stage residual into the second stage and add fixed effects dummies manually.
    My code for the first stage is:
    Code:
    reg licenses_per1000 instrument percent_unemp income_1000 divorcerate percent_male percent_white percent_age1 percent_age2 urban_rural i.countycode i.year i.countycode##c.year [pweight= population], vce(cluster countycode )
    Code:
    predict uhat, residuals
    And the second stage:
    Code:
    poisson suicides licenses_per1000 uhat percent_unemp income_1000 divorcerate percent_male percent_white percent_age1 percent_age2 urban_rural i.countycode i.year i.countycode##c.year [pweight= population ], vce(cluster population )
    I'm worried now that the codes for the control function approach are incorrect. Just for comparison, I perfomed the control function without FE dummies with the command "ivpoisson cfunction" and also performed the two stages described above without FE dummies. Both commands produced different results, especially concerning the significance of the variables.
    Does this imply that my contol function approach is wrong? I can't see any failure in the construction.
    I am grateful for any advice.
    Kind regards
    Joana

  • #2
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int suicides float year double countycode float(instrument licenses_per1000 percent_age1 percent_age2 percent_male percent_white) double percent_unemp float(income_1000 divorcerate urban_rural population)
    0 1977 1  0  .1910828  .3119587   .0878757  .4761207 .9777763   4.19999980926514 25.009186  7.004585 6 15704
    3 1978 1  0  .1910828  .3203642   .0864111  .4759934 .9777763 3.0999999046325684  23.76577  7.131941 6 15704
    3 1979 1  0  .1898734  .3243226  .08584452  .4759433 .9773993 3.0999999046325684 23.593584  7.660167 6 15796
    1 1980 1  0  .1916443  .3262466  .08804188   .474941 .9768243  5.099999904632568 22.868866  7.342144 6 15663
    1 1981 1  0 .19211066  .3292136  .08862705  .4752818 .9764985  4.699999809265137  23.87106  5.827356 6 15616
    3 1982 1  0 .19185266  .3333973  .08913613  .4755419 .9760854  6.400000095367432 23.849024  5.754844 6 15639
    1 1983 1  0 .18958543  .3374423  .08963905  .4759466 .9759783  6.800000190734863  24.08567  6.637588 6 15819
    2 1984 1  0  .1890955 .34161255  .09039904  .4759503 .9755406  7.099999904632568  24.93289  6.808296 6 15863
    2 1985 1  0 .25833118  .3453911  .09140237  .4767134 .9747432                  9 25.927654  6.459531 6 15481
    2 1986 1  0  .2637131  .3501912  .09237769  .4772517 .9736912  9.399999618530273  25.10808  6.000264 6 15166
    4 1987 1  0 .33813486  .3531719  .09312864 .47781685  .973015  7.300000190734863  25.71118  6.763155 6 14786
    5 1988 1  0 .34440005  .3569559   .0932507  .4785813 .9721763  5.699999809265137  25.59835  6.198347 6 14520
    0 1989 1  0  .4097241  .3590549  .09328052  .4799918 .9715242                  5  26.29447 4.5752525 6 14644
    2 1990 1  0  .4781421  .3620219  .09330601  .4807377 .9733607                5.8  25.88776  5.601093 6 14640
    1 1991 1  0  .6145442  .3627859  .09498122  .4822806 .9737794                5.9  25.81968  4.643223 6 14645
    3 1992 1  0  .6123699  .3660611  .09450908  .4832279 .9739403                5.2 26.830593   3.74226 6 14697
    5 1993 1  0  .6125366   .368679   .0940584  .4843803 .9739332                5.7  26.05807  2.994623 6 14693
    3 1994 1  0  .4755112 .37184975   .0936757  .4858366 .9735752                6.1 27.306173 3.8720195 6 14721
    2 1995 1  0  .4772619  .3755369  .09381605  .4862617 .9736142                6.9 27.117016  2.249949 6 14667
    3 1996 1  0  .4088029   .377802  .09443346 .48667985 .9732234                6.1 28.776323   2.86162 6 14677
    5 1997 1  0  .6206896      .376   .0962069  .4867586 .9734483                5.4  29.96131         2 6 14500
    4 1998 1  0  .5497904  .3748883   .0955948  .4881451 .9727854                4.7 29.838516  2.061714 6 14551
    1 1999 1  0  .4153974  .3739269  .09561063  .4887843  .970853                  5  29.47129  2.700083 6 14444
    3 2000 1  0  .4168693  .3731675  .09581047  .4892656 .9581741                4.5  29.28973  3.057042 6 14393
    2 2001 1  1  .3528332 .37548515  .09660574  .4889563 .9563898                  6 33.558517  2.540399 6 14171
    6 2002 1  1  .3543586  .3746279   .0949681  .4878101 .9559178                5.3 32.681377 2.1261516 6 14110
    0 2003 1  1  .5021521  .3731707  .09569584  .4870158 .9542325                4.8  34.45758 1.8651363 6 13940
    2 2004 1  1  .4309416  .3732673   .0927961  .4873231 .9527401                5.7 34.410862  1.436472 6 13923
    2 2005 1  1  .5097211  .3725333  .09619165  .4887497 .9508483                5.4 32.615307 1.8204325 6 13733
    2 2006 1  1  .5132341  .3738544   .0949483  .4898453 .9490432                4.2 33.049458  1.832979 6 13639
    1 2007 1  1  .4429679  .3689922  .09354005  .4894057 .9474345                  4  34.86507 2.2148395 6 13545
    2 2008 1  1  .5215318  .3655938  .09454627  .4881538 .9448667                4.6 37.337963 2.3841455 6 13422
    2 2009 1  1  .4475274  .3616767  .09353323  .4875811  .944432                7.8   38.2347   3.20728 6 13407
    2 2010 1  1  .5992509  .3603233  .09436504 .48783955 .9427524                8.3  37.52203  2.394672 6 13363
    4 2011 1  1   .600105  .3578813  .09267306   .486365 .9402907                  8 37.211594 2.0976925 6 13348
    0 1977 3  0 .23255815 .29800862   .0925818 .48701525 .9934785                  4  26.42901 2.5620124 6  8587
    0 1978 3  0 .23255815  .2998723   .0924916  .4884531 .9933852                  3 21.969666 2.3209934 6  8617
    1 1979 3  0 .22988506  .3032214   .0929726  .4888226 .9926631                3.5 24.526226 2.6367075 6  8723
    0 1980 3  0  .3428963   .305361   .0960854  .4880037 .9927678  5.099999904632568 22.243334 3.7883136 6  8711
    0 1981 3  0 .35207134  .3086043  .09766404  .4877333 .9919004  5.699999809265137 25.418255   3.52154 6  8519
    2 1982 3  0  .3526093 .31343985   .0993891  .4868421 .9914238  7.800000190734863  24.15979  5.286654 6  8512
    0 1983 3  0  .3495689  .3190449  .10052417 .48619685 .9907979  8.699999809265137  22.79813 4.1933603 6  8585
    1 1984 3  0  .3544005  .3240019  .10205528  .4852351  .990078  7.199999809265137  25.64978  4.606662 6  8466
    3 1985 3  0  .4930359  .3290187   .1040434  .4843442 .9881657                  8  27.13859  4.807693 6  8112
    1 1986 3  0  .5026389  .3343385  .10629476  .4843573   .98731  7.900000095367432  26.10381  5.402689 6  7959
    1 1987 3  0  .5070994  .3387833   .1077313  .4833967 .9870722  7.099999904632568 27.384085  5.323194 6  7890
    1 1988 3  0  .6379178  .3437101  .10857362  .4829038 .9863486  6.599999904632568  25.71943  7.272264 6  7838
    3 1989 3  0  .6310741  .3469645   .1099331  .4831503 .9852329  4.900000095367432  26.27326  4.038874 6  7923
    0 1990 3  0  .6428388  .3498329  .11108254  .4836719 .9901003                5.8 24.425745   6.29982 6  7778
    0 1991 3  0  .6446622  .3499226  .11436307  .4837545 .9909747                6.8  23.21665   5.28623 6  7756
    0 1992 3  0  .6358896  .3549536  .11306117  .4863284 .9910976                6.7 26.580984  6.994786 6  7863
    2 1993 3  0  .6368616  .3562604  .11336136 .48694435 .9908292                7.7  24.37118 4.4580307 6  7851
    0 1994 3  0  .6384881   .360235  .11148001  .4875495 .9905504                6.6    26.055  6.767973 6  7831
    3 1995 3  0  .8782936  .3646173  .11091594  .4882058 .9908407                5.7  24.67623  5.144291 6  7970
    4 1996 3  0 1.0018785  .3675642   .1097057  .4887915 .9901065                5.4 28.084173  5.134627 6  7985
    3 1997 3  1 1.1184292  .3673419  .11010315  .4894992 .9904312                5.3  29.90898  7.207655 6  8047
    1 1998 3  1  1.119403  .3652985  .11007462  .4893035 .9904229                5.4  28.47072  3.358209 6  8040
    2 1999 3  1  1.105108 .36468565  .10891454  .4899312 .9895629                4.7   27.9132  4.052063 6  8144
    0 2000 3  1  1.235941  .3631195   .1112347  .4926462 .9781238                4.1  29.79228  5.067359 6  8091
    0 2001 3  1   .976205  .3626602  .10982306  .4931056 .9784015                5.2  31.32815  4.270897 6  8195
    1 2002 3  1   .859634  .3596954  .11138401  .4947808 .9778951                5.3 30.590317  3.315731 6  8143
    0 2003 3  1  .7326007  .3598291  .11098901  .4954823 .9772894                5.5 30.590416 2.3199024 6  8190
    3 2004 3  1  .7406493  .3583508  .11208493  .4951241 .9770399                6.3  30.89908  4.073571 6  8101
    1 2005 3  1  .6182762  .3584766  .11067145 .49697044 .9771238                5.9  30.96881  3.462347 6  8087
    2 2006 3  1  .7478499  .3588433  .10656861 .49569985 .9756949                4.8 33.011826  5.359591 6  8023
    0 2007 3  1  .8706468  .3619403   .1033582  .4966418 .9754975                4.7 35.691673 3.9800994 6  8040
    1 2008 3  1  .8580534  .3612405  .09683746  .4975484 .9756067                4.8  37.02654  4.412846 6  8158
    3 2009 3  1  .9875324  .3568695    .099247  .4933959 .9748179                7.6  36.68818 3.4563634 6  8101
    0 2010 3  1  .9878982  .3554239  .09897569  .4952487 .9743305                7.7  34.55464  5.059855 6  8103
    0 2011 3  1  1.363073 .35227695   .0983993  .4973322 .9715846                7.6  37.60218  4.094801 6  8059
    2 1977 5  0  .2173913  .3103205  .06719454  .4842996 .9328055   7.09999990463257 24.684546  3.525137 5 18439
    4 1978 5  0  .2197802  .3128084  .06623533  .4838798  .932997 3.9000000953674316 24.957134   5.75721 5 18238
    1 1979 5  0  .2173913  .3165237  .06633373  .4837694 .9319835  4.199999809265137  24.66499 4.6140485 5 18422
    2 1980 5  0 .21742675  .3184312  .06817318 .48335055 .9307947                  7 22.365595  4.997556 5 18409
    1 1981 5  0 .21750952  .3217685  .06971559  .4837131 .9309914  7.400000095367432 23.311985  5.601175 5 18389
    0 1982 5  0 .21962334  .3261407  .07121287  .4835008 .9312579  8.699999809265137 23.042967  4.337561 5 18213
    4 1983 5  0 .22516184  .3306878  .07289204 .48345155 .9307104  9.100000381469727 22.404127   5.40358 5 17766
    2 1984 5  0 .22754423  .3361392 .074280515 .48350585 .9314071                  8  24.06222  5.573883 5 17582
    2 1985 5  0  .2292789  .3399805   .0760415   .484041 .9310641  6.900000095367432  25.64686 4.5269613 5 17451
    1 1986 5  0 .28945234 .34531665  .07809424   .484659 .9309367  7.400000095367432 25.294643  6.483733 5 17274
    3 1987 5 .5 .52401745  .3486842  .07952958  .4848044 .9306591                6.5  25.88496  5.006987 5 17176
    1 1988 5  1  .6417362  .3527971  .08067433  .4859126 .9305839  5.900000095367432  26.19366  6.066616 5 17143
    0 1989 5  1  .7020007  .3552331  .08172936   .486632 .9309074  5.300000190734863 26.394745  5.850348 5 17093
    1 1990 5  1  .7098911 .35748935  .08347137  .4866895  .933921                6.2  26.35487  4.732608 5 16904
    0 1991 5  1  .7726597  .3591085  .08374443  .4868945 .9346211                6.4  25.96478  6.359584 5 16825
    4 1992 5  1  .8908421  .3616225   .0835016  .4860435 .9348497                6.6  27.91339  5.523221 5 16838
    1 1993 5  1 1.0037789  .3644308   .0827232  .4858881 .9346953                7.7 26.849634  4.841757 5 16936
    1 1994 5  1 1.0131109 .36531585  .08367103  .4864124 .9348034                7.8 28.628935  5.959476 5 16780
    0 1995 5  1 1.1922504  .3680477  .08393443  .4856632 .9340686                6.9  27.06018  3.099851 5 16775
    2 1996 5  1 1.1914691  .3695937   .0845943  .4838556 .9342309                7.6  27.78863 2.3233647 5 16786
    2 1997 5  1 1.1327053  .3687254   .0845952  .4842614 .9345415                6.6  28.04752  5.544295 5 16774
    3 1998 5  1  .8930166  .3677442  .08364589   .484015 .9340358                  5  29.19874  4.346014 5 16797
    2 1999 5  1 1.0105213  .3662248  .08327884  .4833264 .9324139                4.3  28.85929  3.447661 5 16823
    2 2000 5  1  .7739938  .3653251  .08365087 .48297215 .9225411                4.3 29.245184  3.869969 5 16796
    0 2001 5  1  .7706901 .36252075  .08353095 .48482335 .9223974                5.1 30.080776 4.6241403 5 16868
    4 2002 5  1  .8916364  .3618261  .08428936  .4845747 .9221898                5.4  29.96742  5.052607 5 16823
    2 2003 5  1 1.0074074   .361363      .0832  .4859259 .9223704                5.5 30.001734  3.674074 5 16875
    1 2004 5  1  .9446774  .3588003  .08289544 .48739445 .9204109                5.8  30.85289  3.188286 5 16937
    2 2005 5  1  .9487103  .3616958  .08212274  .4879929 .9209013                5.5  31.38292 4.0913134 5 16865
    2 2006 5  1  .8283044  .3585375  .08064134  .4900604 .9216661                4.7 32.718052 3.7273695 5 16902
    end

    Comment

    Working...
    X