Generalized least squares regression

Thanks:  0
Likes:  0

# Thread: Generalized least squares regression

1. ## Generalized least squares regression

Is it possible to fit a GLS regression trendline to a graph as opposed to the ordinary least squares(OLS) method provided as standard? I'm just looking to be able to find the slope of a trendline but the data is autocorrelated so OLS trendlines aren't recommended.
Thanks

2. ## Re: Generalized least squares regression

You can find info on Autocorrelation and Generalized Least Squares Regression with Excel at:

Introductory Econometrics Chapter 20: Autocorrelation
http://www3.wabash.edu/econometrics/EconometricsBook/chap20.htm
Introductory Econometrics Chapter 20: Autocorrelation

At bottom of page:
Excel Workbooks
AutoCorr.xls
AutoCorr.xls

3. ## Re: Generalized least squares regression

If you're looking to the trendline facility on excel charts to do this, then I very much doubt if that will do it.

If you like, and if you know the autocorrelation coefficients, then it's not hard to transform data in Excel to make your data unautocorrelated, do the OLS regression on the transformed data and then chart it. Alternatively, use one of the many statistical programs around that have GLS procedures built in.

I don't see that autocorrelation is much of a problem for trendlines on charts, since even autocorrelated OLS still gives unbiased values for your coefficients, unless there are other problems too. Chart trendlines are only visual things so I very much doubt if it would look much different whether you allowed for the autocorrelation in charting or not.

It's only if you want to use the regression for more accurate purposes such as prediction ...

4. ## Re: Generalized least squares regression

Thanks for the replies guys. My data is mostly uncorrelated, I have a vba program written to test for autocorrelation. I'm batching the data into average points to lessen any existing correlation, however if I'm not mistaken, there will still be heteroskedasticity present in the data. I'm trying to fit an Amemiya GLS line to find the slope of the data points along the way to see when it chages.

5. ## Re: Generalized least squares regression

what easy software can you suggest that can make use of generalized least square method?

6. ## Re: Generalized least squares regression

Originally Posted by STATISTICS
what easy software can you suggest that can make use of generalized least square method?
Not much in Excel I'm afraid, although we could if needed look at any particular problem.

GLS in Excel would work by first pre-transforming the data appropriately (Excel is good at this) then doing standard regression on the transformed data using the LINEST function, the Data Analysis regression or other. There's also one or two ad hoc VBA regressions on this forum somewhere.

But probably best if you look through Google for pre-written programs, and/or some adequate statistics or econometrics texts, of which there's plenty around.

Why do you want to use GLS anyway? What sort of problem? The method actually has pretty wide scope of application. Why wouldn't ordinary regression be adequate?

7. ## Re: Generalized least squares regression

I was tasked to create regression equations that was in need of the use of GLS that is why i badly need it huhu. i was searching for it a lot of times but it's kind of difficult to understand. thank you for the reply..

8. ## Re: Generalized least squares regression

Originally Posted by STATISTICS
I was tasked to create regression equations that was in need of the use of GLS that is why i badly need it huhu. i was searching for it a lot of times but it's kind of difficult to understand. thank you for the reply..

why in need of GLS?
is this a homework or similar project?
and what's huhu? do you mean New Zealand's version of the Australian witchetty grub, or is there some other meaning?

9. ## Re: Generalized least squares regression

Originally Posted by mirabeau
why in need of GLS?
is this a homework or similar project?
and what's huhu? do you mean New Zealand's version of the Australian witchetty grub, or is there some other meaning?

huhu is like crying....

this is a project..

10. ## Re: Generalized least squares regression

Originally Posted by STATISTICS
huhu is like crying....

this is a project..
there's a VBA coded example of GLS in the below link, applied to weighting different rows of a regression differently (weighted regression).

this is just one use of GLS as posted on this forum, but I don't know just what you're looking for

http://www.mrexcel.com/forum/excel-q...ression-2.html

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•