Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: GLS in STATA

From   "Clive Nicholas" <>
Subject   Re: st: GLS in STATA
Date   Tue, 29 Jun 2004 22:34:26 +0100 (BST)

Rijo John wrote:

> Is there a simple way to do Generalised Least squares in STATA?

The default -xtreg- command fits random-effects GLS models. -xtgls- fits
cross-sectional time-series FGLS regressions.

> The robust option along with the _regress_ is not equivallant to doing a
> GLS right? So appart from doing GLS as below is there a simple command
> which does the job?
> regress depvar x1.... xk
> predict e, residual
> generate esq = e^ 2
> regress esq x1.... xk
> predict v
> regress depvar x1.... xk [aweight = 1/v]
> [This is a feasible GLS estimation or feasible weighted least sqares
> estimation]

Looks like WLS to me, which you can fit with rather less hassle by

. xtreg y x1 x2 xk, be wls

which gives you the 'between-effects' model. See -whelp xtreg- for more.

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e:
Newcastle University  |
*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index