setwd("C:/Users/Nikol/Documents/Ciguatara Project/Data/CXT Data")
All = read.csv("CTX_All_NR.csv")
dim(All) #examine data
## [1] 197 23
head(All,7)# examine data
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B Buffer
## 1 Anaehoom AB02 CEAR 35 10 14.23 1827.46 0 0 0 40
## 2 Anaehoom AB05 CEAR 47 22 14.23 1827.46 0 0 0 40
## 3 Anaehoom AB06 CEAR 29.5 7 14.23 1827.46 0 0 0 40
## 4 Anaehoom AB07 CEAR 31.5 9 14.23 1827.46 0 0 0 40
## 5 Anaehoom AB11 CEAR 22.5 10 14.23 1827.46 0 0 0 40
## 6 Anaehoom AB12 CEAR 29 5 14.23 1827.46 0 0 0 40
## 7 Anaehoom AB22 CEAR 41.5 12 14.23 1827.46 0 0 0 40
## boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 1 0.000 0 0 1.000 0 2.62089 27.8167
## 2 0.128 0 0 0.872 0 2.64007 35.3690
## 3 0.000 0 0 1.000 0 2.62772 26.8266
## 4 0.000 0 0 1.000 0 2.62876 34.4041
## 5 0.000 0 0 1.000 0 2.61802 25.8674
## 6 0.369 0 0 0.631 0 2.61319 39.4247
## 7 0.000 0 0 1.000 0 2.61736 22.3 21.0566
## mean_depth BAA3 BAA5 BAA7
## 1 -5.9999 67 69 121
## 2 -4.9986 67 69 121
## 3 -6.6052 67 69 121
## 4 -5.5554 67 69 121
## 5 -5.9993 67 69 121
## 6 -2.6409 67 69 .
## 7 -6.7602 67 69 121
library(GlmSimulatoR)
## Warning: package 'GlmSimulatoR' was built under R version 4.0.5
library(ggplot2)
library(cplm, quietly = TRUE)
set.seed(1)
library(ggplot2)
library(ggpubr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(AICcmodavg)
library(tweedie)
library(statmod) # For the `glm.tweedie` function
library(Metrics) # For AIC calculation
## Warning: package 'Metrics' was built under R version 4.0.5
library(pscl)
## Classes and Methods for R developed in the
## Political Science Computational Laboratory
## Department of Political Science
## Stanford University
## Simon Jackman
## hurdle and zeroinfl functions by Achim Zeileis
library(psych)
##
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
library(tidyr)
##
## Attaching package: 'tidyr'
## The following objects are masked from 'package:Matrix':
##
## expand, pack, unpack
CTST = subset(All, Species =="CTST")
dim(CTST) #examine data
## [1] 109 23
headTail(CTST,2)# examine data
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B Buffer
## 89 Anaehoom AB01 CTST 13 6 14.23 1827.46 0 0 0 20
## 90 Anaehoom AB03 CTST 13 4 14.23 1827.46 1 1 0.4 20
## ... <NA> <NA> <NA> <NA> <NA> ... ... <NA> <NA> <NA> ...
## 194 Puako PU14 CTST 13 3 4.13 2827.84 0 0 0 20
## 195 Puako PU15 CTST 15 5 4.13 2827.84 . . . 20
## 196 Puako PU22 CTST 18 7 4.13 2827.84 . . . 20
## 197 Puako PU28 CTST 15 6 4.13 2827.84 0 0 0 20
## boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 89 0 0 0 1 0 2.61 37.6
## 90 0 0 0 1 0 2.61 37.36
## ... ... ... ... ... ... ... <NA> ...
## 194 0 0 0 1 0 1.99 13035.25 28.52
## 195 0 0 0 1 0 2.04 5192.94 38.49
## 196 0 0 0 0.96 0.04 1.91 9700.96 39.16
## 197 0 0 0 0.96 0.04 1.91 9718.17 39.24
## mean_depth BAA3 BAA5 BAA7
## 89 -4.1565 67 69 .
## 90 -4.0627 67 . .
## ... <NA> <NA> <NA> <NA>
## 194 -5.8475 67 . .
## 195 -4.808 67 68 .
## 196 -5.5423 67 68 119
## 197 -5.0679 67 68 .
CEAR = subset(All, Species =="CEAR")
dim(CEAR) #examine data
## [1] 88 23
headTail(CEAR,2)# examine data
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B
## 1 Anaehoom AB02 CEAR 35 10 14.23 1827.46 0 0 0
## 2 Anaehoom AB05 CEAR 47 22 14.23 1827.46 0 0 0
## ... <NA> <NA> <NA> <NA> <NA> ... ... <NA> <NA> <NA>
## 85 Puako PU37 CEAR 32 8.1148 4.13 2827.84 1 3 0.13333
## 86 Puako PU38 CEAR 38 9 4.13 2827.84 1 5.5 0.07273
## 87 Puako PU39 CEAR 34 8 4.13 2827.84 1 2 0.2
## 88 Puako PU40 CEAR 48.5 21.6393 4.13 2827.84 1 0.3 1.33333
## Buffer boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 1 40 0 0 0 1 0 2.62 27.82
## 2 40 0.13 0 0 0.87 0 2.64 35.37
## ... ... ... ... ... ... ... ... <NA> ...
## 85 40 0 0 0.14 0.84 0.02 2.25 1302.29 27.05
## 86 40 0 0 0.14 0.84 0.02 2.25 1302.29 27.05
## 87 40 0 0 0.14 0.84 0.02 2.25 1302.29 27.05
## 88 40 0 0 0.14 0.84 0.02 2.25 1302.29 27.05
## mean_depth BAA3 BAA5 BAA7
## 1 -5.9999 67 69 121
## 2 -4.9986 67 69 121
## ... <NA> <NA> <NA> <NA>
## 85 -5.7854 61 67 101
## 86 -5.7854 61 67 101
## 87 -5.7854 61 67 101
## 88 . 61 67 101
CTST$CXT1B = as.factor(CTST$CXT1B)
CTST$boulder = as.numeric(CTST$boulder)
CTST$hard_bottom = as.numeric(CTST$hard_bottom)
CTST$soft_bottom = as.numeric(CTST$soft_bottom)
CTST$coral = as.numeric(CTST$coral)
CTST$unknown = as.numeric(CTST$unknown)
CTST$wave = as.numeric(CTST$wave)
CTST$effluent = as.numeric(CTST$effluent)
CTST$fishing = as.numeric(CTST$fishing)
CTST$mean_depth = as.numeric(CTST$mean_depth)
CTST$BAA3 = as.numeric(CTST$BAA3)
## Warning: NAs introduced by coercion
CTST$TL = as.numeric(CTST$TL)
## Warning: NAs introduced by coercion
CTST$Age = as.numeric(CTST$Age)
## Warning: NAs introduced by coercion
str(CTST)
## 'data.frame': 109 obs. of 23 variables:
## $ ï..Site : chr "Anaehoom" "Anaehoom" "Anaehoom" "Anaehoom" ...
## $ Tag : chr "AB01" "AB03" "AB04" "AB08" ...
## $ Species : chr "CTST" "CTST" "CTST" "CTST" ...
## $ TL : num 13 13 13.5 12 13.5 14.5 12.5 13 12.5 15.5 ...
## $ Age : num 6 4 3 2 8 ...
## $ site_coral : num 14.2 14.2 14.2 14.2 14.2 ...
## $ herbivore : num 1827 1827 1827 1827 1827 ...
## $ CTX3 : chr "0" "1" "0" "1" ...
## $ EC50 : chr "0" "1" "0" "0.75" ...
## $ CXT1B : Factor w/ 22 levels ".","0","0.008",..: 2 16 2 17 16 16 15 4 2 11 ...
## $ Buffer : int 20 20 20 20 20 20 20 20 20 20 ...
## $ boulder : num 0 0 1 0 0 0 1 0.128 0 0.128 ...
## $ hard_bottom: num 0 0 0 0 0 0 0 0 0 0 ...
## $ soft_bottom: num 0 0 0 0 0 0 0 0 0 0 ...
## $ coral : num 1 1 0 1 1 1 0 0.872 1 0.872 ...
## $ unknown : num 0 0 0 0 0 0 0 0 0 0 ...
## $ wave : num 2.61 2.61 2.61 2.61 2.61 ...
## $ effluent : num NA NA NA NA NA NA NA NA NA NA ...
## $ fishing : num 37.6 37.4 39.9 37.7 37.3 ...
## $ mean_depth : num -4.16 -4.06 -1.34 -3.15 -4.25 ...
## $ BAA3 : num 67 67 67 NA 67 NA 67 67 67 67 ...
## $ BAA5 : chr "69" "." "." "." ...
## $ BAA7 : chr "." "." "." "." ...
# Standardize all numeric columns (excluding factors, character, etc.)
numeric_cols <- sapply(CTST, is.numeric)
CTST[numeric_cols] <- scale(CTST[numeric_cols])
headTail(CTST)
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B
## 89 Anaehoom AB01 CTST -0.85 1.49 0.07 -0.91 0 0 0
## 90 Anaehoom AB03 CTST -0.85 -0.09 0.07 -0.91 1 1 0.4
## 91 Anaehoom AB04 CTST -0.57 -0.88 0.07 -0.91 0 0 0
## 92 Anaehoom AB08 CTST -1.42 -1.67 0.07 -0.91 1 0.75 0.53333
## ... <NA> <NA> <NA> ... ... ... ... <NA> <NA> <NA>
## 194 Puako PU14 CTST -0.85 -0.88 -2.46 -0.59 0 0 0
## 195 Puako PU15 CTST 0.28 0.7 -2.46 -0.59 . . .
## 196 Puako PU22 CTST 1.99 2.28 -2.46 -0.59 . . .
## 197 Puako PU28 CTST 0.28 1.49 -2.46 -0.59 0 0 0
## Buffer boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 89 NaN -0.36 -0.1 -0.17 0.44 -0.25 -0.74 <NA> 0.69
## 90 NaN -0.36 -0.1 -0.17 0.44 -0.25 -0.74 <NA> 0.66
## 91 NaN 5.51 -0.1 -0.17 -3.29 -0.25 -0.74 <NA> 0.95
## 92 NaN -0.36 -0.1 -0.17 0.44 -0.25 -0.74 <NA> 0.7
## ... ... ... ... ... ... ... ... ... ...
## 194 NaN -0.36 -0.1 -0.17 0.44 -0.25 -1.41 2.03 -0.36
## 195 NaN -0.36 -0.1 -0.17 0.44 -0.25 -1.36 -0.09 0.79
## 196 NaN -0.36 -0.1 -0.17 0.29 -0.06 -1.5 1.13 0.87
## 197 NaN -0.36 -0.1 -0.17 0.29 -0.06 -1.5 1.13 0.88
## mean_depth BAA3 BAA5 BAA7
## 89 0.99 0.97 69 .
## 90 1.02 0.97 . .
## 91 1.77 0.97 . .
## 92 1.27 <NA> . .
## ... ... ... <NA> <NA>
## 194 0.53 0.97 . .
## 195 0.81 0.97 68 .
## 196 0.61 0.97 68 119
## 197 0.74 0.97 68 .
CTST$CXT1B = as.numeric(CTST$CXT1B)
# Replace missing values (NA) with 0
CTST[is.na(CTST)] <- 0
headTail(CTST)
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B
## 89 Anaehoom AB01 CTST -0.85 1.49 0.07 -0.91 0 0 2
## 90 Anaehoom AB03 CTST -0.85 -0.09 0.07 -0.91 1 1 16
## 91 Anaehoom AB04 CTST -0.57 -0.88 0.07 -0.91 0 0 2
## 92 Anaehoom AB08 CTST -1.42 -1.67 0.07 -0.91 1 0.75 17
## ... <NA> <NA> <NA> ... ... ... ... <NA> <NA> ...
## 194 Puako PU14 CTST -0.85 -0.88 -2.46 -0.59 0 0 2
## 195 Puako PU15 CTST 0.28 0.7 -2.46 -0.59 . . 1
## 196 Puako PU22 CTST 1.99 2.28 -2.46 -0.59 . . 1
## 197 Puako PU28 CTST 0.28 1.49 -2.46 -0.59 0 0 2
## Buffer boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 89 0 -0.36 -0.1 -0.17 0.44 -0.25 -0.74 0 0.69
## 90 0 -0.36 -0.1 -0.17 0.44 -0.25 -0.74 0 0.66
## 91 0 5.51 -0.1 -0.17 -3.29 -0.25 -0.74 0 0.95
## 92 0 -0.36 -0.1 -0.17 0.44 -0.25 -0.74 0 0.7
## ... ... ... ... ... ... ... ... ... ...
## 194 0 -0.36 -0.1 -0.17 0.44 -0.25 -1.41 2.03 -0.36
## 195 0 -0.36 -0.1 -0.17 0.44 -0.25 -1.36 -0.09 0.79
## 196 0 -0.36 -0.1 -0.17 0.29 -0.06 -1.5 1.13 0.87
## 197 0 -0.36 -0.1 -0.17 0.29 -0.06 -1.5 1.13 0.88
## mean_depth BAA3 BAA5 BAA7
## 89 0.99 0.97 69 .
## 90 1.02 0.97 . .
## 91 1.77 0.97 . .
## 92 1.27 0 . .
## ... ... ... <NA> <NA>
## 194 0.53 0.97 . .
## 195 0.81 0.97 68 .
## 196 0.61 0.97 68 119
## 197 0.74 0.97 68 .
####fit models model1 <- cpglm(CTX1B ~ TL + BAA3,data = CTST, link = “log”) model2 <- glm(CTX1B ~ TL + BAA3 + Fishing,data = CTST, link = “log”) model3 <- glm(CTX1B ~ TL + Fishing, data = CTST, link = “log”) model4 = glm(CTX1B ~ TL + Fishing + Effluent, data = CTST, link = “log”) model5 = glm(CTX1B ~ herbivore + BAA3, data = CTST, link = “log”) model6 = glm(CTX1B ~ TL + Effluent,data = CTST, link = “log”) model7 = glm(CTX1B~ TL + mean_depth, data = CTST, link = “log”) model8 = glm(CTX1B ~ coral + boulder + TL + BAA3,data = CTST, link = “log”) model9 = glm(CTX1B ~ TL, data = CTST, link = “log”) model10 = glm(CTX1B ~ TL + coral + boulder + herbivore, data = CTST, link = “log”) model11 = glm(CTX1B ~ TL + Wave, data = CTST, link = “log”) model12 = glm(CTX1B ~ TL + Age, data = CTST, link = “log”) model13 = glm(CTX1B ~ TL + coral + boulder, data = CTST, link = “log”) model14 = glm(CTX1B ~ TL + site_coral + herbivore, data = CTST, link = “log”) model15 = glm(CTX1B ~ BAA3, family=“binomial”, data = CTST, link = “log”) model16 = glm(CTX1B ~ herbivore + Fishing, data = CTST, link = “log”) model17 = glm(CTX1B ~ site_coral + Fishing, data = CTST, link = “log”) model18 = glm(CTX1B ~ herbivore + Fishing + mean_depth, data = CTST, link = “log”) model19 = glm(CTX1B ~ coral + boulder + hard_bottom + soft_bottom, data = CTST, link = “log”) model20 = glm(CTX1B ~ site_coral + Effluent, data = CTST, link = “log”) model21 = glm(CTX1B ~ site_coral,data = CTST, link = “log”) model22 = glm(CTX1B ~ herbivore,data = CTST, link = “log”) model23 = glm(CTX1B ~ Wave, data = CTST, link = “log”) model24 = glm(CTX1B ~ TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom, data = CTST, link = “log”) ## AICTweedie
M1 <- cpglm(CXT1B ~ TL + BAA3,data = CTST, link = "log")
summary(M1)
##
## Call:
## cpglm(formula = CXT1B ~ TL + BAA3, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.7820 -1.2074 -0.7285 0.4822 1.7369
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.7912 0.1016 17.637 < 2e-16 ***
## TL -0.1730 0.1028 -1.683 0.095386 .
## BAA3 -0.4707 0.1269 -3.709 0.000333 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.0402
## Estimated index parameter: 1.99
##
## Residual deviance: 131.56 on 106 degrees of freedom
## AIC: 614.94
##
## Number of Fisher Scoring iterations: 7
M2 <- cpglm(CXT1B ~ TL + BAA3 + fishing,data = CTST, link = "log")
summary(M2)
##
## Call:
## cpglm(formula = CXT1B ~ TL + BAA3 + fishing, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.6048 -1.2717 -0.7127 0.4002 1.8134
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.7632 0.1041 16.932 <2e-16 ***
## TL -0.1438 0.1055 -1.363 0.1757
## BAA3 -0.2319 0.1482 -1.565 0.1206
## fishing -0.3078 0.1268 -2.427 0.0169 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.9958
## Estimated index parameter: 1.99
##
## Residual deviance: 125.29 on 105 degrees of freedom
## AIC: 610.78
##
## Number of Fisher Scoring iterations: 8
M3 <- cpglm(CXT1B ~ TL + fishing, data = CTST, link = "log")
summary(M3)
##
## Call:
## cpglm(formula = CXT1B ~ TL + fishing, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.6852 -1.2533 -0.7029 0.4046 1.9013
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.7740 0.1045 16.973 < 2e-16 ***
## TL -0.1055 0.1057 -0.998 0.320640
## fishing -0.4116 0.1118 -3.681 0.000367 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.0129
## Estimated index parameter: 1.99
##
## Residual deviance: 127.7 on 106 degrees of freedom
## AIC: 611.18
##
## Number of Fisher Scoring iterations: 6
M4 <- cpglm(CXT1B ~ TL + fishing + effluent, data = CTST, link = "log")
summary(M4)
##
## Call:
## cpglm(formula = CXT1B ~ TL + fishing + effluent, link = "log",
## data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9247 -1.1422 -0.6058 0.1905 1.7419
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.68561 0.10089 16.707 < 2e-16 ***
## TL -0.12651 0.10263 -1.233 0.220
## fishing -0.09803 0.13185 -0.744 0.459
## effluent -0.77394 0.16574 -4.669 8.97e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.87272
## Estimated index parameter: 1.99
##
## Residual deviance: 108.17 on 105 degrees of freedom
## AIC: 592.43
##
## Number of Fisher Scoring iterations: 6
M5 <- cpglm(CXT1B ~ herbivore + BAA3, data = CTST, link = "log")
summary(M5)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore + BAA3, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.7494 -1.2344 -0.8416 0.5154 1.7941
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.80293 0.10208 17.662 < 2e-16 ***
## herbivore -0.01469 0.10414 -0.141 0.88810
## BAA3 -0.43095 0.12925 -3.334 0.00118 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.0583
## Estimated index parameter: 1.99
##
## Residual deviance: 134.14 on 106 degrees of freedom
## AIC: 617.4
##
## Number of Fisher Scoring iterations: 9
M6 <- cpglm(CXT1B ~ TL + effluent,data = CTST, link = "log")
summary(M6)
##
## Call:
## cpglm(formula = CXT1B ~ TL + effluent, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9063 -1.1203 -0.6064 0.1511 2.0167
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.6889 0.1001 16.864 < 2e-16 ***
## TL -0.1271 0.1019 -1.248 0.215
## effluent -0.8396 0.1347 -6.234 9.43e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.87797
## Estimated index parameter: 1.99
##
## Residual deviance: 108.89 on 106 degrees of freedom
## AIC: 591.26
##
## Number of Fisher Scoring iterations: 6
M7 <- cpglm(CXT1B~ TL + mean_depth, data = CTST, link = "log")
summary(M7)
##
## Call:
## cpglm(formula = CXT1B ~ TL + mean_depth, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5672 -1.4058 -0.9397 0.8817 1.6817
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.85813 0.10240 18.145 <2e-16 ***
## TL -0.08979 0.10385 -0.865 0.389
## mean_depth -0.02297 0.11018 -0.208 0.835
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1438
## Estimated index parameter: 1.99
##
## Residual deviance: 146.4 on 106 degrees of freedom
## AIC: 628.53
##
## Number of Fisher Scoring iterations: 8
M8 <- cpglm(CXT1B ~ coral + boulder + TL + BAA3,data = CTST, link = "log")
summary(M8)
##
## Call:
## cpglm(formula = CXT1B ~ coral + boulder + TL + BAA3, link = "log",
## data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.8010 -1.2051 -0.7067 0.5182 2.0073
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.77726 0.10345 17.179 < 2e-16 ***
## coral -0.14404 0.13339 -1.080 0.282718
## boulder 0.05146 0.13502 0.381 0.703859
## TL -0.14885 0.10525 -1.414 0.160275
## BAA3 -0.52086 0.13069 -3.985 0.000125 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.0184
## Estimated index parameter: 1.99
##
## Residual deviance: 128.48 on 104 degrees of freedom
## AIC: 615.95
##
## Number of Fisher Scoring iterations: 7
M9 <- cpglm(CXT1B ~ TL, data = CTST, link = "log")
summary(M9)
##
## Call:
## cpglm(formula = CXT1B ~ TL, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5391 -1.4174 -0.9295 0.8651 1.6780
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.85832 0.10201 18.218 <2e-16 ***
## TL -0.08861 0.10297 -0.861 0.391
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1441
## Estimated index parameter: 1.99
##
## Residual deviance: 146.44 on 107 degrees of freedom
## AIC: 626.57
##
## Number of Fisher Scoring iterations: 6
M10 <- cpglm(CXT1B ~ TL + coral + boulder + herbivore, data = CTST, link = "log")
summary(M10)
##
## Call:
## cpglm(formula = CXT1B ~ TL + coral + boulder + herbivore, link = "log",
## data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5538 -1.3962 -0.9193 0.8428 1.6219
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.85361 0.10369 17.877 <2e-16 ***
## TL -0.05584 0.10858 -0.514 0.608
## coral -0.11651 0.14409 -0.809 0.421
## boulder -0.01370 0.13552 -0.101 0.920
## herbivore -0.06611 0.11581 -0.571 0.569
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1368
## Estimated index parameter: 1.99
##
## Residual deviance: 145.39 on 104 degrees of freedom
## AIC: 631.65
##
## Number of Fisher Scoring iterations: 7
M11 <- cpglm(CXT1B ~ TL + wave, data = CTST, link = "log")
summary(M11)
##
## Call:
## cpglm(formula = CXT1B ~ TL + wave, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5808 -1.3918 -0.9173 0.8491 1.5581
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.85495 0.10196 18.193 <2e-16 ***
## TL -0.07450 0.10340 -0.721 0.473
## wave -0.09236 0.10975 -0.842 0.402
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1389
## Estimated index parameter: 1.99
##
## Residual deviance: 145.69 on 106 degrees of freedom
## AIC: 627.91
##
## Number of Fisher Scoring iterations: 6
M12 <- cpglm(CXT1B ~ TL + Age, data =CTST, link = "log")
summary(M12)
##
## Call:
## cpglm(formula = CXT1B ~ TL + Age, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5439 -1.4100 -0.9400 0.8845 1.6559
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.85810 0.10256 18.117 <2e-16 ***
## TL -0.07387 0.12706 -0.581 0.562
## Age -0.02322 0.12705 -0.183 0.855
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1438
## Estimated index parameter: 1.99
##
## Residual deviance: 146.39 on 106 degrees of freedom
## AIC: 628.53
##
## Number of Fisher Scoring iterations: 7
M13 <- cpglm(CXT1B ~ TL + coral + boulder, data = CTST, link = "log")
summary(M13)
##
## Call:
## cpglm(formula = CXT1B ~ TL + coral + boulder, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5212 -1.3985 -0.9204 0.7841 1.7215
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.85568 0.10377 17.883 <2e-16 ***
## TL -0.07975 0.10534 -0.757 0.451
## coral -0.08203 0.13393 -0.612 0.542
## boulder -0.01471 0.13456 -0.109 0.913
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.14
## Estimated index parameter: 1.99
##
## Residual deviance: 145.85 on 105 degrees of freedom
## AIC: 630.06
##
## Number of Fisher Scoring iterations: 7
M14 <- cpglm(CXT1B ~ TL + site_coral + herbivore, data = CTST, link = "log")
summary(M14)
##
## Call:
## cpglm(formula = CXT1B ~ TL + site_coral + herbivore, link = "log",
## data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.6473 -1.3952 -0.8872 0.8846 1.5323
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.83883 0.09887 18.599 < 2e-16 ***
## TL -0.04401 0.10491 -0.419 0.67572
## site_coral 0.33457 0.10330 3.239 0.00161 **
## herbivore -0.05565 0.10427 -0.534 0.59468
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1146
## Estimated index parameter: 1.99
##
## Residual deviance: 142.19 on 105 degrees of freedom
## AIC: 626.81
##
## Number of Fisher Scoring iterations: 14
M15 <- cpglm(CXT1B ~ BAA3, data = CTST, link = "log")
summary(M15)
##
## Call:
## cpglm(formula = CXT1B ~ BAA3, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.7612 -1.2311 -0.8583 0.5313 1.8162
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.8031 0.1017 17.736 < 2e-16 ***
## BAA3 -0.4309 0.1267 -3.401 0.000946 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.0585
## Estimated index parameter: 1.99
##
## Residual deviance: 134.17 on 107 degrees of freedom
## AIC: 615.43
##
## Number of Fisher Scoring iterations: 6
M16 <- cpglm(CXT1B ~ herbivore + fishing, data = CTST, link = "log")
summary(M16)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore + fishing, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.6539 -1.2122 -0.7416 0.5139 1.8113
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.77836 0.10408 17.087 < 2e-16 ***
## herbivore -0.01507 0.10453 -0.144 0.885621
## fishing -0.40439 0.11116 -3.638 0.000427 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.0197
## Estimated index parameter: 1.99
##
## Residual deviance: 128.66 on 106 degrees of freedom
## AIC: 612.12
##
## Number of Fisher Scoring iterations: 7
M17 <- cpglm(CXT1B~ site_coral + fishing, data = CTST, link = "log")
summary(M17)
##
## Call:
## cpglm(formula = CXT1B ~ site_coral + fishing, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.7277 -1.3194 -0.7257 0.4428 1.8116
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.7639 0.1011 17.446 < 2e-16 ***
## site_coral 0.2597 0.1023 2.540 0.012534 *
## fishing -0.3920 0.1084 -3.616 0.000459 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.99721
## Estimated index parameter: 1.99
##
## Residual deviance: 125.49 on 106 degrees of freedom
## AIC: 608.98
##
## Number of Fisher Scoring iterations: 11
M18 <- cpglm(CXT1B ~ herbivore + fishing + mean_depth, data = CTST, link = "log")
summary(M18)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore + fishing + mean_depth, link = "log",
## data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.6990 -1.1687 -0.7680 0.5591 1.7703
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.75281 0.10183 17.212 < 2e-16 ***
## herbivore 0.07462 0.10762 0.693 0.4896
## fishing -0.51110 0.11493 -4.447 2.17e-05 ***
## mean_depth 0.28517 0.12078 2.361 0.0201 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.97957
## Estimated index parameter: 1.99
##
## Residual deviance: 123.01 on 105 degrees of freedom
## AIC: 608.47
##
## Number of Fisher Scoring iterations: 6
M19 <- cpglm(CXT1B ~ coral + boulder + hard_bottom + soft_bottom, data = CTST, link = "log")
summary(M19)
##
## Call:
## cpglm(formula = CXT1B ~ coral + boulder + hard_bottom + soft_bottom,
## link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4810 -1.4043 -0.9503 0.7658 1.6396
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.84417 0.10239 18.011 <2e-16 ***
## coral -0.08794 0.13220 -0.665 0.5074
## boulder -0.01450 0.13219 -0.110 0.9128
## hard_bottom -0.18568 0.11081 -1.676 0.0968 .
## soft_bottom 0.10571 0.10938 0.966 0.3361
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1224
## Estimated index parameter: 1.99
##
## Residual deviance: 143.31 on 104 degrees of freedom
## AIC: 629.81
##
## Number of Fisher Scoring iterations: 6
M20 <- cpglm(CXT1B ~ site_coral + effluent, data = CTST, link = "log")
summary(M20)
##
## Call:
## cpglm(formula = CXT1B ~ site_coral + effluent, link = "log",
## data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.8877 -1.1429 -0.7262 0.1013 1.8354
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.69555 0.09963 17.018 < 2e-16 ***
## site_coral -0.03492 0.10835 -0.322 0.748
## effluent -0.83875 0.14360 -5.841 5.77e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.88868
## Estimated index parameter: 1.99
##
## Residual deviance: 110.37 on 106 degrees of freedom
## AIC: 592.93
##
## Number of Fisher Scoring iterations: 9
M21 <- cpglm(CXT1B ~ site_coral, data = CTST, link = "log")
summary(M21)
##
## Call:
## cpglm(formula = CXT1B ~ site_coral, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5836 -1.4587 -0.8899 0.8488 1.5529
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.84193 0.09838 18.723 < 2e-16 ***
## site_coral 0.32618 0.09911 3.291 0.00135 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1194
## Estimated index parameter: 1.99
##
## Residual deviance: 142.87 on 107 degrees of freedom
## AIC: 623.42
##
## Number of Fisher Scoring iterations: 14
M22 <- cpglm(CXT1B ~ herbivore, data = CTST, link = "log")
summary(M22)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4461 -1.4413 -0.9471 0.9536 1.5115
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.86038 0.10091 18.436 <2e-16 ***
## herbivore -0.03526 0.10139 -0.348 0.729
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1473
## Estimated index parameter: 1.99
##
## Residual deviance: 146.89 on 107 degrees of freedom
## AIC: 626.97
##
## Number of Fisher Scoring iterations: 6
M23 <- cpglm(CXT1B ~ wave, data = CTST, link = "log")
summary(M23)
##
## Call:
## cpglm(formula = CXT1B ~ wave, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5229 -1.4032 -0.9828 0.9037 1.4940
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.8569 0.1008 18.421 <2e-16 ***
## wave -0.1030 0.1080 -0.954 0.342
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.142
## Estimated index parameter: 1.99
##
## Residual deviance: 146.13 on 107 degrees of freedom
## AIC: 626.3
##
## Number of Fisher Scoring iterations: 6
M24 <- cpglm(CXT1B ~ TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom, data = CTST, family = tweedie(var.power=1.5, link.power=0))
summary(M24)
##
## Call:
## cpglm(formula = CXT1B ~ TL + BAA3 + fishing + effluent + herbivore +
## mean_depth + site_coral + wave + Age + coral + boulder +
## hard_bottom + soft_bottom, data = CTST, family = tweedie(var.power = 1.5,
## link.power = 0))
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.7462 -1.0200 -0.5239 0.4114 2.3758
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.64145 0.10458 15.696 < 2e-16 ***
## TL -0.18308 0.14426 -1.269 0.20753
## BAA3 -0.31912 0.16997 -1.878 0.06351 .
## fishing -0.06092 0.17105 -0.356 0.72250
## effluent -0.68215 0.22835 -2.987 0.00358 **
## herbivore 0.23606 0.20124 1.173 0.24372
## mean_depth 0.22649 0.16185 1.399 0.16495
## site_coral 0.17705 0.18610 0.951 0.34382
## wave -0.37620 0.26463 -1.422 0.15841
## Age 0.02811 0.14463 0.194 0.84631
## coral 0.01377 0.15464 0.089 0.92922
## boulder 0.01990 0.14576 0.137 0.89170
## hard_bottom -0.05600 0.11904 -0.470 0.63915
## soft_bottom -0.05458 0.13151 -0.415 0.67909
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.80094
## Estimated index parameter: 1.99
##
## Residual deviance: 98.373 on 95 degrees of freedom
## AIC: 600.72
##
## Number of Fisher Scoring iterations: 16
M25 <- cpglm(CXT1B ~ 1, data = CTST, link = "log")
summary(M25)
##
## Call:
## cpglm(formula = CXT1B ~ 1, link = "log", data = CTST)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4342 -1.4342 -0.9858 0.9027 1.5606
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.8612 0.1008 18.46 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 1.1485
## Estimated index parameter: 1.99
##
## Residual deviance: 147.07 on 108 degrees of freedom
## AIC: 625.12
##
## Number of Fisher Scoring iterations: 6