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]
st: how to output random effects parameters using outreg2?
From
"Sheena Sullivan" <[email protected]>
To
<[email protected]>
Subject
st: how to output random effects parameters using outreg2?
Date
Tue, 8 May 2012 16:29:33 +1000
I am building random effects models using xtmixed in Stata 11. I want to
create a table of the output to compare models as I build them. I can get
outreg2 to output a table of the coefficients, easily enough: (Below is
sample code using a dataset provided on the ATS website.)
use http://www.ats.ucla.edu/stat/stata/examples/alda/data/reading_pp, clear
*unconditional means model
xtmixed piat || id: , reml cov(un) var
outreg2 using myoutput, stats(coef ci)
*unconditional growth model
xtmixed piat wave || id: wave, reml cov(un) var
outreg2 using myoutput, stats(coef ci) append
etc...
But I'm unsure how to output the estimates from the table of "Random-effects
parameters".
The list of saved results - ereturn list- doesn't seem to include the random
effects estimates explicitly. I know I can get the var(Residual) by the
following:
mat b=e(b)
local e1=el(b,1,colsof(b))
mat e1=exp(`e1')^2
mat list e1
outreg2 using myoutput, stats(coef ci e1) append
where e1 is included with the other stats and output to "myoutput".
However, I'm unsure of 1) whether this is the most efficient method and 2)
how to calculate the other variance estimates, e.g. for var(_cons) or
var(wave) or others that will appear as the models grows.
Any advice would be greatly appreciated.
Thanks
Sheena
*
* 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/