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 on April 23, and its replacement, is already up and running.

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

Re: st: Blups after xtmixed/xtmelogit

From   Maarten buis <>
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."))     ///
*---------------- end example -------------------

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


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index