Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Blups after xtmixed/xtmelogit


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Blups after xtmixed/xtmelogit
Date   Thu, 11 Mar 2010 08:11:42 -0800 (PST)

--- On Thu, 11/3/10, Neal Beck wrote:
> Using most recent S11, I am looking for an easy way (stress
> easy way) to produce nice output of blups with their se's.

I think the trick is not to think of these predictions as matrices or vectors, but instead as variables (temporarily) added to your dataset.
See for example the example below: 

*----------------- begin example ------------------
webuse pig, clear
xtmixed weight week || id:

predict b*, reffects
predict se*, reses

bys id (b1): keep if _n == 1

gen lb = b1 - invnormal(0.975)*se1
gen ub = b1 + invnormal(0.975)*se1

sort b1
gen x = _n
labmask x, values(id)
label variable x "id"

twoway rcap lb ub x ||                       ///
       scatter b1 x,                         ///
       mlab(id) mlabpos(0) msymbol(none)     ///
       xlabel(1/48, val angle(vertical))     ///
       legend(order(2 "blup"                 ///
                    1 "95% conf. int."))     ///
       xsize(7) 
*---------------- end example -------------------

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index