Announcement

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

  • reghdfe and observations exclusion

    Hi all,

    I am running the following equation on reghdfe:

    Code:
    reghdfe import_starter l.c1_prop_importing l.s1_prop_importing , a( eu#year  i.niu#i.year ) vce(cluster i.niu#i.year )
    however, some of the observations (a lot of them actually) are excluded from the regression. To put this into numbers I have almost 358000 observations and only 142000 are used for the reghdfe.
    Below you can see may dataset with the reg_obs variable taking into account the variables adopted and not adopted for the regression:


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(import_starter niu_eu reg_obs) double niu int year float(c1_prop_importing s1_prop_importing importingeu2_dprop importingnoneu2_dprop importingeu2_uprop importingnoneu2_uprop) byte eu
    0  1 0 1002001163 2010     .875 .4210528 .50021863  .3001381  .4799981 .25936222 0
    0  1 0 1002001163 2011     .625  .526316 .52926433 .33035585  .5106906 .27024272 0
    0  1 0 1002001163 2012     .625 .4210528  .5308992  .3189881  .5148405 .26588085 0
    0  1 0 1002001163 2013     .875 .4736844  .5618814  .3448819 .51349205 .27985746 0
    0  1 0 1002001163 2014      .75 .5789476 .56052655  .3380097  .5691549 .28085756 0
    1  2 0 1002001163 2010     .625 .6842108 .50021863  .3001381  .4799981 .25936222 1
    .  2 0 1002001163 2011      .75  .526316 .52926433 .33035585  .5106906 .27024272 1
    .  2 0 1002001163 2012     .625 .6842108  .5308992  .3189881  .5148405 .26588085 1
    .  2 0 1002001163 2013      .75 .7368424  .5618814  .3448819 .51349205 .27985746 1
    .  2 0 1002001163 2014       .5 .6842108 .56052655  .3380097  .5691549 .28085756 1
    0  3 0 1900147223 2010        0 .2499999  .4573724  .3022724  .4696848  .2794978 0
    0  3 1 1900147223 2011        0 .2499999  .4775886  .3248783  .5018109 .41699785 0
    0  3 1 1900147223 2012        0 .2499999   .482752  .3216156  .5018109  .3482478 0
    0  3 1 1900147223 2013        0 .0833333  .5281956  .3962154   .517874  .4330609 0
    0  3 1 1900147223 2014        0 .3333332  .5329283   .315779  .5018109  .3482478 0
    0  4 0 1900147223 2010        0 .3333332  .4573724  .3022724  .4696848  .2794978 1
    0  4 1 1900147223 2011        0 .4166665  .4775886  .3248783  .5018109 .41699785 1
    0  4 1 1900147223 2012        0 .4166665   .482752  .3216156  .5018109  .3482478 1
    0  4 1 1900147223 2013      .25 .4999998  .5281956  .3962154   .517874  .4330609 1
    0  4 1 1900147223 2014        0 .3333332  .5329283   .315779  .5018109  .3482478 1
    0  5 0 1900338297 2010  .571428        0         1         1 .44249925 .24996364 0
    0  5 0 1900338297 2011  .428571        0         1         1  .4855799   .305008 0
    0  5 0 1900338297 2012  .428571        1         1         1  .4963517  .2613976 0
    0  5 0 1900338297 2013  .428571        1         1         1  .5319293  .3857464 0
    0  5 0 1900338297 2014  .714285        0         1         1 .52018857  .3474298 0
    .  6 0 1900338297 2010  .571428        0         1         1 .44249925 .24996364 1
    .  6 0 1900338297 2011  .714285        0         1         1  .4855799   .305008 1
    .  6 0 1900338297 2012  .714285        0         1         1  .4963517  .2613976 1
    .  6 0 1900338297 2013  .571428        1         1         1  .5319293  .3857464 1
    .  6 0 1900338297 2014  .571428        0         1         1 .52018857  .3474298 1
    .  7 0 1900354062 2010  .588236  .619047  .3744791  .2386279  .3782731 .24953753 0
    .  7 0 1900354062 2011  .588236  .666666  .3891732  .2334122  .3995861 .28697857 0
    .  7 0 1900354062 2012 .5588242  .619047  .4054865 .23574243  .3927215  .2657595 0
    .  7 0 1900354062 2013 .6470596  .714285  .4220624 .24268155  .4215259  .3297136 0
    .  7 0 1900354062 2014  .735295  .714285  .4304704  .2162187   .475047 .28102913 0
    1  8 0 1900354062 2010  .588236  .809523  .3744791  .2386279  .3782731 .24953753 1
    .  8 0 1900354062 2011 .6470596  .761904  .3891732  .2334122  .3995861 .28697857 1
    .  8 0 1900354062 2012 .6470596  .714285  .4054865 .23574243  .3927215  .2657595 1
    .  8 0 1900354062 2013 .6176478 .7380945  .4220624 .24268155  .4215259  .3297136 1
    .  8 0 1900354062 2014  .588236  .761904  .4304704  .2162187   .475047 .28102913 1
    0  9 0 2000001243 2010  .272727 .4482764  .4576761 .28908548  .4521937 .27172717 0
    0  9 0 2000001243 2011  .363636 .4827592  .5204781  .3210406  .4473028 .33797115 0
    0  9 0 2000001243 2012  .272727 .4827592   .526156  .3093448  .4600987 .29378185 0
    0  9 0 2000001243 2013  .272727  .517242  .5280846  .3119616  .4540525  .2628305 0
    0  9 0 2000001243 2014  .272727  .517242  .5272788  .3344246 .46768275 .28368175 0
    1 10 0 2000001243 2010  .454545 .5862076  .4576761 .28908548  .4521937 .27172717 1
    . 10 0 2000001243 2011 .4999995 .5862076  .5204781  .3210406  .4473028 .33797115 1
    . 10 0 2000001243 2012  .454545 .6206904   .526156  .3093448  .4600987 .29378185 1
    . 10 0 2000001243 2013  .454545 .5862076  .5280846  .3119616  .4540525  .2628305 1
    . 10 0 2000001243 2014 .4090905 .5517248  .5272788  .3344246 .46768275 .28368175 1
    . 11 0 2000005885 2010        1        0         0         0  .4470046  .3870968 0
    . 11 0 2000005885 2011        1        0         0         0  .4239631  .3410138 0
    . 11 0 2000005885 2012        1        0         0         0 .41013825  .2764977 0
    . 11 0 2000005885 2013        1        0  .3333333  .3333333  .4009217 .20737328 0
    . 11 0 2000005885 2014        1        0  .3333333  .3333333  .3686636 .22580644 0
    0 12 0 2000005885 2010        1        0         0         0  .4470046  .3870968 1
    0 12 0 2000005885 2011        1        0         0         0  .4239631  .3410138 1
    0 12 0 2000005885 2012        1        0         0         0 .41013825  .2764977 1
    0 12 0 2000005885 2013        1        0  .3333333  .3333333  .4009217 .20737328 1
    0 12 0 2000005885 2014        1        0  .3333333  .3333333  .3686636 .22580644 1
    0 13 0 2000023046 2010        1  .333333 .31250015 .25000012  .4470046  .3870968 0
    0 13 1 2000023046 2011        1  .333333 .31250015 .25000012  .4239631  .3410138 0
    0 13 1 2000023046 2012        1  .333333 .31250015 .28125015 .41013825  .2764977 0
    0 13 1 2000023046 2013        1  .333333 .47916675  .4166667  .4009217 .20737328 0
    0 13 1 2000023046 2014        1  .333333 .47916675  .4166667  .3686636 .22580644 0
    0 14 0 2000023046 2010        1  .333333 .31250015 .25000012  .4470046  .3870968 1
    0 14 1 2000023046 2011        1  .333333 .31250015 .25000012  .4239631  .3410138 1
    0 14 1 2000023046 2012        1  .333333 .31250015 .28125015 .41013825  .2764977 1
    0 14 1 2000023046 2013        1  .333333 .47916675  .4166667  .4009217 .20737328 1
    0 14 1 2000023046 2014        1  .333333 .47916675  .4166667  .3686636 .22580644 1
    0 15 0 2000023691 2010  .333333  .818181 .53193665  .4204828 .58913636  .4303619 0
    0 15 1 2000023691 2011        0   .90909   .560728  .4409811 .58913636  .4401112 0
    0 15 1 2000023691 2012  .666666 .8636355 .55894816 .47266835  .6629525  .4846794 0
    0 15 1 2000023691 2013  .333333 .8636355 .58659935  .4515955  .6378828 .56406665 0
    0 15 1 2000023691 2014  .333333 .8636355 .58065873  .4420311  .7075208  .4944287 0
    0 16 0 2000023691 2010        0  .818181 .53193665  .4204828 .58913636  .4303619 1
    0 16 1 2000023691 2011  .333333 .8636355   .560728  .4409811 .58913636  .4401112 1
    0 16 1 2000023691 2012  .666666 .8636355 .55894816 .47266835  .6629525  .4846794 1
    0 16 1 2000023691 2013  .666666   .90909 .58659935  .4515955  .6378828 .56406665 1
    0 16 1 2000023691 2014  .666666 .8636355 .58065873  .4420311  .7075208  .4944287 1
    0 17 0 2002903476 2010        0       .5  .4229295 .20778796  .1590909 .03409091 0
    0 17 1 2002903476 2011        0       .5 .42218485 .20769487  .2159091 .03409091 0
    0 17 1 2002903476 2012        0       .5  .4230226 .18528993  .1931818 .03409091 0
    0 17 1 2002903476 2013        0       .5  .3790505  .2063917 .17045455 .03409091 0
    0 17 1 2002903476 2014        1       .5  .4022932   .229169  .1590909 .05681818 0
    0 18 0 2002903476 2010        1       .5  .4229295 .20778796  .1590909 .03409091 1
    0 18 1 2002903476 2011        1       .5 .42218485 .20769487  .2159091 .03409091 1
    0 18 1 2002903476 2012        1       .5  .4230226 .18528993  .1931818 .03409091 1
    0 18 1 2002903476 2013        1       .5  .3790505  .2063917 .17045455 .03409091 1
    0 18 1 2002903476 2014        1       .5  .4022932   .229169  .1590909 .05681818 1
    . 19 0 2900026825 2010        0  .428571  .5677139  .4868784  .5416667  .5208334 0
    . 19 0 2900026825 2011  .166667  .714285  .6166499  .5010668  .5416667  .5416667 0
    . 19 0 2900026825 2012        0  .714285  .6447643  .5488552  .5208334  .5416667 0
    . 19 0 2900026825 2013        0  .714285  .6706166  .4983225  .5416667  .5416667 0
    . 19 0 2900026825 2014        0  .714285   .680166 .59563017  .5416667 .56250006 0
    0 20 0 2900026825 2010        0  .714285  .5677139  .4868784  .5416667  .5208334 1
    0 20 0 2900026825 2011        0  .571428  .6166499  .5010668  .5416667  .5416667 1
    0 20 0 2900026825 2012  .166667  .714285  .6447643  .5488552  .5208334  .5416667 1
    0 20 0 2900026825 2013        0  .571428  .6706166  .4983225  .5416667  .5416667 1
    0 20 0 2900026825 2014        0  .571428   .680166 .59563017  .5416667 .56250006 1
    end
    label values eu _merge
    label def _merge 0 "Original observation", modify
    label def _merge 1 "Duplicated observation", modify
    As you can see there are some values that are excluded from the regression even if they have all the variables (with variability within the cluster, like, e.g..

    Code:
    0  1 0 1002001163 2010     .875 .4210528 .50021863  .3001381  .4799981 .25936222 0
    0  1 0 1002001163 2011     .625  .526316 .52926433 .33035585  .5106906 .27024272 0
    0  1 0 1002001163 2012     .625 .4210528  .5308992  .3189881  .5148405 .26588085 0
    0  1 0 1002001163 2013     .875 .4736844  .5618814  .3448819 .51349205 .27985746 0
    0  1 0 1002001163 2014      .75 .5789476 .56052655  .3380097  .5691549 .28085756 0
    1  2 0 1002001163 2010     .625 .6842108 .50021863  .3001381  .4799981 .25936222 1
    .  2 0 1002001163 2011      .75  .526316 .52926433 .33035585  .5106906 .27024272 1
    .  2 0 1002001163 2012     .625 .6842108  .5308992  .3189881  .5148405 .26588085 1
    .  2 0 1002001163 2013      .75 .7368424  .5618814  .3448819 .51349205 .27985746 1
    .  2 0 1002001163 2014       .5 .6842108 .56052655  .3380097  .5691549 .28085756 1
    )

    and others that, quite counterintuitive to me are included like:

    Code:
    0  3 0 1900147223 2010        0 .2499999  .4573724  .3022724  .4696848  .2794978 0
    0  3 1 1900147223 2011        0 .2499999  .4775886  .3248783  .5018109 .41699785 0
    0  3 1 1900147223 2012        0 .2499999   .482752  .3216156  .5018109  .3482478 0
    0  3 1 1900147223 2013        0 .0833333  .5281956  .3962154   .517874  .4330609 0
    0  3 1 1900147223 2014        0 .3333332  .5329283   .315779  .5018109  .3482478 0
    0  4 0 1900147223 2010        0 .3333332  .4573724  .3022724  .4696848  .2794978 1
    0  4 1 1900147223 2011        0 .4166665  .4775886  .3248783  .5018109 .41699785 1
    0  4 1 1900147223 2012        0 .4166665   .482752  .3216156  .5018109  .3482478 1
    0  4 1 1900147223 2013      .25 .4999998  .5281956  .3962154   .517874  .4330609 1
    0  4 1 1900147223 2014        0 .3333332  .5329283   .315779  .5018109  .3482478 1
    Why is this like this?

    Thank you

  • #2
    singletons, I suspect, given that specification of absorb. Why are you interacting in the absorb?

    Comment

    Working...
    X