Extracting Standard Error Estimates

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
DewiOwen
Posts: 2
Joined: Wed Mar 21, 2012 9:28 am

Extracting Standard Error Estimates

Post by DewiOwen »

Dear all,

I have been running a binomial multilevel model using runmlwin (the code is included at the end of the post) and was wondering if it was possible to extract the standard error estimates. I have been able to extract the parameter estimates from the e(b) matrix but cannot locate the standard errors.

Any help would be gratefully appreciated.

All the best,
Dewi Owen

runmlwin code

Code: Select all

runmlwin yhalfu0e0 constant, level3(LA:constant) level2(LSOA:constant) ///
level1(LSOA) discrete(distribution(binomial) link(logit) denominator(population)) ///
nopause batch
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Extracting Standard Error Estimates

Post by ChrisCharlton »

You should be able to calculate this from the variance matrix, e(V). The following is an example of how to do this is:

Code: Select all

matrix stderr = vecdiag(e(V))
forvalues i = 1/`=colsof(stderr)' {
    matrix stderr[1,`i'] = sqrt(stderr[1,`i'])
}
This should give you a matrix with the same dimensions as e(b), but where the values are the standard error instead of the estimates.
DewiOwen
Posts: 2
Joined: Wed Mar 21, 2012 9:28 am

Re: Extracting Standard Error Estimates

Post by DewiOwen »

Hi Chris,

Worked perfectly. Great help. Thanks

All the best,
Dewi
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Extracting Standard Error Estimates

Post by GeorgeLeckie »

Hi Dewi

If all you want is to reference the standard error of a particular model parameter, then simply make use of _se[]

The following example should make things clear

Best wishes

George

Code: Select all

. use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear

. 
. runmlwin normexam cons standlrt, level2(school: cons) level1(student: cons) nopause
 
MLwiN 2.25 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)   =       1.58
Number of iterations =          4
Log likelihood       = -4678.6211
Deviance             =  9357.2422
------------------------------------------------------------------------------
    normexam |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        cons |   .0023908   .0400224     0.06   0.952    -.0760516    .0808332
    standlrt |   .5633712   .0124654    45.19   0.000     .5389394    .5878029
------------------------------------------------------------------------------

------------------------------------------------------------------------------
   Random-effects Parameters |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school              |
                   var(cons) |   .0921275   .0181475      .0565591     .127696
-----------------------------+------------------------------------------------
Level 1: student             |
                   var(cons) |    .565731   .0126585      .5409208    .5905412
------------------------------------------------------------------------------

. 
. display _se[FP1:cons]
.04002236

. 
. display _se[FP1:standlrt]
.0124654

. 
. display _se[RP2:var(cons)]
.01814751

. 
. display _se[RP1:var(cons)]
.01265848
Post Reply