在Stata中运行mixed
命令的手动示例:
use http://www.stata-press.com/data/r13/pig
mixed weight week || id:
我得到以下结果:
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -1014.9268
Iteration 1: log likelihood = -1014.9268
Computing standard errors:
Mixed-effects ML regression Number of obs = 432
Group variable: id Number of groups = 48
Obs per group: min = 9
avg = 9.0
max = 9
Wald chi2(1) = 25337.49
Log likelihood = -1014.9268 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
weight | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
week | 6.209896 .0390124 159.18 0.000 6.133433 6.286359
_cons | 19.35561 .5974059 32.40 0.000 18.18472 20.52651
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Identity |
var(_cons) | 14.81751 3.124226 9.801716 22.40002
-----------------------------+------------------------------------------------
var(Residual) | 4.383264 .3163348 3.805112 5.04926
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 472.65 Prob >= chibar2 = 0.0000
我的问题是 - 我是否可以通过编程方式访问“随机效应参数”的估算值:var(_cons)
和var(Residual)
?
我尝试过return(list)
& ereturn(list)
但似乎没有。{/ p>
答案 0 :(得分:3)
我在加州大学洛杉矶分校website找到了一个选项:
* var(cons)
_diparm lns1_1_1, f(exp(@)^2) d(2*exp(@)^2)
* var(Residual)
_diparm lnsig_e, f(exp(@)^2) d(2*exp(@)^2)