> > salmon.mod1 <- lm(logtrap ~ water) > summary(salmon.mod1) Call: lm(formula = logtrap ~ water) Residuals: Min 1Q Median 3Q Max -3.7177 -0.8663 0.3814 1.3382 2.9111 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.655146 0.460642 1.422 0.162 water 0.015643 0.001866 8.385 1.36e-10 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.675 on 43 degrees of freedom Multiple R-squared: 0.6205, Adjusted R-squared: 0.6117 F-statistic: 70.31 on 1 and 43 DF, p-value: 1.359e-10 > plot(residuals(salmon.mod1),type="l") > > library(car) > durbinWatsonTest(salmon.mod1) lag Autocorrelation D-W Statistic p-value 1 0.3255393 1.287346 0.016 Alternative hypothesis: rho != 0 > > library(nlme) > > salmon.mod2 <- gls(logtrap ~ water, correlation=corARMA(p=1), method='ML') > summary(salmon.mod2) Generalized least squares fit by maximum likelihood Model: logtrap ~ water Data: NULL AIC BIC logLik 173.3490 180.5757 -82.67451 Correlation Structure: AR(1) Formula: ~1 Parameter estimate(s): Phi 0.4217852 Coefficients: Value Std.Error t-value p-value (Intercept) 1.0903352 0.5405791 2.016976 0.05 water 0.0132779 0.0017986 7.382224 0.00 Correlation: (Intr) water -0.686 Standardized residuals: Min Q1 Med Q3 Max -2.2068095 -0.6521012 0.1809419 0.8540458 1.8526576 Residual standard error: 1.67204 Degrees of freedom: 45 total; 43 residual