> I want to get estimates of beta:
>
> beta=inv(X'*W*X)*(X'*W*Y), where W as already known.
>
> Is there a program that can do this?
mat glsaccum YXWYX = Y X , group(groupvar) glsmat(W)
mat XWX = YXWYX[2...,2...]
mat XWY = YXWYX[1,2...]
mat beta = inv(XWX)*XWY
If you have some sort of panel data, the -groupvar- should be your panel
id. If you only have one piece of data all of which is heavily correlated,
you can try specifying _cons in place of the -groupvar-. You can get the
regular standard errors by the regular GLS formulae, but I am not sure
there is an easy and obvious way to get the "robust"/sandwich standard
errors.
Try it up with W = I to see if it reproduces -regress-.
--- Stas Kolenikov
-- Ph.D. student in Statistics at UNC-Chapel Hill
- http://www.komkon.org/~tacik/ -- [email protected]
* This e-mail and all attachments to it are not intended to provide any
* reasonable point of view and was transmitted to you in error. It
* should be immediately deleted by all recipients unless they really
* enjoy communicating with the author :). Other restrictions apply.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/