Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Blups after xtmixed/xtmelogit


From   Neal Beck <nealinmadrid@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Blups after xtmixed/xtmelogit
Date   Thu, 11 Mar 2010 17:16:46 +0100

Gracias

From Neal's Touch in Madrid

El 11/03/2010, a las 05:11 p.m., Maarten buis <maartenbuis@yahoo.co.uk> escribió:

--- 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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index