Skip to main content
Corrected text (forgot "not", state rather than stata), sorry!
Source Link
Arne Jonas Warnke
  • 3.7k
  • 1
  • 28
  • 45

You do not include state dummies (as fixed-effects) because you included them as random-effects (by stating "|| betnr:"). You can include in this model an overall (fixed) intercept but not all single state dummies. 

By including state dummies you take out all the variation between states which you need to calculate the statastate random effects.

You do not include state dummies (as fixed-effects) because you included them as random-effects (by stating "|| betnr:"). You can include an overall (fixed) intercept but all single state dummies. By including state dummies you take out all the variation between states which you need to calculate the stata random effects.

You do not include state dummies (as fixed-effects) because you included them as random-effects (by stating "|| betnr:"). You can include in this model an overall (fixed) intercept but not all single state dummies. 

By including state dummies you take out all the variation between states which you need to calculate the state random effects.

deleted 3 characters in body
Source Link
Nick Cox
  • 59.5k
  • 8
  • 136
  • 212

` . xtmixed gsp cyear state_dummy*, || region: || state: cyear, cov(indep) note: state_dummy48 omitted because of collinearity Performing EM optimization:

xtmixed gsp cyear state_dummy*, || region: || state: cyear, cov(indep)
note: state_dummy48 omitted because of collinearity
Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1285.4493  
Iteration 1:   log likelihood =  1286.9064  
Iteration 2:   log likelihood =  1286.9508  
Iteration 3:   log likelihood =  1286.9508  

Computing standard errors:

Mixed-effects ML regression                     Number of obs      =       816

-----------------------------------------------------------
                |   No. of       Observations per Group
 Group Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         region |        9         51       90.7        136
          state |       48         17       17.0         17
-----------------------------------------------------------

                                                Wald chi2(48)      = 402947.61
Log likelihood =  1286.9508                     Prob > chi2        =    0.0000

-------------------------------------------------------------------------------
          gsp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
        cyear |   .1347569   .0080845    16.67   0.000     .1189117    .1506022
 state_dummy1 |   1.302481   .0155805    83.60   0.000     1.271944    1.333018
[...]
state_dummy47 |   1.711969   .0155805   109.88   0.000     1.681432    1.742506
state_dummy48 |          0  (omitted)
        _cons |   9.235048   .0110171   838.25   0.000     9.213455    9.256641
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
region: Identity             |
                   sd(_cons) |   1.80e-11   2.67e-10      4.64e-24    70.07652
-----------------------------+------------------------------------------------
state: Independent           |
                   sd(cyear) |   .0549153   .0102601      .0380767    .0792005
                   sd(_cons) |   2.47e-12          .             .           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .0454246   .0016555      .0422931    .0487881
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(3) =   578.39   Prob > chi2 = 0.0000

` . xtmixed gsp cyear state_dummy*, || region: || state: cyear, cov(indep) note: state_dummy48 omitted because of collinearity Performing EM optimization:

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1285.4493  
Iteration 1:   log likelihood =  1286.9064  
Iteration 2:   log likelihood =  1286.9508  
Iteration 3:   log likelihood =  1286.9508  

Computing standard errors:

Mixed-effects ML regression                     Number of obs      =       816

-----------------------------------------------------------
                |   No. of       Observations per Group
 Group Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         region |        9         51       90.7        136
          state |       48         17       17.0         17
-----------------------------------------------------------

                                                Wald chi2(48)      = 402947.61
Log likelihood =  1286.9508                     Prob > chi2        =    0.0000

-------------------------------------------------------------------------------
          gsp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
        cyear |   .1347569   .0080845    16.67   0.000     .1189117    .1506022
 state_dummy1 |   1.302481   .0155805    83.60   0.000     1.271944    1.333018
[...]
state_dummy47 |   1.711969   .0155805   109.88   0.000     1.681432    1.742506
state_dummy48 |          0  (omitted)
        _cons |   9.235048   .0110171   838.25   0.000     9.213455    9.256641
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
region: Identity             |
                   sd(_cons) |   1.80e-11   2.67e-10      4.64e-24    70.07652
-----------------------------+------------------------------------------------
state: Independent           |
                   sd(cyear) |   .0549153   .0102601      .0380767    .0792005
                   sd(_cons) |   2.47e-12          .             .           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .0454246   .0016555      .0422931    .0487881
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(3) =   578.39   Prob > chi2 = 0.0000
xtmixed gsp cyear state_dummy*, || region: || state: cyear, cov(indep)
note: state_dummy48 omitted because of collinearity
Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1285.4493  
Iteration 1:   log likelihood =  1286.9064  
Iteration 2:   log likelihood =  1286.9508  
Iteration 3:   log likelihood =  1286.9508  

Computing standard errors:

Mixed-effects ML regression                     Number of obs      =       816

-----------------------------------------------------------
                |   No. of       Observations per Group
 Group Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         region |        9         51       90.7        136
          state |       48         17       17.0         17
-----------------------------------------------------------

                                                Wald chi2(48)      = 402947.61
Log likelihood =  1286.9508                     Prob > chi2        =    0.0000

-------------------------------------------------------------------------------
          gsp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
        cyear |   .1347569   .0080845    16.67   0.000     .1189117    .1506022
 state_dummy1 |   1.302481   .0155805    83.60   0.000     1.271944    1.333018
[...]
state_dummy47 |   1.711969   .0155805   109.88   0.000     1.681432    1.742506
state_dummy48 |          0  (omitted)
        _cons |   9.235048   .0110171   838.25   0.000     9.213455    9.256641
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
region: Identity             |
                   sd(_cons) |   1.80e-11   2.67e-10      4.64e-24    70.07652
-----------------------------+------------------------------------------------
state: Independent           |
                   sd(cyear) |   .0549153   .0102601      .0380767    .0792005
                   sd(_cons) |   2.47e-12          .             .           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .0454246   .0016555      .0422931    .0487881
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(3) =   578.39   Prob > chi2 = 0.0000
Source Link
Arne Jonas Warnke
  • 3.7k
  • 1
  • 28
  • 45

You do not include state dummies (as fixed-effects) because you included them as random-effects (by stating "|| betnr:"). You can include an overall (fixed) intercept but all single state dummies. By including state dummies you take out all the variation between states which you need to calculate the stata random effects.

Try it out

use http://www.stata-press.com/data/r12/productivity.dta
egen cyear = std(year)
xtmixed gsp cyear, || region: || state: cyear, cov(indep)
tabulate state, generate(state_dummy)
xtmixed gsp cyear state_dummy*, || region: || state: cyear, cov(indep)

And look at variation of the random effect "state: Independent" -> "sd(_cons)"

` . xtmixed gsp cyear state_dummy*, || region: || state: cyear, cov(indep) note: state_dummy48 omitted because of collinearity Performing EM optimization:

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1285.4493  
Iteration 1:   log likelihood =  1286.9064  
Iteration 2:   log likelihood =  1286.9508  
Iteration 3:   log likelihood =  1286.9508  

Computing standard errors:

Mixed-effects ML regression                     Number of obs      =       816

-----------------------------------------------------------
                |   No. of       Observations per Group
 Group Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
         region |        9         51       90.7        136
          state |       48         17       17.0         17
-----------------------------------------------------------

                                                Wald chi2(48)      = 402947.61
Log likelihood =  1286.9508                     Prob > chi2        =    0.0000

-------------------------------------------------------------------------------
          gsp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
        cyear |   .1347569   .0080845    16.67   0.000     .1189117    .1506022
 state_dummy1 |   1.302481   .0155805    83.60   0.000     1.271944    1.333018
[...]
state_dummy47 |   1.711969   .0155805   109.88   0.000     1.681432    1.742506
state_dummy48 |          0  (omitted)
        _cons |   9.235048   .0110171   838.25   0.000     9.213455    9.256641
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
region: Identity             |
                   sd(_cons) |   1.80e-11   2.67e-10      4.64e-24    70.07652
-----------------------------+------------------------------------------------
state: Independent           |
                   sd(cyear) |   .0549153   .0102601      .0380767    .0792005
                   sd(_cons) |   2.47e-12          .             .           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .0454246   .0016555      .0422931    .0487881
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(3) =   578.39   Prob > chi2 = 0.0000

`