質問

i have a linear regression model:

yi = α + βxi + ui

and I want to compute:

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

Can I do that in gretl and how? If not, how to get the X matrix out of gretl?

I really appreciate your reply!!!

役に立ちましたか?

解決

Here is one approach. If you want to learn more I urge you to read the chapter 13 of the gretl guide.

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 

他のヒント

dickoa: I supposse your response wanted to be:

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

In any case, it is even an easier way to do this:

open galton
list xlist = const parent # or list xlist 0 1 2 
matrix X = {xlist}
ols child const parent --quiet
matrix res = $vcv
res
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top