S-PLUS : Copyright (c) 1988, 2003 Insightful Corp. S : Copyright Lucent Technologies, Inc. Professional Edition Version 6.2.1 for Microsoft Windows : 2003 Working data will be in C:\PROGRA~1\INSIGH~1\splus62\users\beckerbe > library(mass) > ob.nb.full<-glm.nb(OB.Total~LowerTot+ENSO.YRS+Oyster.new+tide,dataset=Oct.07.subsite.dataset) Problem: Object "OB.Total" not found Use traceback() to see the call stack > ob.nb.full<-glm.nb(OB.total~LowerTot+ENSO.YRS+Oyster.new+tide,dataset=Oct.07.subsite.dataset) Problem: Object "OB.total" not found Use traceback() to see the call stack > ob.nb.full<-glm.nb(ob.total~LowerTot+ENSO.YRS+Oyster.new+tide,dataset=Oct.07.subsite.dataset) Problem: Object "ob.total" not found Use traceback() to see the call stack > attach(Oct.07.subsite.dataset) > ob.nb.full<-glm.nb(OB.total~LowerTot+ENSO.YRS+Oyster.new+tide,dataset=Oct.07.subsite.dataset) Problem: Object "OB.total" not found Use traceback() to see the call stack > > ob.nb.full<-glm.nb(OB.total~LowerTot+ENSO.YRS+Oyster.new+tide,dataset=Oct.07.subsite.dataset) Problem: Object "OB.total" not found Use traceback() to see the call stack > ob.nb.full<-glm.nb(OB.Total~LowerTot+ENSO.YRS+Oyster.new+tide,dataset=Oct.07.subsite.dataset) > summary*ob.nb.full) Problem: Syntax error: No opening parenthesis before unbalanced (")") on input line 1 > summary(ob.nb.full) Call: glm.nb(formula = OB.Total ~ LowerTot + ENSO.YRS + Oyster.new + tide, dataset = Oct.07.subsite.dataset, init.theta = 0.903539282862498, link = log) Deviance Residuals: Min 1Q Median 3Q Max -2.970834 -0.8826535 -0.3138208 0.2936652 2.023533 Coefficients: Value Std. Error t value (Intercept) 3.300372e+000 4.093701e-001 8.0620739 LowerTot 4.847970e-004 6.364504e-004 0.7617199 ENSO.YRS 2.465199e-001 4.082986e-002 6.0377361 Oyster.new -2.262099e-006 7.424010e-007 -3.0470044 tide -6.033896e-002 1.391659e-001 -0.4335758 (Dispersion Parameter for Negative Binomial family taken to be 1 ) Null Deviance: 160.4662 on 103 degrees of freedom Residual Deviance: 125.5256 on 99 degrees of freedom Number of Fisher Scoring Iterations: 1 Correlation of Coefficients: (Intercept) LowerTot ENSO.YRS Oyster.new LowerTot -0.8512056 ENSO.YRS -0.1347487 -0.2002612 Oyster.new -0.3774466 0.2288514 -0.4209445 tide 0.0197470 -0.1061145 0.1248576 0.0186773 Theta: 0.904 Std. Err.: 0.125 2 x log-likelihood: -1090.616 > ob.2345.nb<-glm(OB.Total~LowerTot+ENSO.YRS+Oyster.new+tide,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > ob.234.nb<-glm(OB.Total~LowerTot+ENSO.YRS+Oyster.new,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > ob.34.nb<-glm(OB.Total~ENSO.YRS+Oyster.new,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > ob.345.nb<-glm(OB.Total~ENSO.YRS+Oyster.new+tide,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > summary(ob.2345.nb) Call: glm(formula = OB.Total ~ LowerTot + ENSO.YRS + Oyster.new + tide, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -2.966194 -0.8810555 -0.3131821 0.2931741 2.018742 Coefficients: Value Std. Error t value (Intercept) 3.300693e+000 3.698706e-001 8.9239119 LowerTot 4.841448e-004 5.750440e-004 0.8419266 ENSO.YRS 2.465145e-001 3.688992e-002 6.6824342 Oyster.new -2.261802e-006 6.707681e-007 -3.3719581 tide -6.021249e-002 1.257391e-001 -0.4788686 (Dispersion Parameter for Negative Binomial family taken to be 0.8132014 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 125.1041 on 99 degrees of freedom Number of Fisher Scoring Iterations: 14 Correlation of Coefficients: (Intercept) LowerTot ENSO.YRS Oyster.new LowerTot -0.8512056 ENSO.YRS -0.1347328 -0.2002697 Oyster.new -0.3774614 0.2288476 -0.4209249 tide 0.0197412 -0.1061086 0.1248597 0.0186787 > summary(ob.234.nb) Call: glm(formula = OB.Total ~ LowerTot + ENSO.YRS + Oyster.new, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -2.958019 -0.9150432 -0.3056228 0.3278792 1.902667 Coefficients: Value Std. Error t value (Intercept) 3.269265e+000 3.661116e-001 8.9296954 LowerTot 5.154691e-004 5.660651e-004 0.9106182 ENSO.YRS 2.506781e-001 3.624387e-002 6.9164279 Oyster.new -2.287273e-006 6.640408e-007 -3.4444768 (Dispersion Parameter for Negative Binomial family taken to be 0.7971586 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 125.2823 on 100 degrees of freedom Number of Fisher Scoring Iterations: 7 Correlation of Coefficients: (Intercept) LowerTot ENSO.YRS LowerTot -0.8540581 ENSO.YRS -0.1383975 -0.1895696 Oyster.new -0.3778846 0.2321773 -0.4267632 > summary(ob.34.nb) Call: glm(formula = OB.Total ~ ENSO.YRS + Oyster.new, family = negative.binomial( 0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -2.994016 -0.9105379 -0.3331829 0.348819 1.705641 Coefficients: Value Std. Error t value (Intercept) 3.530109e+000 1.848919e-001 19.092830 ENSO.YRS 2.615684e-001 3.455309e-002 7.570044 Oyster.new -2.394771e-006 6.272769e-007 -3.817724 (Dispersion Parameter for Negative Binomial family taken to be 0.7516149 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 126.0884 on 101 degrees of freedom Number of Fisher Scoring Iterations: 7 Correlation of Coefficients: (Intercept) ENSO.YRS ENSO.YRS -0.5878106 Oyster.new -0.3548524 -0.4010442 > AIC(ob.2345.nb,ob.234.nb,ob.23.nb,ob.345) Problem: Object "ob.23.nb" not found Use traceback() to see the call stack > AIC(ob.2345.nb,ob.234.nb,ob.34.nb,ob.345) Problem: Object "ob.345" not found Use traceback() to see the call stack > AIC(ob.2345.nb,ob.234.nb,ob.34.nb,ob.345.nb) df AIC ob.2345.nb 6 325.8751 ob.234.nb 5 324.0746 ob.34.nb 4 322.8260 ob.345.nb 5 324.5510 > plot.gam(ob.2345.nb) > plot.gam(ob.2345.nb,se=T,resid=T) > ob.2.345.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS+Oyster.new+tide,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > summary(ob.2.345.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS + Oyster.new + tide, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -3.037996 -0.7748048 -0.3036309 0.3543194 2.007081 Coefficients: Value Std. Error t value (Intercept) 1.94625256245 5.787936e-001 3.3626021 LowerTot.year 0.00288263457 9.912790e-004 2.9079951 ENSO.YRS 0.23520833467 3.686599e-002 6.3800900 Oyster.new -0.00000199944 6.841980e-007 -2.9223114 tide -0.06057076095 1.203294e-001 -0.5033748 (Dispersion Parameter for Negative Binomial family taken to be 0.7517869 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 119.6931 on 99 degrees of freedom Number of Fisher Scoring Iterations: 9 Correlation of Coefficients: (Intercept) LowerTot.year ENSO.YRS Oyster.new LowerTot.year -0.9463373 ENSO.YRS 0.1276248 -0.3270184 Oyster.new -0.4808561 0.3966872 -0.4710924 tide -0.0505376 0.0072426 0.0982206 0.0434848 > ob.2.45.nb<-glm(OB.Total~LowerTot.year+Oyster.new+tide,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > summary(ob.2.45.nb) Call: glm(formula = OB.Total ~ LowerTot.year + Oyster.new + tide, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -2.987367 -0.9465955 -0.2790269 0.2605741 2.116011 Coefficients: Value Std. Error t value (Intercept) 2.657623e+000 6.251402e-001 4.251243 LowerTot.year 3.363512e-003 1.021249e-003 3.293527 Oyster.new -7.454713e-007 6.594425e-007 -1.130457 tide -1.943136e-001 1.307630e-001 -1.485998 (Dispersion Parameter for Negative Binomial family taken to be 0.9006164 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 146.5983 on 100 degrees of freedom Number of Fisher Scoring Iterations: 6 Correlation of Coefficients: (Intercept) LowerTot.year Oyster.new LowerTot.year -0.9648789 Oyster.new -0.4792024 0.2883287 tide -0.0643773 0.0422245 0.1023106 > ob.2.5.nb<-glm(OB.Total~LowerTot.year+tide,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > ob.2..nb<-glm(OB.Total~LowerTot.year,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > AIC(ob.2.345.nb,ob.2.45.nb,ob.2.5.nb,ob.2..nb) df AIC ob.2.345.nb 6 321.3807 ob.2.45.nb 5 340.7587 ob.2.5.nb 4 339.5328 ob.2..nb 3 338.7700 > ob.2.35.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS+tide,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > AIC(ob.2.345.nb,ob.2.45.nb,ob.2.5.nb,ob.2..nb,ob.2.35.nb) df AIC ob.2.345.nb 6 321.3807 ob.2.45.nb 5 340.7587 ob.2.5.nb 4 339.5328 ob.2..nb 3 338.7700 ob.2.35.nb 5 326.0053 > summary(ob.2.345.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS + Oyster.new + tide, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -3.037996 -0.7748048 -0.3036309 0.3543194 2.007081 Coefficients: Value Std. Error t value (Intercept) 1.94625256245 5.787936e-001 3.3626021 LowerTot.year 0.00288263457 9.912790e-004 2.9079951 ENSO.YRS 0.23520833467 3.686599e-002 6.3800900 Oyster.new -0.00000199944 6.841980e-007 -2.9223114 tide -0.06057076095 1.203294e-001 -0.5033748 (Dispersion Parameter for Negative Binomial family taken to be 0.7517869 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 119.6931 on 99 degrees of freedom Number of Fisher Scoring Iterations: 9 Correlation of Coefficients: (Intercept) LowerTot.year ENSO.YRS Oyster.new LowerTot.year -0.9463373 ENSO.YRS 0.1276248 -0.3270184 Oyster.new -0.4808561 0.3966872 -0.4710924 tide -0.0505376 0.0072426 0.0982206 0.0434848 > summary(ob.2.35.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS + tide, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -3.030335 -0.8363314 -0.3373978 0.2525729 1.866998 Coefficients: Value Std. Error t value (Intercept) 1.308823808 0.545743395 2.3982403 LowerTot.year 0.003632736 0.000978858 3.7111981 ENSO.YRS 0.202955887 0.034939246 5.8088228 tide -0.087535418 0.129249182 -0.6772609 (Dispersion Parameter for Negative Binomial family taken to be 0.8708948 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 127.3952 on 100 degrees of freedom Number of Fisher Scoring Iterations: 5 Correlation of Coefficients: (Intercept) LowerTot.year ENSO.YRS LowerTot.year -0.9389109 ENSO.YRS -0.1270242 -0.1734750 tide -0.0334703 -0.0110712 0.1344576 > ob.2.34.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS+Oyster.new,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > summary(ob.2.34.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS + Oyster.new, family = negative.binomial(0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -3.069789 -0.7966488 -0.3106858 0.3815318 1.865826 Coefficients: Value Std. Error t value (Intercept) 1.925910e+000 5.696104e-001 3.381100 LowerTot.year 2.892441e-003 9.767506e-004 2.961289 ENSO.YRS 2.393674e-001 3.615511e-002 6.620569 Oyster.new -2.020797e-006 6.735773e-007 -3.000097 (Dispersion Parameter for Negative Binomial family taken to be 0.729925 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 119.8851 on 100 degrees of freedom Number of Fisher Scoring Iterations: 7 Correlation of Coefficients: (Intercept) LowerTot.year ENSO.YRS LowerTot.year -0.9472033 ENSO.YRS 0.1332747 -0.3292392 Oyster.new -0.4796490 0.3967434 -0.4782074 > AIC(ob.2.34.nb) [1] 319.6026 > plot.gam(ob.2.34.nb) > plot.gam(ob.2.34.nb,resid=T,se=T) > ob.2.3.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS,family=negative.binomial(0.9),dataset=Oct.07.subsite.dataset) > AIC(ob.2.3.nb) [1] 324.3679 > AIC(ob.2.3.nb) [1] 324.3679 > summary(ob.2.3.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS, family = negative.binomial( 0.9), dataset = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -3.076683 -0.8490833 -0.3277807 0.2549052 1.904252 Coefficients: Value Std. Error t value (Intercept) 1.270651721 0.54141904 2.346891 LowerTot.year 0.003665619 0.00097154 3.772999 ENSO.YRS 0.207359185 0.03436604 6.033841 (Dispersion Parameter for Negative Binomial family taken to be 0.8580065 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 127.7781 on 101 degrees of freedom Number of Fisher Scoring Iterations: 5 Correlation of Coefficients: (Intercept) LowerTot.year LowerTot.year -0.9398624 ENSO.YRS -0.1238342 -0.1734706 > AIC(ob.2.345.nb,ob.2.45.nb,ob.2.5.nb,ob.2..nb,ob.2.35.nb,ob.2.34.nb,ob.2.3.nb) df AIC ob.2.345.nb 6 321.3807 ob.2.45.nb 5 340.7587 ob.2.5.nb 4 339.5328 ob.2..nb 3 338.7700 ob.2.35.nb 5 326.0053 ob.2.34.nb 5 319.6026 ob.2.3.nb 4 324.3679 > plot.gam(ob.2.345.nb,resid=T,se=T) > plot.gam(ob.2.34.nb,resid=T,se=T) > ob.2.3.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS,family=negative.binomial(0.9),data=Oct.07.subsite.dataset) > ob.2.3.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS,f=negative.binomial(0.9),data=Oct.07.subsite.dataset) > ob.2.3.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS,f=negative.binomial(0.9),d=Oct.07.subsite.dataset) > summary(ob.2.3.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS, data = Oct.07.subsite.dataset, f = negative.binomial(0.9)) Deviance Residuals: Min 1Q Median 3Q Max -134.5541 -40.31134 -17.7148 15.6803 268.6238 Coefficients: Value Std. Error t value (Intercept) -74.0910738 41.46210986 -1.786959 LowerTot.year 0.2136988 0.07474278 2.859123 ENSO.YRS 8.6057145 2.63216538 3.269443 (Dispersion Parameter for Gaussian family taken to be 5708.766 ) Null Deviance: 708137.5 on 103 degrees of freedom Residual Deviance: 576585.4 on 101 degrees of freedom Number of Fisher Scoring Iterations: 1 Correlation of Coefficients: (Intercept) LowerTot.year LowerTot.year -0.9406028 ENSO.YRS -0.1121490 -0.1825227 > ob.2.3.nb<-glm(OB.Total~LowerTot.year+ENSO.YRS,family=negative.binomial(0.9),data=Oct.07.subsite.dataset) > summary(ob.2.3.nb) Call: glm(formula = OB.Total ~ LowerTot.year + ENSO.YRS, family = negative.binomial( 0.9), data = Oct.07.subsite.dataset) Deviance Residuals: Min 1Q Median 3Q Max -3.076683 -0.8490833 -0.3277807 0.2549052 1.904252 Coefficients: Value Std. Error t value (Intercept) 1.270651721 0.54141904 2.346891 LowerTot.year 0.003665619 0.00097154 3.772999 ENSO.YRS 0.207359185 0.03436604 6.033841 (Dispersion Parameter for Negative Binomial family taken to be 0.8580065 ) Null Deviance: 159.9099 on 103 degrees of freedom Residual Deviance: 127.7781 on 101 degrees of freedom Number of Fisher Scoring Iterations: 5 Correlation of Coefficients: (Intercept) LowerTot.year LowerTot.year -0.9398624 ENSO.YRS -0.1238342 -0.1734706 > AIC(ob.2.345.nb,ob.2.45.nb,ob.2.5.nb,ob.2..nb,ob.2.35.nb,ob.2.34.nb,ob.2.3.nb) df AIC ob.2.345.nb 6 321.3807 ob.2.45.nb 5 340.7587 ob.2.5.nb 4 339.5328 ob.2..nb 3 338.7700 ob.2.35.nb 5 326.0053 ob.2.34.nb 5 319.6026 ob.2.3.nb 4 324.3679 > AIC(ob.2.345.nb,ob.2.45.nb,ob.2.5.nb,ob.2..nb,ob.2.35.nb,ob.2.34.nb,ob.2.3.nb,ob.34.nb) df AIC ob.2.345.nb 6 321.3807 ob.2.45.nb 5 340.7587 ob.2.5.nb 4 339.5328 ob.2..nb 3 338.7700 ob.2.35.nb 5 326.0053 ob.2.34.nb 5 319.6026 ob.2.3.nb 4 324.3679 ob.34.nb 4 322.8260 > ob.12.3.nb<-glm(OB.Total~year+LowerTot.year+ENSO.YRS,family=negative.binomial(0.9),data=Oct.07.subsite.dataset) Problem: Object "year" not found Use traceback() to see the call stack > ob.12..nb<-glm(OB.Total~Year+LowerTot.year,family=negative.binomial(0.9),data=Oct.07.subsite.dataset) > AIC(ob.12..nb) [1] 327.0937 >