Announcement

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

  • xtreg , fe first cluster (id) does not work

    Hi

    I am running this model. Is there anyone who could have a look at this model to see what is the problem with -first which keeps saying :option first not allowed.

    Code:
    input float mig_jump double(immi_sh firm_age) float(foreign_aff sector region) double year
    0    2.699 38 1 9 2 2010
    0   2.6999 39 1 9 2 2011
    0      2.4 41 1 9 2 2013
    0     2.39 42 1 9 2 2014
    0      2.3 43 1 9 2 2015
    0   3.4909 12 1 9 5 2010
    0      3.6 13 1 9 5 2011
    0      3.5 14 1 9 5 2012
    0      3.3 15 1 9 5 2013
    0      3.2 16 1 9 5 2014
    0    3.199 17 1 9 5 2015
    0    3.299 18 1 9 5 2016
    0    3.399 19 1 9 5 2017
    0      3.7 20 1 9 5 2018
    0       16 29 1 3 4 2010
    0     15.3 30 1 3 4 2011
    0     13.9 31 1 3 4 2012
    0       13 32 1 3 4 2013
    0     12.7 33 1 3 4 2014
    1     12.9 34 1 3 4 2015
    0       14 35 1 3 4 2016
    0     15.1 36 1 3 4 2017
    0     16.9 37 1 3 4 2018
    0   3.4909 17 1 9 5 2010
    0      3.6 18 1 9 5 2011
    0 1.300001 35 1 9 1 2010
    0     1.29 36 1 9 1 2011
    0 11.90901 37 1 9 1 2012
    0     1.99 38 1 9 1 2013
    0    1.999 39 1 9 1 2014
    0   1.9999 40 1 9 1 2015
    0      1.2 41 1 9 1 2016
    
    
    
     xtivreg  mig_jump (immi_sh = impu_sh_origin) firm_age foreign_aff   i.region#i.year i.sector#i.year,  fe first cluster (NPC_FIC )
    option first not allowed
    r(198);
    cheers,
    Paris
    Last edited by Paris Rira; 17 Apr 2023, 13:10.

  • #2
    At minimum, we need all the variables in the regression to replicate the problem. I can't cluster on a variable that isn't there. This is what I get
    Code:
    clear *
    
    input float mig_jump double(immi_sh firm_age) float(foreign_aff sector region) double year
    0    2.699 38 1 9 2 2010
    0   2.6999 39 1 9 2 2011
    0      2.4 41 1 9 2 2013
    0     2.39 42 1 9 2 2014
    0      2.3 43 1 9 2 2015
    0   3.4909 12 1 9 5 2010
    0      3.6 13 1 9 5 2011
    0      3.5 14 1 9 5 2012
    0      3.3 15 1 9 5 2013
    0      3.2 16 1 9 5 2014
    0    3.199 17 1 9 5 2015
    0    3.299 18 1 9 5 2016
    0    3.399 19 1 9 5 2017
    0      3.7 20 1 9 5 2018
    0       16 29 1 3 4 2010
    0     15.3 30 1 3 4 2011
    0     13.9 31 1 3 4 2012
    0       13 32 1 3 4 2013
    0     12.7 33 1 3 4 2014
    1     12.9 34 1 3 4 2015
    0       14 35 1 3 4 2016
    0     15.1 36 1 3 4 2017
    0     16.9 37 1 3 4 2018
    0   3.4909 17 1 9 5 2010
    0      3.6 18 1 9 5 2011
    0 1.300001 35 1 9 1 2010
    0     1.29 36 1 9 1 2011
    0 11.90901 37 1 9 1 2012
    0     1.99 38 1 9 1 2013
    0    1.999 39 1 9 1 2014
    0   1.9999 40 1 9 1 2015
    0      1.2 41 1 9 1 2016
    end
    
    cls
    
    
     xtivreg  mig_jump (immi_sh = immi_sh) firm_age foreign_aff   i.region#i.year i.sector#i.year,  fe first cluster(NPC_FIC )
    option cluster() not allowed

    EDIT: Also, since this is an xt command, we need to -xtset- the data. It's unclear what our panel variables are here, underscoring the need for a full example that actually reproduces the problem.
    Last edited by Jared Greathouse; 17 Apr 2023, 15:29.

    Comment

    Working...
    X