tall sea pen taxa~Class + Depth + I(Depth^2) + Block + Class:Depth + Depth:Block, # Class + Depth + I(Depth^2) + Block + Class:Depth + Depth:Block tryCatch(taxa39.glm <- glm(taxa~Class + Depth + I(Depth^2) + Block + Class:Depth + Depth:Block, family=binomial(link="logit"), data=taxa.df), warning = function(x) { output.df[39,"flag"] <<- 1 }, finally = taxa39.glm <- glm(taxa~Class + Depth + I(Depth^2) + Block + Class:Depth + Depth:Block, family=binomial(link="logit"), data=taxa.df) ) summary(taxa39.glm) MODEL SUMMARY: ============== Call: glm(formula = sea_whip ~ factor(Class) + Depth + I(Depth^2) + factor(Block) + factor(Class):Depth + Depth:factor(Block), family = binomial(link="logit"), data = na.omit(d)) Deviance Residuals: Min 1Q Median 3Q Max -2.6752 -0.4688 0.2572 0.7440 2.4073 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -6.5020723 0.8018151 -8.109 5.10e-16 *** factor(Class)2 1.1795472 1.0172347 1.160 0.246227 factor(Class)3 2.0205740 1.4088511 1.434 0.151515 Depth 0.1701365 0.0217273 7.831 4.86e-15 *** I(Depth^2) -0.0006330 0.0001684 -3.759 0.000171 *** factor(Block)2 2.1135103 0.7460851 2.833 0.004614 ** factor(Block)3 0.5578155 0.9309282 0.599 0.549037 factor(Class)2:Depth -0.0228452 0.0141944 -1.609 0.107518 factor(Class)3:Depth -0.0796149 0.0216159 -3.683 0.000230 *** Depth:factor(Block)2 -0.0528564 0.0118935 -4.444 8.83e-06 *** Depth:factor(Block)3 -0.0458373 0.0162593 -2.819 0.004815 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 1277.16 on 922 degrees of freedom Residual deviance: 724.72 on 912 degrees of freedom AIC: 746.72 Number of Fisher Scoring iterations: 6 Analysis of Deviance Table Model: binomial, link: logit Response: sea_whip Terms added sequentially (first to last) Df Deviance Resid. Df Resid. Dev NULL 922 1277.16 factor(Class) 2 52.31 920 1224.84 Depth 1 391.71 919 833.13 I(Depth^2) 1 33.91 918 799.22 factor(Block) 2 41.53 916 757.70 factor(Class):Depth 2 10.41 914 747.29 Depth:factor(Block) 2 22.57 912 724.72 resample to 10 metersKrigsman, L.M., M.M. Yoklavich, E.J. Dick, and G.R. Cochrane (2012) Models and maps: predicting the distribution of corals and other benthic macro-invertebrates in shelf habitats. Ecosphere 3:1-16.