I was trying to calculate the ICC to see whether it is needed for a multilevel analysis for my data. When I was running the xtreg and xtmixed in Stata 13.1, the two tests show different coefficient.
outcome variable: w0mz
exposure variable: rsppreg
grouping variable: stationcode
Code and output are as below:
################################################## ################################################## ######
. xtset stationcode
panel variable: stationcode (unbalanced)
. xtreg w0mz rsppreg, mle nolog
Random-effects ML regression Number of obs = 8238
Group variable: stationcode Number of groups = 9
Random effects u_i ~ Gaussian Obs per group: min = 384
avg = 915.3
max = 1846
LR chi2(1) = 59.19
Log likelihood = -11519.418 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
w0mz | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
rsppreg | -.0085439 .0006634 -12.88 0.000 -.0098441 -.0072437
_cons | .2359468 . . . . .
-------------+----------------------------------------------------------------
/sigma_u | .0674822 .0320939 .0265685 .1714006
/sigma_e | .9787393 .0076355 .9638878 .9938196
rho | .0047314 .0044823 .0006123 .0251942
------------------------------------------------------------------------------
Likelihood-ratio test of sigma_u=0: chibar2(01)= 13.55 Prob>=chibar2 = 0.000
################################################## ################################################## #######
. xtmixed w0mz rsppreg || stationcode:, mle nolog
Mixed-effects ML regression Number of obs = 8238
Group variable: stationcode Number of groups = 9
Obs per group: min = 384
avg = 915.3
max = 1846
Wald chi2(1) = 910.59
Log likelihood = -11146.214 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
w0mz | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
rsppreg | -.1956578 .0064839 -30.18 0.000 -.2083661 -.1829496
_cons | 11.72928 .6660864 17.61 0.000 10.42377 13.03478
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
stationcode: Identity |
sd(_cons) | 1.603851 .3820153 1.005587 2.558048
-----------------------------+------------------------------------------------
sd(Residual) | .9322329 .0072668 .9180985 .9465848
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 759.96 Prob >= chibar2 = 0.0000
To my understanding, the sigma_u and sd(_cons) should be equal; and the sigma_e and sd(Residual) should be equal.
And the ICC based on the xtmixed result is ~76%.
I got some missing value in w0mz and rsppreg, but it is already set as ".", should not be affected.
Can anyone help?
Thank you very much!
outcome variable: w0mz
exposure variable: rsppreg
grouping variable: stationcode
Code and output are as below:
################################################## ################################################## ######
. xtset stationcode
panel variable: stationcode (unbalanced)
. xtreg w0mz rsppreg, mle nolog
Random-effects ML regression Number of obs = 8238
Group variable: stationcode Number of groups = 9
Random effects u_i ~ Gaussian Obs per group: min = 384
avg = 915.3
max = 1846
LR chi2(1) = 59.19
Log likelihood = -11519.418 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
w0mz | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
rsppreg | -.0085439 .0006634 -12.88 0.000 -.0098441 -.0072437
_cons | .2359468 . . . . .
-------------+----------------------------------------------------------------
/sigma_u | .0674822 .0320939 .0265685 .1714006
/sigma_e | .9787393 .0076355 .9638878 .9938196
rho | .0047314 .0044823 .0006123 .0251942
------------------------------------------------------------------------------
Likelihood-ratio test of sigma_u=0: chibar2(01)= 13.55 Prob>=chibar2 = 0.000
################################################## ################################################## #######
. xtmixed w0mz rsppreg || stationcode:, mle nolog
Mixed-effects ML regression Number of obs = 8238
Group variable: stationcode Number of groups = 9
Obs per group: min = 384
avg = 915.3
max = 1846
Wald chi2(1) = 910.59
Log likelihood = -11146.214 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
w0mz | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
rsppreg | -.1956578 .0064839 -30.18 0.000 -.2083661 -.1829496
_cons | 11.72928 .6660864 17.61 0.000 10.42377 13.03478
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
stationcode: Identity |
sd(_cons) | 1.603851 .3820153 1.005587 2.558048
-----------------------------+------------------------------------------------
sd(Residual) | .9322329 .0072668 .9180985 .9465848
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 759.96 Prob >= chibar2 = 0.0000
To my understanding, the sigma_u and sd(_cons) should be equal; and the sigma_e and sd(Residual) should be equal.
And the ICC based on the xtmixed result is ~76%.
I got some missing value in w0mz and rsppreg, but it is already set as ".", should not be affected.
Can anyone help?
Thank you very much!
Comment