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
"Nick Cox" <[email protected]>
To
<[email protected]>
Subject
RE: st: Blups after xtmixed/xtmelogit
Date
Thu, 11 Mar 2010 18:24:12 -0000
For -labmask-, -search- to identify its Stata Journal source.
Nick
[email protected]
Maarten buis
--- 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 -------------------
*
* 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/