Announcement

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

  • Omitted values of country fixed effect in Fixed Effects Model

    I use country fixed effect as i.id. Id is the countries list in panel, total 27 countries. However, the dummy variables (i.id) values omit. what's the problem ??


    xtreg lnepi diver depen gpor con i.id, fe
    note: 2.id omitted because of collinearity
    note: 3.id omitted because of collinearity
    note: 4.id omitted because of collinearity
    note: 5.id omitted because of collinearity
    note: 6.id omitted because of collinearity
    note: 7.id omitted because of collinearity
    note: 8.id omitted because of collinearity
    note: 9.id omitted because of collinearity
    note: 10.id omitted because of collinearity
    note: 11.id omitted because of collinearity
    note: 12.id omitted because of collinearity
    note: 13.id omitted because of collinearity
    note: 14.id omitted because of collinearity
    note: 15.id omitted because of collinearity
    note: 16.id omitted because of collinearity
    note: 17.id omitted because of collinearity
    note: 18.id omitted because of collinearity
    note: 19.id omitted because of collinearity
    note: 20.id omitted because of collinearity
    note: 21.id omitted because of collinearity
    note: 22.id omitted because of collinearity
    note: 23.id omitted because of collinearity
    note: 24.id omitted because of collinearity
    note: 25.id omitted because of collinearity
    note: 26.id omitted because of collinearity
    note: 27.id omitted because of collinearity

    Fixed-effects (within) regression Number of obs = 478
    Group variable: id Number of groups = 27

    R-sq: Obs per group:
    within = 0.2128 min = 10
    between = 0.1196 avg = 17.7
    overall = 0.0373 max = 18

    F(4,447) = 30.21
    corr(u_i, Xb) = -0.9355 Prob > F = 0.0000


    lnepi Coef. Std. Err. t P>t [95% Conf. Interval]

    diver -.3900235 .0712686 -5.47 0.000 -.5300867 -.2499603
    depen -.0869759 .0194187 -4.48 0.000 -.1251392 -.0488126
    gpor .0762414 .0446314 1.71 0.088 -.0114721 .1639548
    con -.1036351 .030633 -3.38 0.001 -.1638378 -.0434325

    id
    2 0 (omitted)
    3 0 (omitted)
    4 0 (omitted)
    5 0 (omitted)
    6 0 (omitted)
    7 0 (omitted)
    8 0 (omitted)
    9 0 (omitted)
    10 0 (omitted)
    11 0 (omitted)
    12 0 (omitted)
    13 0 (omitted)
    14 0 (omitted)
    15 0 (omitted)
    16 0 (omitted)
    17 0 (omitted)
    18 0 (omitted)
    19 0 (omitted)
    20 0 (omitted)
    21 0 (omitted)
    22 0 (omitted)
    23 0 (omitted)
    24 0 (omitted)
    25 0 (omitted)
    26 0 (omitted)
    27 0 (omitted)

    _cons 4.261741 .1236697 34.46 0.000 4.018695 4.504787

    sigma_u .13627618
    sigma_e .09850066
    rho .65683932 (fraction of variance due to u_i)

    F test that all u_i=0: F(26, 447) = 4.06 Prob > F = 0.0000

  • #2
    Sulaman:
    welcome to this forum.
    This is more than expected: your -i.id- predictor is perfectly collinear with your -id- fixed effect !
    You can torture linear algebra as you like, but data will not tell you what your ask them to spit out.
    Try:
    Code:
    regress lnepi diver depen gpor con i.id
    and compare it to:
    Code:
    xtset id year
    xtreg lnepi diver depen gpor con, fe
    The following toy-example might be useful:
    Code:
    . use "https://www.stata-press.com/data/r18/nlswork.dta"
    (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
    . xtset idcode year
    . xtreg ln_wage i.idcode i.year if idcode<=3, fe
    note: 2.idcode omitted because of collinearity.
    note: 3.idcode omitted because of collinearity.
    
    Fixed-effects (within) regression               Number of obs     =         39
    Group variable: idcode                          Number of groups  =          3
    
    R-squared:                                      Obs per group:
         Within  = 0.5446                                         min =         12
         Between = 0.2670                                         avg =       13.0
         Overall = 0.3678                                         max =         15
    
                                                    F(14, 22)         =       1.88
    corr(u_i, Xb) = -0.0356                         Prob > F          =     0.0897
    
    ------------------------------------------------------------------------------
         ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          idcode |
              2  |          0  (omitted)
              3  |          0  (omitted)
                 |
            year |
             69  |    .208967   .3918928     0.53   0.599    -.6037689    1.021703
             70  |  -.2747772   .3439816    -0.80   0.433    -.9881514    .4385969
             71  |  -.3613911    .326316    -1.11   0.280    -1.038129    .3153467
             72  |  -.2056973    .326316    -0.63   0.535    -.8824352    .4710406
             73  |  -.0310461    .326316    -0.10   0.925     -.707784    .6456917
             75  |   .0416271    .326316     0.13   0.900    -.6351107     .718365
             77  |   .0358937    .326316     0.11   0.913    -.6408441    .7126316
             78  |   .2433199    .326316     0.75   0.464    -.4334179    .9200578
             80  |   .2726139    .326316     0.84   0.412    -.4041239    .9493518
             82  |   .1747839   .3439816     0.51   0.616    -.5385903    .8881581
             83  |   .2924489    .326316     0.90   0.380    -.3842889    .9691868
             85  |   .3712589    .326316     1.14   0.267     -.305479    1.047997
             87  |   .2960361    .326316     0.91   0.374    -.3807017     .972774
             88  |   .3038639    .326316     0.93   0.362    -.3728739    .9806018
                 |
           _cons |   1.659677   .2833366     5.86   0.000     1.072073    2.247281
    -------------+----------------------------------------------------------------
         sigma_u |  .24956596
         sigma_e |  .27711004
             rho |  .44784468   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(2, 22) = 9.64                       Prob > F = 0.0010
    
    
    . regress ln_wage i.idcode i.year if idcode<=3
    
          Source |       SS           df       MS      Number of obs   =        39
    -------------+----------------------------------   F(16, 22)       =      2.84
           Model |  3.48635949        16  .217897468   Prob > F        =    0.0122
        Residual |  1.68937946        22  .076789976   R-squared       =    0.6736
    -------------+----------------------------------   Adj R-squared   =    0.4362
           Total |  5.17573896        38  .136203657   Root MSE        =    .27711
    
    ------------------------------------------------------------------------------
         ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          idcode |
              2  |  -.3898423   .1155629    -3.37   0.003     -.629505   -.1501795
              3  |  -.4648596   .1120424    -4.15   0.000    -.6972212   -.2324979
                 |
            year |
             69  |    .208967   .3918928     0.53   0.599    -.6037689    1.021703
             70  |  -.2747772   .3439816    -0.80   0.433    -.9881514    .4385969
             71  |  -.3613911    .326316    -1.11   0.280    -1.038129    .3153467
             72  |  -.2056973    .326316    -0.63   0.535    -.8824352    .4710406
             73  |  -.0310461    .326316    -0.10   0.925     -.707784    .6456917
             75  |   .0416271    .326316     0.13   0.900    -.6351107     .718365
             77  |   .0358937    .326316     0.11   0.913    -.6408441    .7126316
             78  |   .2433199    .326316     0.75   0.464    -.4334179    .9200578
             80  |   .2726139    .326316     0.84   0.412    -.4041239    .9493518
             82  |   .1747839   .3439816     0.51   0.616    -.5385903    .8881581
             83  |   .2924489    .326316     0.90   0.380    -.3842889    .9691868
             85  |   .3712589    .326316     1.14   0.267     -.305479    1.047997
             87  |   .2960361    .326316     0.91   0.374    -.3807017     .972774
             88  |   .3038639    .326316     0.93   0.362    -.3728739    .9806018
                 |
           _cons |   1.958421   .2989038     6.55   0.000     1.338532    2.578309
    ------------------------------------------------------------------------------
    
    .
    Last edited by Carlo Lazzaro; 16 Mar 2024, 05:00.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment

    Working...
    X