| To: | s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | Problem with gls |
| From: | Wim Kimmerer <kimmerer@sfsu.edu> |
| Date: | Tue, 08 May 2007 08:33:59 -0700 |
|
Hello S-Plussers. v. 6.2, Windows XP I am trying to use gls to compare the output of a hydrodynamic model with data for tidal height and flow. The main issue for this particular comparison is how close the slope of a regression is to 1. I have long time series (thousands of points) but of course lots of autocorrelation. I tried gls as follows: z <- lm(data ~ model.lag, data=""> va <- acf(z$resid, plot=F)$acf[2] zg <- gls (data ~ model.lag, data="" correlation=corAR1(va)) ------------------ This works OK, but the results are (snipped): Linear regression: Value Std. Error t value Pr(>|t|) (Intercept) 115.4604 14.1993 8.1314 0.0000 model.lag 0.9823 0.0022 438.0841 0.0000 Residual standard error: 776.5 on 2991 degrees of freedom ---------- gls: Correlation Structure: AR(1) Formula: ~ 1 Parameter estimate(s): Phi 0.9368339 Coefficients: Value Std.Error t-value p-value (Intercept) 96.05244 91.10014 1.0544 0.2918 model.lag 0.91049 0.00573 158.7623 <.0001 Residual standard error: 904.4512 ----------- The slope is much lower with gls, and the residuals are larger. Why should this be so? All I am trying to do is to account for the autocorrelation in the original regression z, in the most robust manner. The regression coefficient in z is not in question but the standard error is - so why do lm and gls not estimate the same thing? I have also tried gls in another situation where I had both autocorrelation and increasing error variance with the mean. In a couple of cases gls converged but gave a slope that was clearly miles away from the actual relationship. I would appreciate any help from anybody.... the manuals etc. are not much help at all. Wim Dr. Wim Kimmerer Research Professor of Biology Romberg Tiburon Center San Francisco State University 3152 Paradise Drive Tiburon CA 94920 Ph. (415) 435-7143 Fax (415) 435-7120 http://online.sfsu.edu/~kimmerer/ |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | permanent boolean variables, Dave Evens |
|---|---|
| Next by Date: | Re: permanent boolean variables, Michael Camilleri |
| Previous by Thread: | permanent boolean variables, Dave Evens |
| Next by Thread: | QUESTION: Is there an Splus equivalent to the R package "gmodels"?, Tat, Tri Vi (TGRD) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |