setwd("C:/Users/Nikol/Documents/Ciguatara Project/Data/CXT Data")
All = read.csv("CTX_All_NR.csv")
dim(All) #examine data
## [1] 197 26
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 X X.1 X.2
## 1 -5.9999 67 69 121 NA NA NA
## 2 -4.9986 67 69 121 NA NA NA
## 3 -6.6052 67 69 121 NA NA NA
## 4 -5.5554 67 69 121 NA NA NA
## 5 -5.9993 67 69 121 NA NA NA
## 6 -2.6409 67 69 . NA NA NA
## 7 -6.7602 67 69 121 NA NA NA
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 26
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 . 0 0 20
## ... <NA> <NA> <NA> <NA> <NA> ... ... <NA> ... ... ...
## 194 Puako PU14 CTST 13 3 4.13 2827.84 . 0 0 20
## 195 Puako PU15 CTST 15 5 4.13 2827.84 . 0 0 20
## 196 Puako PU22 CTST 18 7 4.13 2827.84 . 0 0 20
## 197 Puako PU28 CTST 15 6 4.13 2827.84 . 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 X X.1 X.2
## 89 -4.1565 67 69 . <NA> <NA> <NA>
## 90 -4.0627 67 . . <NA> <NA> <NA>
## ... <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 194 -5.8475 67 . . <NA> <NA> <NA>
## 195 -4.808 67 68 . <NA> <NA> <NA>
## 196 -5.5423 67 68 119 <NA> <NA> <NA>
## 197 -5.0679 67 68 . <NA> <NA> <NA>
CEAR = subset(All, Species =="CEAR")
dim(CEAR) #examine data
## [1] 88 26
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> ... ...
## 85 Puako PU37 CEAR 32 8.1148 4.13 2827.84 1 3 0.13
## 86 Puako PU38 CEAR 38 9 4.13 2827.84 1 5.5 0.07
## 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.33
## 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 X X.1 X.2
## 1 -5.9999 67 69 121 <NA> <NA> <NA>
## 2 -4.9986 67 69 121 <NA> <NA> <NA>
## ... <NA> <NA> <NA> <NA> <NA> <NA> <NA>
## 85 -5.7854 61 67 101 <NA> <NA> <NA>
## 86 -5.7854 61 67 101 <NA> <NA> <NA>
## 87 -5.7854 61 67 101 <NA> <NA> <NA>
## 88 . 61 67 101 <NA> <NA> <NA>
CEAR$CXT1B = as.factor(CEAR$CXT1B)
CEAR$boulder = as.numeric(CEAR$boulder)
CEAR$hard_bottom = as.numeric(CEAR$hard_bottom)
CEAR$soft_bottom = as.numeric(CEAR$soft_bottom)
CEAR$coral = as.numeric(CEAR$coral)
CEAR$unknown = as.numeric(CEAR$unknown)
CEAR$wave = as.numeric(CEAR$wave)
CEAR$effluent = as.numeric(CEAR$effluent)
## Warning: NAs introduced by coercion
CEAR$fishing = as.numeric(CEAR$fishing)
CEAR$mean_depth = as.numeric(CEAR$mean_depth)
## Warning: NAs introduced by coercion
CEAR$BAA3 = as.numeric(CEAR$BAA3)
## Warning: NAs introduced by coercion
CEAR$BAA5 = as.character(CEAR$BAA5)
CEAR$BAA7 = as.character(CEAR$BAA7)
CEAR$TL = as.numeric(CEAR$TL)
CEAR$Age = as.numeric(CEAR$Age)
str(CEAR)
## 'data.frame': 88 obs. of 26 variables:
## $ ï..Site : chr "Anaehoom" "Anaehoom" "Anaehoom" "Anaehoom" ...
## $ Tag : chr "AB02" "AB05" "AB06" "AB07" ...
## $ Species : chr "CEAR" "CEAR" "CEAR" "CEAR" ...
## $ TL : num 35 47 29.5 31.5 22.5 29 41.5 27.5 17 24 ...
## $ Age : num 10 22 7 9 10 ...
## $ site_coral : num 14.2 14.2 14.2 14.2 14.2 ...
## $ herbivore : num 1827 1827 1827 1827 1827 ...
## $ CTX3 : chr "0" "0" "0" "0" ...
## $ EC50 : num 0 0 0 0 0 0 0 3 0 0 ...
## $ CXT1B : Factor w/ 14 levels "0","0.03636",..: 1 1 1 1 1 1 1 7 1 1 ...
## $ Buffer : int 40 40 40 40 40 40 40 40 40 40 ...
## $ boulder : num 0 0.128 0 0 0 0.369 0 0 0 0 ...
## $ 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 0.872 1 1 1 0.631 1 1 1 1 ...
## $ unknown : num 0 0 0 0 0 0 0 0 0 0 ...
## $ wave : num 2.62 2.64 2.63 2.63 2.62 ...
## $ effluent : num NA NA NA NA NA ...
## $ fishing : num 27.8 35.4 26.8 34.4 25.9 ...
## $ mean_depth : num -6 -5 -6.61 -5.56 -6 ...
## $ BAA3 : num 67 67 67 67 67 67 67 67 NA 67 ...
## $ BAA5 : chr "69" "69" "69" "69" ...
## $ BAA7 : chr "121" "121" "121" "121" ...
## $ X : logi NA NA NA NA NA NA ...
## $ X.1 : logi NA NA NA NA NA NA ...
## $ X.2 : logi NA NA NA NA NA NA ...
# Standardize all numeric columns (excluding factors, character, etc.)
numeric_cols <- sapply(CEAR, is.numeric)
CEAR[numeric_cols] <- scale(CEAR[numeric_cols])
headTail(CEAR)
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B
## 1 Anaehoom AB02 CEAR 0.33 0.3 0.35 -0.77 0 -0.38 0
## 2 Anaehoom AB05 CEAR 1.89 2.76 0.35 -0.77 0 -0.38 0
## 3 Anaehoom AB06 CEAR -0.39 -0.31 0.35 -0.77 0 -0.38 0
## 4 Anaehoom AB07 CEAR -0.12 0.1 0.35 -0.77 0 -0.38 0
## ... <NA> <NA> <NA> ... ... ... ... <NA> ... <NA>
## 85 Puako PU37 CEAR -0.06 -0.09 -1.62 -0.4 1 0.89 0.13333
## 86 Puako PU38 CEAR 0.72 0.1 -1.62 -0.4 1 1.95 0.07273
## 87 Puako PU39 CEAR 0.2 -0.11 -1.62 -0.4 1 0.47 0.2
## 88 Puako PU40 CEAR 2.09 2.68 -1.62 -0.4 1 -0.25 1.33333
## Buffer boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 1 NaN -0.33 -0.17 -0.42 0.77 -0.56 -0.49 <NA> 0.07
## 2 NaN 0.32 -0.17 -0.42 0.46 -0.56 -0.47 <NA> 0.75
## 3 NaN -0.33 -0.17 -0.42 0.77 -0.56 -0.48 <NA> -0.01
## 4 NaN -0.33 -0.17 -0.42 0.77 -0.56 -0.48 <NA> 0.66
## ... ... ... ... ... ... ... ... ... ...
## 85 NaN -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## 86 NaN -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## 87 NaN -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## 88 NaN -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## mean_depth BAA3 BAA5 BAA7 X X.1 X.2
## 1 0.48 1.21 69 121 <NA> <NA> <NA>
## 2 0.65 1.21 69 121 <NA> <NA> <NA>
## 3 0.38 1.21 69 121 <NA> <NA> <NA>
## 4 0.55 1.21 69 121 <NA> <NA> <NA>
## ... ... ... <NA> <NA> <NA> <NA> <NA>
## 85 0.51 -1.21 67 101 <NA> <NA> <NA>
## 86 0.51 -1.21 67 101 <NA> <NA> <NA>
## 87 0.51 -1.21 67 101 <NA> <NA> <NA>
## 88 <NA> -1.21 67 101 <NA> <NA> <NA>
CEAR$CXT1B = as.numeric(CEAR$CXT1B)
# Replace missing values (NA) with 0
CEAR[is.na(CEAR)] <- 0
headTail(CEAR)
## ï..Site Tag Species TL Age site_coral herbivore CTX3 EC50 CXT1B
## 1 Anaehoom AB02 CEAR 0.33 0.3 0.35 -0.77 0 -0.38 1
## 2 Anaehoom AB05 CEAR 1.89 2.76 0.35 -0.77 0 -0.38 1
## 3 Anaehoom AB06 CEAR -0.39 -0.31 0.35 -0.77 0 -0.38 1
## 4 Anaehoom AB07 CEAR -0.12 0.1 0.35 -0.77 0 -0.38 1
## ... <NA> <NA> <NA> ... ... ... ... <NA> ... ...
## 85 Puako PU37 CEAR -0.06 -0.09 -1.62 -0.4 1 0.89 7
## 86 Puako PU38 CEAR 0.72 0.1 -1.62 -0.4 1 1.95 5
## 87 Puako PU39 CEAR 0.2 -0.11 -1.62 -0.4 1 0.47 9
## 88 Puako PU40 CEAR 2.09 2.68 -1.62 -0.4 1 -0.25 13
## Buffer boulder hard_bottom soft_bottom coral unknown wave effluent fishing
## 1 0 -0.33 -0.17 -0.42 0.77 -0.56 -0.49 0 0.07
## 2 0 0.32 -0.17 -0.42 0.46 -0.56 -0.47 0 0.75
## 3 0 -0.33 -0.17 -0.42 0.77 -0.56 -0.48 0 -0.01
## 4 0 -0.33 -0.17 -0.42 0.77 -0.56 -0.48 0 0.66
## ... ... ... ... ... ... ... ... ... ...
## 85 0 -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## 86 0 -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## 87 0 -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## 88 0 -0.33 -0.17 2.5 0.37 -0.51 -0.92 -0.82 0.01
## mean_depth BAA3 BAA5 BAA7 X X.1 X.2
## 1 0.48 1.21 69 121 0 0 0
## 2 0.65 1.21 69 121 0 0 0
## 3 0.38 1.21 69 121 0 0 0
## 4 0.55 1.21 69 121 0 0 0
## ... ... ... <NA> <NA> ... ... ...
## 85 0.51 -1.21 67 101 0 0 0
## 86 0.51 -1.21 67 101 0 0 0
## 87 0.51 -1.21 67 101 0 0 0
## 88 0 -1.21 67 101 0 0 0
####fit models model1 <- cpglm(CTX1B ~ TL + BAA3,data = CEAR, link = “log”) model2 <- glm(CTX1B ~ TL + BAA3 + Fishing,data = CEAR, link = “log”) model3 <- glm(CTX1B ~ TL + Fishing, data = CEAR, link = “log”) model4 = glm(CTX1B ~ TL + Fishing + Effluent, data = CEAR, link = “log”) model5 = glm(CTX1B ~ herbivore + BAA3, data = CEAR, link = “log”) model6 = glm(CTX1B ~ TL + Effluent,data = CEAR, link = “log”) model7 = glm(CTX1B~ TL + mean_depth, data = CEAR, link = “log”) model8 = glm(CTX1B ~ coral + boulder + TL + BAA3,data = CEAR, link = “log”) model9 = glm(CTX1B ~ TL, data = CEAR, link = “log”) model10 = glm(CTX1B ~ TL + coral + boulder + herbivore, data = CEAR, link = “log”) model11 = glm(CTX1B ~ TL + Wave, data = CEAR, link = “log”) model12 = glm(CTX1B ~ TL + Age, data = CEAR, link = “log”) model13 = glm(CTX1B ~ TL + coral + boulder, data = CEAR, link = “log”) model14 = glm(CTX1B ~ TL + site_coral + herbivore, data = CEAR, link = “log”) model15 = glm(CTX1B ~ BAA3, family=“binomial”, data = CEAR, link = “log”) model16 = glm(CTX1B ~ herbivore + Fishing, data = CEAR, link = “log”) model17 = glm(CTX1B ~ site_coral + Fishing, data = CEAR, link = “log”) model18 = glm(CTX1B ~ herbivore + Fishing + mean_depth, data = CEAR, link = “log”) model19 = glm(CTX1B ~ coral + boulder + hard_bottom + soft_bottom, data = CEAR, link = “log”) model20 = glm(CTX1B ~ site_coral + Effluent, data = CEAR, link = “log”) model21 = glm(CTX1B ~ site_coral,data = CEAR, link = “log”) model22 = glm(CTX1B ~ herbivore,data = CEAR, link = “log”) model23 = glm(CTX1B ~ Wave, data = CEAR, link = “log”) model24 = glm(CTX1B ~ TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom, data = CEAR, link = “log”) ## AICTweedie
M1 <- cpglm(CXT1B ~ TL + BAA3,data = CEAR, link = "log")
summary(M1)
##
## Call:
## cpglm(formula = CXT1B ~ TL + BAA3, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.3888 -0.5950 -0.3216 0.1851 2.6928
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.74103 0.09905 7.481 6.19e-11 ***
## TL 0.52693 0.10144 5.195 1.39e-06 ***
## BAA3 -0.26598 0.10520 -2.528 0.0133 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.5173
## Estimated index parameter: 1.99
##
## Residual deviance: 49.375 on 85 degrees of freedom
## AIC: 293.82
##
## Number of Fisher Scoring iterations: 7
M2 <- cpglm(CXT1B ~ TL + BAA3 + fishing,data = CEAR, link = "log")
summary(M2)
##
## Call:
## cpglm(formula = CXT1B ~ TL + BAA3 + fishing, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4687 -0.5974 -0.2611 0.2200 2.5889
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.73878 0.09612 7.686 2.57e-11 ***
## TL 0.53126 0.09852 5.393 6.27e-07 ***
## BAA3 -0.22174 0.12889 -1.720 0.0891 .
## fishing -0.09174 0.13455 -0.682 0.4972
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.51349
## Estimated index parameter: 1.99
##
## Residual deviance: 48.984 on 84 degrees of freedom
## AIC: 295.06
##
## Number of Fisher Scoring iterations: 8
M3 <- cpglm(CXT1B ~ TL + fishing, data = CEAR, link = "log")
summary(M3)
##
## Call:
## cpglm(formula = CXT1B ~ TL + fishing, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5046 -0.6388 -0.3614 0.3119 2.1019
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.75470 0.09369 8.056 4.37e-12 ***
## TL 0.57926 0.09446 6.132 2.63e-08 ***
## fishing -0.21626 0.10386 -2.082 0.0403 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.54108
## Estimated index parameter: 1.99
##
## Residual deviance: 51.822 on 85 degrees of freedom
## AIC: 298.45
##
## Number of Fisher Scoring iterations: 7
M4 <- cpglm(CXT1B ~ TL + fishing + effluent, data = CEAR, link = "log")
summary(M4)
##
## Call:
## cpglm(formula = CXT1B ~ TL + fishing + effluent, link = "log",
## data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.3916 -0.6633 -0.3387 0.2405 1.8158
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.74185 0.08781 8.449 7.64e-13 ***
## TL 0.56723 0.08874 6.392 8.73e-09 ***
## fishing -0.19859 0.09912 -2.004 0.0483 *
## effluent -0.18480 0.10438 -1.771 0.0803 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.51898
## Estimated index parameter: 1.99
##
## Residual deviance: 49.547 on 84 degrees of freedom
## AIC: 296.16
##
## Number of Fisher Scoring iterations: 7
M5 <- cpglm(CXT1B ~ herbivore + BAA3, data = CEAR, link = "log")
summary(M5)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore + BAA3, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.3317 -0.8240 -0.5304 -0.2520 2.7262
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.8898 0.1312 6.782 1.48e-09 ***
## herbivore 0.1173 0.1336 0.878 0.38226
## BAA3 -0.4425 0.1384 -3.197 0.00195 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.76774
## Estimated index parameter: 1.99
##
## Residual deviance: 75.857 on 85 degrees of freedom
## AIC: 335.49
##
## Number of Fisher Scoring iterations: 6
M6 <- cpglm(CXT1B ~ TL + effluent,data = CEAR, link = "log")
summary(M6)
##
## Call:
## cpglm(formula = CXT1B ~ TL + effluent, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.46684 -0.68490 -0.30835 0.09367 2.57106
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.75862 0.09989 7.594 3.68e-11 ***
## TL 0.58843 0.10066 5.846 9.09e-08 ***
## effluent -0.19277 0.11664 -1.653 0.102
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.54784
## Estimated index parameter: 1.99
##
## Residual deviance: 52.52 on 85 degrees of freedom
## AIC: 299.73
##
## Number of Fisher Scoring iterations: 6
M7 <- cpglm(CXT1B~ TL + mean_depth, data = CEAR, link = "log")
summary(M7)
##
## Call:
## cpglm(formula = CXT1B ~ TL + mean_depth, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4119 -0.6501 -0.4101 0.2317 2.1697
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.76860 0.09983 7.699 2.27e-11 ***
## TL 0.58707 0.10099 5.813 1.05e-07 ***
## mean_depth -0.08505 0.11188 -0.760 0.449
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.56485
## Estimated index parameter: 1.99
##
## Residual deviance: 54.282 on 85 degrees of freedom
## AIC: 302.9
##
## Number of Fisher Scoring iterations: 7
M8 <- cpglm(CXT1B ~ coral + boulder + TL + BAA3,data = CEAR, link = "log")
summary(M8)
##
## Call:
## cpglm(formula = CXT1B ~ coral + boulder + TL + BAA3, link = "log",
## data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4004 -0.6085 -0.3249 0.1786 2.6138
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.7365162 0.0973429 7.566 4.72e-11 ***
## coral -0.0005027 0.1120604 -0.004 0.9964
## boulder -0.1101433 0.1125048 -0.979 0.3304
## TL 0.5184063 0.1004552 5.161 1.65e-06 ***
## BAA3 -0.2642830 0.1043303 -2.533 0.0132 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.50955
## Estimated index parameter: 1.99
##
## Residual deviance: 48.58 on 83 degrees of freedom
## AIC: 296.28
##
## Number of Fisher Scoring iterations: 7
M9 <- cpglm(CXT1B ~ TL, data = CEAR, link = "log")
summary(M9)
##
## Call:
## cpglm(formula = CXT1B ~ TL, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4592 -0.6327 -0.4146 0.1715 2.2794
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.7721 0.1020 7.570 3.89e-11 ***
## TL 0.5977 0.1024 5.836 9.24e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.57093
## Estimated index parameter: 1.99
##
## Residual deviance: 54.914 on 86 degrees of freedom
## AIC: 302.01
##
## Number of Fisher Scoring iterations: 6
M10 <- cpglm(CXT1B ~ TL + coral + boulder + herbivore, data = CEAR, link = "log")
summary(M10)
##
## Call:
## cpglm(formula = CXT1B ~ TL + coral + boulder + herbivore, link = "log",
## data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4227 -0.6320 -0.4044 0.1523 2.0728
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.76348 0.09811 7.782 1.76e-11 ***
## TL 0.58977 0.09952 5.926 6.81e-08 ***
## coral -0.09598 0.12659 -0.758 0.450
## boulder -0.13566 0.11439 -1.186 0.239
## herbivore -0.06575 0.11184 -0.588 0.558
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.55618
## Estimated index parameter: 1.99
##
## Residual deviance: 53.383 on 83 degrees of freedom
## AIC: 305.29
##
## Number of Fisher Scoring iterations: 8
M11 <- cpglm(CXT1B ~ TL + wave, data = CEAR, link = "log")
summary(M11)
##
## Call:
## cpglm(formula = CXT1B ~ TL + wave, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4685 -0.6502 -0.3959 0.1233 2.3871
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.76970 0.10193 7.551 4.49e-11 ***
## TL 0.58631 0.10390 5.643 2.15e-07 ***
## wave -0.08433 0.11363 -0.742 0.46
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.56678
## Estimated index parameter: 1.99
##
## Residual deviance: 54.483 on 85 degrees of freedom
## AIC: 303.25
##
## Number of Fisher Scoring iterations: 6
M12 <- cpglm(CXT1B ~ TL + Age, data =CEAR, link = "log")
summary(M12)
##
## Call:
## cpglm(formula = CXT1B ~ TL + Age, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.5451 -0.6167 -0.4297 0.1204 2.2480
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.7689 0.1015 7.575 4.02e-11 ***
## TL 0.4939 0.1611 3.066 0.00291 **
## Age 0.1257 0.1611 0.780 0.43730
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.56537
## Estimated index parameter: 1.99
##
## Residual deviance: 54.337 on 85 degrees of freedom
## AIC: 302.99
##
## Number of Fisher Scoring iterations: 7
M13 <- cpglm(CXT1B ~ TL + coral + boulder, data =CEAR, link = "log")
summary(M13)
##
## Call:
## cpglm(formula = CXT1B ~ TL + coral + boulder, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4500 -0.6016 -0.4264 0.1557 2.1269
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.76533 0.09926 7.711 2.30e-11 ***
## TL 0.58646 0.10047 5.837 9.68e-08 ***
## coral -0.07240 0.11332 -0.639 0.525
## boulder -0.13058 0.11435 -1.142 0.257
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.55928
## Estimated index parameter: 1.99
##
## Residual deviance: 53.705 on 84 degrees of freedom
## AIC: 303.87
##
## Number of Fisher Scoring iterations: 6
M14 <- cpglm(CXT1B ~ TL + site_coral + herbivore, data =CEAR, link = "log")
summary(M14)
##
## Call:
## cpglm(formula = CXT1B ~ TL + site_coral + herbivore, link = "log",
## data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4786 -0.6204 -0.3959 0.1511 2.2699
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.771395 0.102174 7.550 4.79e-11 ***
## TL 0.598974 0.104138 5.752 1.39e-07 ***
## site_coral 0.001567 0.106576 0.015 0.988
## herbivore -0.039758 0.105436 -0.377 0.707
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.56969
## Estimated index parameter: 1.99
##
## Residual deviance: 54.785 on 84 degrees of freedom
## AIC: 305.78
##
## Number of Fisher Scoring iterations: 7
M15 <- cpglm(CXT1B ~ BAA3, data =CEAR, link = "log")
summary(M15)
##
## Call:
## cpglm(formula = CXT1B ~ BAA3, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.3660 -0.7828 -0.5762 -0.3627 2.6474
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.8967 0.1361 6.589 3.39e-09 ***
## BAA3 -0.4217 0.1418 -2.974 0.00381 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.77897
## Estimated index parameter: 1.99
##
## Residual deviance: 77.08 on 86 degrees of freedom
## AIC: 335.07
##
## Number of Fisher Scoring iterations: 6
M16 <- cpglm(CXT1B ~ herbivore + fishing, data =CEAR, link = "log")
summary(M16)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore + fishing, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2222 -0.8302 -0.6870 -0.5678 2.3545
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.952845 0.136755 6.968 6.43e-10 ***
## herbivore 0.003166 0.137552 0.023 0.9817
## fishing -0.278265 0.151032 -1.842 0.0689 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.86962
## Estimated index parameter: 1.99
##
## Residual deviance: 87.057 on 85 degrees of freedom
## AIC: 349.19
##
## Number of Fisher Scoring iterations: 7
M17 <- cpglm(CXT1B~ site_coral + fishing, data =CEAR, link = "log")
summary(M17)
##
## Call:
## cpglm(formula = CXT1B ~ site_coral + fishing, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2018 -0.8085 -0.7382 -0.4011 2.7157
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.9433 0.1403 6.723 1.93e-09 ***
## site_coral -0.1411 0.1538 -0.917 0.362
## fishing -0.3235 0.1690 -1.914 0.059 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.85423
## Estimated index parameter: 1.99
##
## Residual deviance: 85.35 on 85 degrees of freedom
## AIC: 347.21
##
## Number of Fisher Scoring iterations: 7
M18 <- cpglm(CXT1B ~ herbivore + fishing + mean_depth, data =CEAR, link = "log")
summary(M18)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore + fishing + mean_depth, link = "log",
## data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2145 -0.8548 -0.6485 -0.5480 2.5728
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.95183 0.13825 6.885 9.77e-10 ***
## herbivore 0.01915 0.15535 0.123 0.902
## fishing -0.34732 0.27172 -1.278 0.205
## mean_depth 0.08192 0.28363 0.289 0.773
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.868
## Estimated index parameter: 1.99
##
## Residual deviance: 86.877 on 84 degrees of freedom
## AIC: 350.98
##
## Number of Fisher Scoring iterations: 7
M19 <- cpglm(CXT1B ~ coral + boulder + hard_bottom + soft_bottom, data =CEAR, link = "log")
summary(M19)
##
## Call:
## cpglm(formula = CXT1B ~ coral + boulder + hard_bottom + soft_bottom,
## link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.38465 -0.78785 -0.65546 -0.03788 2.30184
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.9033 0.1386 6.519 5.19e-09 ***
## coral -0.1535 0.1603 -0.958 0.3411
## boulder -0.2111 0.1595 -1.324 0.1893
## hard_bottom -0.1197 0.1542 -0.776 0.4400
## soft_bottom 0.3372 0.1550 2.175 0.0324 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.78975
## Estimated index parameter: 1.99
##
## Residual deviance: 78.257 on 83 degrees of freedom
## AIC: 342.58
##
## Number of Fisher Scoring iterations: 6
M20 <- cpglm(CXT1B ~ site_coral + effluent, data =CEAR, link = "log")
summary(M20)
##
## Call:
## cpglm(formula = CXT1B ~ site_coral + effluent, link = "log",
## data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.0186 -0.8344 -0.7576 -0.5748 2.6415
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.965472 0.145186 6.650 2.68e-09 ***
## site_coral -0.001541 0.148214 -0.010 0.992
## effluent -0.216853 0.171439 -1.265 0.209
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.88975
## Estimated index parameter: 1.99
##
## Residual deviance: 89.297 on 85 degrees of freedom
## AIC: 351.74
##
## Number of Fisher Scoring iterations: 15
M21 <- cpglm(CXT1B ~ site_coral, data =CEAR, link = "log")
summary(M21)
##
## Call:
## cpglm(formula = CXT1B ~ site_coral, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.9039 -0.8338 -0.8308 -0.8122 2.3790
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.98104 0.14252 6.883 8.99e-10 ***
## site_coral -0.04791 0.14331 -0.334 0.739
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.91449
## Estimated index parameter: 1.99
##
## Residual deviance: 92.063 on 86 degrees of freedom
## AIC: 352.8
##
## Number of Fisher Scoring iterations: 6
M22 <- cpglm(CXT1B ~ herbivore, data =CEAR, link = "log")
summary(M22)
##
## Call:
## cpglm(formula = CXT1B ~ herbivore, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.8568 -0.8467 -0.8455 -0.8437 2.2922
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.98223 0.14117 6.958 6.42e-10 ***
## herbivore 0.00624 0.14197 0.044 0.965
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.91638
## Estimated index parameter: 1.99
##
## Residual deviance: 92.275 on 86 degrees of freedom
## AIC: 353.03
##
## Number of Fisher Scoring iterations: 6
M23 <- cpglm(CXT1B ~ wave, data =CEAR, link = "log")
summary(M23)
##
## Call:
## cpglm(formula = CXT1B ~ wave, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.0204 -0.9056 -0.7296 -0.6277 2.5585
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.9716 0.1433 6.782 1.42e-09 ***
## wave -0.1845 0.1573 -1.173 0.244
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.89955
## Estimated index parameter: 1.99
##
## Residual deviance: 90.392 on 86 degrees of freedom
## AIC: 350.96
##
## Number of Fisher Scoring iterations: 7
M24 <- cpglm(CXT1B ~ TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom, data = CEAR, 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 = CEAR, family = tweedie(var.power = 1.5,
## link.power = 0))
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4215 -0.5737 -0.1625 0.2053 2.0784
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.684505 0.083933 8.155 6.58e-12 ***
## TL 0.336349 0.153564 2.190 0.03165 *
## BAA3 -0.201460 0.158382 -1.272 0.20736
## fishing 0.146715 0.232476 0.631 0.52992
## effluent -0.007457 0.144840 -0.051 0.95908
## herbivore 0.307033 0.156112 1.967 0.05296 .
## mean_depth -0.214801 0.227275 -0.945 0.34768
## site_coral 0.784450 0.254172 3.086 0.00285 **
## wave -0.999705 0.301605 -3.315 0.00142 **
## Age 0.046385 0.158441 0.293 0.77053
## coral -0.114081 0.122871 -0.928 0.35619
## boulder -0.099721 0.129649 -0.769 0.44424
## hard_bottom -0.003896 0.101434 -0.038 0.96946
## soft_bottom 0.397161 0.173601 2.288 0.02501 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.4181
## Estimated index parameter: 1.99
##
## Residual deviance: 39.327 on 74 degrees of freedom
## AIC: 294.27
##
## Number of Fisher Scoring iterations: 11
M25 <- cpglm(CXT1B ~ 1, data =CEAR, link = "log")
summary(M25)
##
## Call:
## cpglm(formula = CXT1B ~ 1, link = "log", data = CEAR)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.8473 -0.8473 -0.8473 -0.8473 2.2907
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.9822 0.1405 6.992 5.25e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Estimated dispersion parameter: 0.91641
## Estimated index parameter: 1.99
##
## Residual deviance: 92.278 on 87 degrees of freedom
## AIC: 351.04
##
## Number of Fisher Scoring iterations: 5