0

我有一个线性回归模型:

yi = α + βxi + ui

我想计算:

(\sigma_u)^2(X'X)^(-1)

我可以在 gretl 中做到这一点吗?如果不是,如何从 gretl 中获取 X 矩阵?

真的很感谢你的回复!!!

4

2 回答 2

4

这是一种方法。如果您想了解更多信息,我强烈建议您阅读gretl 指南的第 13 章。

open galton
list xlist = const parent child # or list xlist 0 1 2 
matrix X = {xlist}
ols const child parent --quiet
scalar sigma_u = $sigma
matrix res = sigma_u^2 * inv(X'X)
res

##  res
## res (3 x 3)

##    0.0010799  -1.2533e-05  -3.2771e-06 
##  -1.2533e-05   2.7165e-07  -8.8464e-08 
##  -3.2771e-06  -8.8464e-08   1.3688e-07 
于 2013-04-15T08:40:40.467 回答
2

dickoa:我想你的回答是:

open galton
list xlist = const parent # or list xlist 0 1 2 
matrix X = {xlist}
ols child const parent --quiet
scalar sigma_u = $sigma
matrix res = sigma_u^2 * inv(X'X)
res

无论如何,它甚至是一种更简单的方法:

open galton
list xlist = const parent # or list xlist 0 1 2 
matrix X = {xlist}
ols child const parent --quiet
matrix res = $vcv
res
于 2014-11-12T14:40:29.993 回答