5. Crossed-Classified Model


Model Data

Stata

use "_data/psuintviewnew.dta", clear

xtmixed polint || _all:R.psuid || intid:
estat icc

. use "_data/psuintviewnew.dta", clear
(BAP: Apr 14, 2015 12:38:58-31 DBV31)

. 
. xtmixed polint || _all:R.psuid || intid:

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -1206.8708  
Iteration 1:   log likelihood = -1206.8146  
Iteration 2:   log likelihood = -1206.8146  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,024

-------------------------------------------------------------
                |     No. of       Observations per Group
 Group Variable |     Groups    Minimum    Average    Maximum
----------------+--------------------------------------------
           _all |          1      1,024    1,024.0      1,024
          intid |        184          2        5.6         21
-------------------------------------------------------------

                                                Wald chi2(0)      =          .
Log likelihood = -1206.8146                     Prob > chi2       =          .

------------------------------------------------------------------------------
      polint |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |   2.359532   .0419232    56.28   0.000     2.277364      2.4417
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.psuid) |   .3038304   .0404476      .2340532      .39441
-----------------------------+------------------------------------------------
intid: Identity              |
                   sd(_cons) |   .3162319   .0442444      .2403881    .4160048
-----------------------------+------------------------------------------------
                sd(Residual) |   .7092945     .01849      .6739649     .746476
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 77.07                 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

. estat icc
estat icc not allowed after crossed-effects models
r(321);

end of do-file
r(321);

R

multi5 <- lmer(polint ~ (1 | psuid) + (1 | intid), data = interview, REML = FALSE)
tidy(multi5)
glance(multi5)
icc(multi5)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: polint ~ (1 | psuid) + (1 | intid)
## 
##   ICC (intid): 0.143803
##   ICC (psuid): 0.132745