Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: (Feasible) generalized least squares


From   Herb Smith <[email protected]>
To   [email protected]
Subject   st: (Feasible) generalized least squares
Date   Tue, 16 Jan 2007 13:03:24 -0500 (EST)

For a garden-variety, cross-sectional regression, an estimator of

var(b)

is

var(b)=invsym(X'*W*X)

where X is the design matrix and W is a diagonalized weight matrix.

Is there a way in Stata to get the FGLS estimated var-cov in a single
command?  By which I mean:

-regress depvar indvars [pweight=w]-

gives the GLS estimates for b

b=invsym(X'*W*X)*(X'*W*y)

but the standard errors are computed as though

-regress depvar indvars [pweight=w], vce(robust)-

and are close to the FGLS estimates, but are not the same....

It's really no big deal if there is not, but I am a bit surprised if there
is no way to do the weighted least square mechanics for both coefficients
AND their SEs by simply specifying a weight matrix for the standard
textbook matrix calculations....

Thanks!

--Herb

Herbert L. Smith
Professor of Sociology and
Director, Population Studies Center
230 McNeil Building
3718 Locust Walk CR
University of Pennsylvania
Philadelphia, PA  19104-6298

[email protected]

215.898.7768 (office)
215.898.2124 (fax)

On Tue, 16 Jan 2007, Herb Smith wrote:

> Maarten--
>
> This is wonderful and I appreciate the alacrity with which you have
> responded to me...
>
> But I do wonder a bit about the on-line help for mata, since this would
> seem to be a "natural" for the "Also see" section in, e.g.,
>
> -help mf_st_matrix-
>
> and while I now see that it follows immediately in the hard-copy MATA
> manual -- apologies, I am in my office, and I should have looked there
> first -- often we do not have the hardbound handy...
>
> Best,
>
> --Herb
>
> Professor of Sociology and
> Director, Population Studies Center
> 230 McNeil Building
> 3718 Locust Walk CR
> University of Pennsylvania
> Philadelphia, PA  19104-6298
>
> [email protected]
>
> 215.898.7768 (office)
> 215.898.2124 (fax)
>
> On Tue, 16 Jan 2007, Maarten buis wrote:
>
> > --- Herb Smith <[email protected]> wrote:
> >
> > > Thanks.  But now I am flummoxed on how to return a scalar, in
> > > particular e(rmse)
> >
> > *------------ begin example -----------
> > sysuse auto, clear
> > reg price mpg foreign
> > mata
> > rmse = st_numscalar("e(rmse)")
> > rmse
> > end
> > *----------- end example --------------
> >
> > Hope this helps,
> > Maarten
> >
> > -----------------------------------------
> > Maarten L. Buis
> > Department of Social Research Methodology
> > Vrije Universiteit Amsterdam
> > Boelelaan 1081
> > 1081 HV Amsterdam
> > The Netherlands
> >
> > visiting address:
> > Buitenveldertselaan 3 (Metropolitan), room Z434
> >
> > +31 20 5986715
> >
> > http://home.fsw.vu.nl/m.buis/
> > -----------------------------------------
> >
> >
> >
> > ___________________________________________________________
> > What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship.
> > http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk
> > *
> > *   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/
> >
> *
> *   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/
>
*
*   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/



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