Hi,
I was wondering if it is possible to access the covariance between the random effect residuals after fitting a model.
runmlwin height con age , level1(age: cons ) level2(id : cons age, residuals(resid , var) )
I was almost hoping it might be something like this
runmlwin ..... .... , residuals(resid , covar)
Thanks Adrian
Residual covariance estimate
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Residual covariance estimate
Hi Adrian,
When you use the residuals() option, runmlwin returns the point estimate and standard error for each residual u0_j and u1_j. The standard errors are simply the square roots of the sampling variances for each residuals. Sounds like you additionally want to know what the sampling covariance is between each pair of residuals u0_j and u1_j for each group j.
You can retrieve the full sampling variance-covariance matrix for each pair of residuals u0_j and u1_j as follows.
Best wishes
George
When you use the residuals() option, runmlwin returns the point estimate and standard error for each residual u0_j and u1_j. The standard errors are simply the square roots of the sampling variances for each residuals. Sounds like you additionally want to know what the sampling covariance is between each pair of residuals u0_j and u1_j for each group j.
You can retrieve the full sampling variance-covariance matrix for each pair of residuals u0_j and u1_j as follows.
Code: Select all
use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear
runmlwin normexam cons standlrt, ///
level2 (school: cons standlrt, residuals(u, sampling)) ///
level1 (student: cons) ///
nopause
MLwiN 2.26 multilevel model Number of obs = 4059
Normal response model
Estimation algorithm: IGLS
-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
school | 65 2 62.4 198
-----------------------------------------------------------
Run time (seconds) = 2.45
Number of iterations = 4
Log likelihood = -4658.4351
Deviance = 9316.8701
------------------------------------------------------------------------------
normexam | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cons | -.0115052 .039783 -0.29 0.772 -.0894784 .066468
standlrt | .5567305 .019937 27.92 0.000 .5176548 .5958063
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school |
var(cons) | .0904446 .017924 .0553143 .1255749
cov(cons,standlrt) | .0180414 .0067229 .0048649 .031218
var(standlrt) | .0145361 .0044139 .0058851 .0231872
-----------------------------+------------------------------------------------
Level 1: student |
var(cons) | .5536575 .0124818 .5291936 .5781214
------------------------------------------------------------------------------
. describe u0* u1*
storage display value
variable name type format label variable label
------------------------------------------------------------------------------
u0 float %9.0g u0 residual estimate
u0se float %9.0g u0se residual standard error
u0var float %9.0g u0var sampling variance
u0u1cov float %9.0g u0u1cov sampling covariance
u1 float %9.0g u1 residual estimate
u1se float %9.0g u1se residual standard error
u1var float %9.0g u1var sampling variance
George
Re: Residual covariance estimate
Many thanks George, thats perfect.
I should have read the help file more carefully.
bw
Adrian
I should have read the help file more carefully.
bw
Adrian