set working directory & import data

setwd("C:/Users/Nikol/Documents/Ciguatara Project/Data/CXT Data")
All = read.csv("CTX_Z_CEAR.csv")
dim(All) #examine data
## [1] 191  23
head(All,2)# 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
##   boulder hard_bottom soft_bottom coral unknown    Wave Effluent Fishing
## 1       0           0           0     1       0 2.62089          27.8167
## 2   0.128           0           0 0.872       0 2.64007           35.369
##   mean_depth BAA3 BAA5 BAA7
## 1    -5.9999   67   69  121
## 2    -4.9986   67   69  121

load packages

library(psych)
library(ggplot2)
## 
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
## 
##     %+%, alpha
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)

Create subset of data for each species

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
## 83  Anaehoom AB01    CTST   13    6       4.13   1827.46    0    0     0     20
## 84  Anaehoom AB03    CTST   13    4       4.13   1827.46    .    0     0     20
## ...     <NA> <NA>    <NA> <NA> <NA>        ...       ... <NA>  ...   ...    ...
## 188    Puako PU14    CTST   13    3    2827.84      4.13    .    0     0     20
## 189    Puako PU15    CTST   15    5    2827.84      4.13    .    0     0     20
## 190    Puako PU22    CTST   18    7    2827.84      4.13    .    0     0     20
## 191    Puako PU28    CTST   15    6    2827.84      4.13    .    0     0     20
##     boulder hard_bottom soft_bottom coral unknown    Wave Effluent Fishing
## 83        0           0           0     1       0 2.60907          37.6015
## 84        0           0           0     1       0 2.61244          37.3647
## ...    <NA>        <NA>        <NA>  <NA>    <NA>    <NA>     <NA>    <NA>
## 188       0           0           0     1       0 1.98688 13035.25 28.5239
## 189       0           0           0     1       0 2.03578  5192.94 38.4889
## 190       0           0           0 0.958   0.042 1.91096  9700.96 39.1557
## 191       0           0           0 0.958   0.042 1.90795  9718.17 39.2377
##     mean_depth BAA3 BAA5 BAA7
## 83     -4.1565   67   69    .
## 84     -4.0627   67    .    .
## ...       <NA> <NA> <NA> <NA>
## 188    -5.8475   67    .    .
## 189     -4.808   67   68    .
## 190    -5.5423   67   68  119
## 191    -5.0679   67   68    .
CEAR = subset(All, Species =="CEAR")
dim(CEAR) #examine data
## [1] 82 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>  ...   ...
## 79     Puako PU37    CEAR   32  8.1148       4.13   2827.84    1    3  0.13
## 80     Puako PU38    CEAR   38       9       4.13   2827.84    1  5.5  0.07
## 81     Puako PU39    CEAR   34       8       4.13   2827.84    1    2   0.2
## 82     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
## 1       40       0           0           0     1       0 2.62089         
## 2       40   0.128           0           0 0.872       0 2.64007         
## ...    ...    <NA>        <NA>        <NA>  <NA>    <NA>    <NA>     <NA>
## 79      40       0           0       0.143 0.837    0.02 2.24847  1302.29
## 80      40       0           0       0.143 0.837    0.02 2.24847  1302.29
## 81      40       0           0       0.143 0.837    0.02 2.24847  1302.29
## 82      40       0           0       0.143 0.837    0.02 2.24847  1302.29
##     Fishing mean_depth BAA3 BAA5 BAA7
## 1   27.8167    -5.9999   67   69  121
## 2    35.369    -4.9986   67   69  121
## ...    <NA>       <NA> <NA> <NA> <NA>
## 79  27.0478    -5.7854   61   67  101
## 80  27.0478    -5.7854   61   67  101
## 81  27.0478    -5.7854   61   67  101
## 82  27.0478    -5.7854   61   67  101
##Check structure of data and change character to numeric
#convert column 'a' from character to numeric
str(CEAR)
## 'data.frame':    82 obs. of  23 variables:
##  $ ï..Site    : chr  "Anaehoom" "Anaehoom" "Anaehoom" "Anaehoom" ...
##  $ Tag        : chr  "AB02" "AB05" "AB06" "AB07" ...
##  $ Species    : chr  "CEAR" "CEAR" "CEAR" "CEAR" ...
##  $ TL         : chr  "35" "47" "29.5" "31.5" ...
##  $ Age        : chr  "10" "22" "7" "9" ...
##  $ 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 1.5 ...
##  $ CXT1B      : num  0 0 0 0 0 ...
##  $ Buffer     : int  40 40 40 40 40 40 40 40 40 40 ...
##  $ boulder    : chr  "0" "0.128" "0" "0" ...
##  $ hard_bottom: chr  "0" "0" "0" "0" ...
##  $ soft_bottom: chr  "0" "0" "0" "0" ...
##  $ coral      : chr  "1" "0.872" "1" "1" ...
##  $ unknown    : chr  "0" "0" "0" "0" ...
##  $ Wave       : chr  "2.62089" "2.64007" "2.62772" "2.62876" ...
##  $ Effluent   : chr  "" "" "" "" ...
##  $ Fishing    : chr  "27.8167" "35.369" "26.8266" "34.4041" ...
##  $ mean_depth : chr  "-5.9999" "-4.9986" "-6.6052" "-5.5554" ...
##  $ BAA3       : chr  "67" "67" "67" "67" ...
##  $ BAA5       : chr  "69" "69" "69" "69" ...
##  $ BAA7       : chr  "121" "121" "121" "121" ...
CEAR$CTX3= as.character(CEAR$CTX3)
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)
CEAR$Fishing = as.numeric(CEAR$Fishing)
CEAR$mean_depth = as.numeric(CEAR$mean_depth)
CEAR$BAA3 = as.numeric(CEAR$BAA3)
CEAR$TL = as.numeric(CEAR$TL)
CEAR$Age = as.numeric(CEAR$Age)
str(CEAR)
## 'data.frame':    82 obs. of  23 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 24 49.8 ...
##  $ Age        : num  10 22 7 9 10 5 12 3 4 9 ...
##  $ 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 1.5 ...
##  $ CXT1B      : num  0 0 0 0 0 ...
##  $ 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.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 0.872 1 1 1 0.631 1 1 1 0.872 ...
##  $ 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 67 61 ...
##  $ BAA5       : chr  "69" "69" "69" "69" ...
##  $ BAA7       : chr  "121" "121" "121" "121" ...

#standerize data in data frame and put 0 into missing values

# 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.25  0.19       0.27     -0.78    0 -0.39 -0.33
## 2   Anaehoom AB05    CEAR  1.86   2.9       0.27     -0.78    0 -0.39 -0.33
## 3   Anaehoom AB06    CEAR -0.49 -0.48       0.27     -0.78    0 -0.39 -0.33
## 4   Anaehoom AB07    CEAR -0.22 -0.03       0.27     -0.78    0 -0.39 -0.33
## ...     <NA> <NA>    <NA>   ...   ...        ...       ... <NA>   ...   ...
## 79     Puako PU37    CEAR -0.15 -0.23      -1.81     -0.41    1  0.84  0.09
## 80     Puako PU38    CEAR  0.65 -0.03      -1.81     -0.41    1  1.87  -0.1
## 81     Puako PU39    CEAR  0.12 -0.26      -1.81     -0.41    1  0.43   0.3
## 82     Puako PU40    CEAR  2.06  2.82      -1.81     -0.41    1 -0.27  3.91
##     Buffer boulder hard_bottom soft_bottom coral unknown  Wave Effluent Fishing
## 1      NaN   -0.32       -0.17       -0.44  0.77   -0.56 -0.54     <NA>    0.13
## 2      NaN    0.34       -0.17       -0.44  0.46   -0.56 -0.51     <NA>     0.8
## 3      NaN   -0.32       -0.17       -0.44  0.77   -0.56 -0.53     <NA>    0.04
## 4      NaN   -0.32       -0.17       -0.44  0.77   -0.56 -0.53     <NA>    0.71
## ...    ...     ...         ...         ...   ...     ...   ...      ...     ...
## 79     NaN   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
## 80     NaN   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
## 81     NaN   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
## 82     NaN   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
##     mean_depth  BAA3 BAA5 BAA7
## 1         0.53  1.21   69  121
## 2         0.69  1.21   69  121
## 3         0.42  1.21   69  121
## 4          0.6  1.21   69  121
## ...        ...   ... <NA> <NA>
## 79        0.56 -1.21   67  101
## 80        0.56 -1.21   67  101
## 81        0.56 -1.21   67  101
## 82        0.56 -1.21   67  101
# 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.25  0.19       0.27     -0.78    0 -0.39 -0.33
## 2   Anaehoom AB05    CEAR  1.86   2.9       0.27     -0.78    0 -0.39 -0.33
## 3   Anaehoom AB06    CEAR -0.49 -0.48       0.27     -0.78    0 -0.39 -0.33
## 4   Anaehoom AB07    CEAR -0.22 -0.03       0.27     -0.78    0 -0.39 -0.33
## ...     <NA> <NA>    <NA>   ...   ...        ...       ... <NA>   ...   ...
## 79     Puako PU37    CEAR -0.15 -0.23      -1.81     -0.41    1  0.84  0.09
## 80     Puako PU38    CEAR  0.65 -0.03      -1.81     -0.41    1  1.87  -0.1
## 81     Puako PU39    CEAR  0.12 -0.26      -1.81     -0.41    1  0.43   0.3
## 82     Puako PU40    CEAR  2.06  2.82      -1.81     -0.41    1 -0.27  3.91
##     Buffer boulder hard_bottom soft_bottom coral unknown  Wave Effluent Fishing
## 1        0   -0.32       -0.17       -0.44  0.77   -0.56 -0.54        0    0.13
## 2        0    0.34       -0.17       -0.44  0.46   -0.56 -0.51        0     0.8
## 3        0   -0.32       -0.17       -0.44  0.77   -0.56 -0.53        0    0.04
## 4        0   -0.32       -0.17       -0.44  0.77   -0.56 -0.53        0    0.71
## ...    ...     ...         ...         ...   ...     ...   ...      ...     ...
## 79       0   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
## 80       0   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
## 81       0   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
## 82       0   -0.32       -0.17        2.38  0.38   -0.52 -0.97    -0.77    0.06
##     mean_depth  BAA3 BAA5 BAA7
## 1         0.53  1.21   69  121
## 2         0.69  1.21   69  121
## 3         0.42  1.21   69  121
## 4          0.6  1.21   69  121
## ...        ...   ... <NA> <NA>
## 79        0.56 -1.21   67  101
## 80        0.56 -1.21   67  101
## 81        0.56 -1.21   67  101
## 82        0.56 -1.21   67  101
CEAR$CTX3= as.numeric(CEAR$CTX3)
## Warning: NAs introduced by coercion
str(CEAR)
## 'data.frame':    82 obs. of  23 variables:
##  $ ï..Site    : chr  "Anaehoom" "Anaehoom" "Anaehoom" "Anaehoom" ...
##  $ Tag        : chr  "AB02" "AB05" "AB06" "AB07" ...
##  $ Species    : chr  "CEAR" "CEAR" "CEAR" "CEAR" ...
##  $ TL         : num  0.25 1.861 -0.488 -0.219 -1.427 ...
##  $ Age        : num  0.1946 2.9013 -0.482 -0.0309 0.1946 ...
##  $ site_coral : num  0.27 0.27 0.27 0.27 0.27 ...
##  $ herbivore  : num  -0.776 -0.776 -0.776 -0.776 -0.776 ...
##  $ CTX3       : num  0 0 0 0 0 0 0 1 0 1 ...
##  $ EC50       : num  -0.392 -0.392 -0.392 -0.392 -0.392 ...
##  $ CXT1B      : num  -0.335 -0.335 -0.335 -0.335 -0.335 ...
##  $ Buffer     : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ boulder    : num  -0.321 0.335 -0.321 -0.321 -0.321 ...
##  $ hard_bottom: num  -0.173 -0.173 -0.173 -0.173 -0.173 ...
##  $ soft_bottom: num  -0.439 -0.439 -0.439 -0.439 -0.439 ...
##  $ coral      : num  0.775 0.463 0.775 0.775 0.775 ...
##  $ unknown    : num  -0.564 -0.564 -0.564 -0.564 -0.564 ...
##  $ Wave       : num  -0.536 -0.514 -0.528 -0.527 -0.54 ...
##  $ Effluent   : num  0 0 0 0 0 ...
##  $ Fishing    : num  0.1285 0.799 0.0406 0.7133 -0.0446 ...
##  $ mean_depth : num  0.525 0.692 0.424 0.599 0.525 ...
##  $ BAA3       : num  1.21 1.21 1.21 1.21 1.21 ...
##  $ BAA5       : chr  "69" "69" "69" "69" ...
##  $ BAA7       : chr  "121" "121" "121" "121" ...

Create glm models for CEAR dataframe

#fit models
model1 <- glm(CTX3 ~ TL + BAA3, family="binomial", data = CEAR)
model2 <- glm(CTX3 ~ TL + BAA3 + Fishing, family="binomial", data = CEAR)
model3 <- glm(CTX3 ~ TL + Fishing, family="binomial", data = CEAR)
model4 = glm(CTX3 ~ TL + Fishing + Effluent, family="binomial", data = CEAR)
model5 = glm(CTX3 ~ herbivore + BAA3, family="binomial", data = CEAR)
model6 = glm(CTX3 ~ TL + Effluent, family="binomial", data = CEAR)
model7 = glm(CTX3~ TL + mean_depth, family="binomial", data = CEAR)
model8 = glm(CTX3 ~ coral + boulder + TL + BAA3, family="binomial", data = CEAR)
model9 = glm(CTX3 ~ TL, family="binomial", data = CEAR)
model10 = glm(CTX3 ~ TL + coral + boulder + herbivore, family="binomial", data = CEAR)
model11 = glm(CTX3 ~ TL + Wave, family="binomial", data = CEAR)
model12 = glm(CTX3 ~ TL + Age, family="binomial", data = CEAR)
model13 = glm(CTX3 ~ TL + coral + boulder, family="binomial", data = CEAR)
model14 = glm(CTX3 ~ TL + site_coral + herbivore, family="binomial", data = CEAR)
model15 = glm(CTX3 ~  BAA3, family="binomial", data = CEAR)
model16 = glm(CTX3 ~ herbivore + Fishing, family="binomial", data = CEAR)
model17 = glm(CTX3 ~ site_coral + Fishing, family="binomial", data = CEAR)
model18 = glm(CTX3 ~ herbivore + Fishing + mean_depth, family="binomial", data = CEAR)
model19 = glm(CTX3 ~ coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CEAR)
model20 = glm(CTX3 ~ site_coral + Effluent, family="binomial", data = CEAR)
model21 = glm(CTX3 ~ site_coral, family="binomial", data = CEAR)
model22 = glm(CTX3 ~ herbivore, family="binomial", data = CEAR)
model23 = glm(CTX3 ~ Wave, family="binomial", data = CEAR)
model24 = glm(CTX3 ~ TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CEAR)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Calculate the AIC of each model

#define list of models
models <- list(model1, model2, model3, model4, model5, model6, model7, model8, model9, model10, model11, model12, model13, model14,  model15, model16, model17, model18, model19, model20, model21, model22, model23, model24)

#specify model names
mod.names <- c('TL + BAA3', 'TL + BAA3 + Fishing', 'TL + Fishing', 'TL + Fishing + Effluent', 'herbivore + BAA3', 'TL + Effluent', 'TL + mean_depth', 'coral + boulder + TL + BAA3', 'TL, data', 'TL + coral + boulder + herbivore', 'TL + Wave', 'TL + Age', 'TL + coral + boulder', 'TL + mean_coral + herbivore_biomass', 'BAA3', 'herbivore_biomass + fishing', 'site_coral + Fishing', 'herbivore + Fishing + mean_depth', 'coral + boulder + hard_bottom + soft_bottom', 'site_coral + Effluent', 'site_coral', 'herbivore', 'Wave', 'TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom')

#calculate AIC of each model
aictab(cand.set = models, modnames = mod.names)
## 
## Model selection based on AICc:
## 
##                                                                                                                                  K
## TL + BAA3                                                                                                                        3
## TL + BAA3 + Fishing                                                                                                              4
## coral + boulder + TL + BAA3                                                                                                      5
## TL + Fishing                                                                                                                     3
## TL + Fishing + Effluent                                                                                                          4
## TL + Effluent                                                                                                                    3
## TL, data                                                                                                                         2
## TL + mean_depth                                                                                                                  3
## TL + Age                                                                                                                         3
## TL + Wave                                                                                                                        3
## BAA3                                                                                                                             2
## TL + coral + boulder                                                                                                             4
## TL + mean_coral + herbivore_biomass                                                                                              4
## herbivore + BAA3                                                                                                                 3
## TL + coral + boulder + herbivore                                                                                                 5
## site_coral + Fishing                                                                                                             3
## coral + boulder + hard_bottom + soft_bottom                                                                                      5
## site_coral + Effluent                                                                                                            3
## site_coral                                                                                                                       2
## herbivore_biomass + fishing                                                                                                      3
## Wave                                                                                                                             2
## herbivore + Fishing + mean_depth                                                                                                 4
## TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom 14
## herbivore                                                                                                                        2
##                                                                                                                                  AICc
## TL + BAA3                                                                                                                       72.99
## TL + BAA3 + Fishing                                                                                                             74.91
## coral + boulder + TL + BAA3                                                                                                     76.70
## TL + Fishing                                                                                                                    77.14
## TL + Fishing + Effluent                                                                                                         78.11
## TL + Effluent                                                                                                                   79.87
## TL, data                                                                                                                        80.29
## TL + mean_depth                                                                                                                 81.66
## TL + Age                                                                                                                        82.24
## TL + Wave                                                                                                                       82.28
## BAA3                                                                                                                            82.95
## TL + coral + boulder                                                                                                            83.22
## TL + mean_coral + herbivore_biomass                                                                                             84.02
## herbivore + BAA3                                                                                                                84.68
## TL + coral + boulder + herbivore                                                                                                85.32
## site_coral + Fishing                                                                                                            87.48
## coral + boulder + hard_bottom + soft_bottom                                                                                     90.87
## site_coral + Effluent                                                                                                           91.96
## site_coral                                                                                                                      93.20
## herbivore_biomass + fishing                                                                                                     93.62
## Wave                                                                                                                            94.18
## herbivore + Fishing + mean_depth                                                                                                94.55
## TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom 94.99
## herbivore                                                                                                                       95.56
##                                                                                                                                 Delta_AICc
## TL + BAA3                                                                                                                             0.00
## TL + BAA3 + Fishing                                                                                                                   1.92
## coral + boulder + TL + BAA3                                                                                                           3.72
## TL + Fishing                                                                                                                          4.15
## TL + Fishing + Effluent                                                                                                               5.13
## TL + Effluent                                                                                                                         6.88
## TL, data                                                                                                                              7.30
## TL + mean_depth                                                                                                                       8.67
## TL + Age                                                                                                                              9.26
## TL + Wave                                                                                                                             9.30
## BAA3                                                                                                                                  9.97
## TL + coral + boulder                                                                                                                 10.24
## TL + mean_coral + herbivore_biomass                                                                                                  11.04
## herbivore + BAA3                                                                                                                     11.70
## TL + coral + boulder + herbivore                                                                                                     12.33
## site_coral + Fishing                                                                                                                 14.50
## coral + boulder + hard_bottom + soft_bottom                                                                                          17.89
## site_coral + Effluent                                                                                                                18.98
## site_coral                                                                                                                           20.21
## herbivore_biomass + fishing                                                                                                          20.63
## Wave                                                                                                                                 21.19
## herbivore + Fishing + mean_depth                                                                                                     21.57
## TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom      22.00
## herbivore                                                                                                                            22.58
##                                                                                                                                 AICcWt
## TL + BAA3                                                                                                                         0.54
## TL + BAA3 + Fishing                                                                                                               0.21
## coral + boulder + TL + BAA3                                                                                                       0.08
## TL + Fishing                                                                                                                      0.07
## TL + Fishing + Effluent                                                                                                           0.04
## TL + Effluent                                                                                                                     0.02
## TL, data                                                                                                                          0.01
## TL + mean_depth                                                                                                                   0.01
## TL + Age                                                                                                                          0.01
## TL + Wave                                                                                                                         0.01
## BAA3                                                                                                                              0.00
## TL + coral + boulder                                                                                                              0.00
## TL + mean_coral + herbivore_biomass                                                                                               0.00
## herbivore + BAA3                                                                                                                  0.00
## TL + coral + boulder + herbivore                                                                                                  0.00
## site_coral + Fishing                                                                                                              0.00
## coral + boulder + hard_bottom + soft_bottom                                                                                       0.00
## site_coral + Effluent                                                                                                             0.00
## site_coral                                                                                                                        0.00
## herbivore_biomass + fishing                                                                                                       0.00
## Wave                                                                                                                              0.00
## herbivore + Fishing + mean_depth                                                                                                  0.00
## TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom   0.00
## herbivore                                                                                                                         0.00
##                                                                                                                                 Cum.Wt
## TL + BAA3                                                                                                                         0.54
## TL + BAA3 + Fishing                                                                                                               0.75
## coral + boulder + TL + BAA3                                                                                                       0.83
## TL + Fishing                                                                                                                      0.90
## TL + Fishing + Effluent                                                                                                           0.94
## TL + Effluent                                                                                                                     0.96
## TL, data                                                                                                                          0.97
## TL + mean_depth                                                                                                                   0.98
## TL + Age                                                                                                                          0.98
## TL + Wave                                                                                                                         0.99
## BAA3                                                                                                                              0.99
## TL + coral + boulder                                                                                                              0.99
## TL + mean_coral + herbivore_biomass                                                                                               1.00
## herbivore + BAA3                                                                                                                  1.00
## TL + coral + boulder + herbivore                                                                                                  1.00
## site_coral + Fishing                                                                                                              1.00
## coral + boulder + hard_bottom + soft_bottom                                                                                       1.00
## site_coral + Effluent                                                                                                             1.00
## site_coral                                                                                                                        1.00
## herbivore_biomass + fishing                                                                                                       1.00
## Wave                                                                                                                              1.00
## herbivore + Fishing + mean_depth                                                                                                  1.00
## TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom   1.00
## herbivore                                                                                                                         1.00
##                                                                                                                                     LL
## TL + BAA3                                                                                                                       -33.33
## TL + BAA3 + Fishing                                                                                                             -33.17
## coral + boulder + TL + BAA3                                                                                                     -32.92
## TL + Fishing                                                                                                                    -35.40
## TL + Fishing + Effluent                                                                                                         -34.78
## TL + Effluent                                                                                                                   -36.77
## TL, data                                                                                                                        -38.06
## TL + mean_depth                                                                                                                 -37.66
## TL + Age                                                                                                                        -37.95
## TL + Wave                                                                                                                       -37.98
## BAA3                                                                                                                            -39.39
## TL + coral + boulder                                                                                                            -37.33
## TL + mean_coral + herbivore_biomass                                                                                             -37.73
## herbivore + BAA3                                                                                                                -39.17
## TL + coral + boulder + herbivore                                                                                                -37.23
## site_coral + Fishing                                                                                                            -40.58
## coral + boulder + hard_bottom + soft_bottom                                                                                     -40.01
## site_coral + Effluent                                                                                                           -42.82
## site_coral                                                                                                                      -44.52
## herbivore_biomass + fishing                                                                                                     -43.64
## Wave                                                                                                                            -45.01
## herbivore + Fishing + mean_depth                                                                                                -42.99
## TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom -30.05
## herbivore                                                                                                                       -45.70

Summaries for all models

model1 <- glm(CTX3 ~ TL + BAA3, family="binomial", data = CEAR)
summary(model1)
## 
## Call:
## glm(formula = CTX3 ~ TL + BAA3, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7498  -0.6096  -0.3858   0.5652   2.4903  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.1746     0.3293  -3.567 0.000361 ***
## TL            1.0236     0.3184   3.215 0.001304 ** 
## BAA3         -0.9125     0.3136  -2.910 0.003613 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 66.652  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 72.652
## 
## Number of Fisher Scoring iterations: 5
model2 <- glm(CTX3 ~ TL + BAA3 + Fishing, family="binomial", data = CEAR)
summary(model2)
## 
## Call:
## glm(formula = CTX3 ~ TL + BAA3 + Fishing, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6997  -0.6099  -0.3819   0.5220   2.4399  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.1636     0.3306  -3.520 0.000432 ***
## TL            1.0556     0.3278   3.220 0.001283 ** 
## BAA3         -0.7893     0.3824  -2.064 0.039008 *  
## Fishing      -0.2613     0.4753  -0.550 0.582428    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 66.344  on 72  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 74.344
## 
## Number of Fisher Scoring iterations: 5
model3 <- glm(CTX3 ~ TL + Fishing, family="binomial", data = CEAR)
summary(model3)
## 
## Call:
## glm(formula = CTX3 ~ TL + Fishing, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5150  -0.6653  -0.4485   0.7246   2.0497  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0770     0.3099  -3.475 0.000511 ***
## TL            1.1570     0.3199   3.617 0.000299 ***
## Fishing      -0.8619     0.3948  -2.183 0.029029 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 70.807  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 76.807
## 
## Number of Fisher Scoring iterations: 5
model4 = glm(CTX3 ~ TL + Fishing + Effluent, family="binomial", data = CEAR)
summary(model4)
## 
## Call:
## glm(formula = CTX3 ~ TL + Fishing + Effluent, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5992  -0.6563  -0.4586   0.6485   2.2324  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.1599     0.3291  -3.525 0.000424 ***
## TL            1.1339     0.3187   3.558 0.000374 ***
## Fishing      -0.7694     0.4024  -1.912 0.055859 .  
## Effluent     -0.4238     0.3864  -1.097 0.272678    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 69.551  on 72  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 77.551
## 
## Number of Fisher Scoring iterations: 5
model5 = glm(CTX3 ~ herbivore + BAA3, family="binomial", data = CEAR)
summary(model5)
## 
## Call:
## glm(formula = CTX3 ~ herbivore + BAA3, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5857  -0.7651  -0.4243   1.0981   2.2429  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0278     0.2952  -3.481 0.000499 ***
## herbivore     0.1878     0.2814   0.667 0.504597    
## BAA3         -1.0374     0.3206  -3.236 0.001212 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 78.349  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 84.349
## 
## Number of Fisher Scoring iterations: 4
model6 = glm(CTX3 ~ TL + Effluent, family="binomial", data = CEAR)
summary(model6)
## 
## Call:
## glm(formula = CTX3 ~ TL + Effluent, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6500  -0.6983  -0.4687   0.8031   2.2001  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.1578     0.3131  -3.698 0.000218 ***
## TL            1.0624     0.3029   3.507 0.000453 ***
## Effluent     -0.5453     0.3526  -1.547 0.121983    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 73.537  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 79.537
## 
## Number of Fisher Scoring iterations: 4
model7 = glm(CTX3~ TL + mean_depth, family="binomial", data = CEAR)
summary(model7)
## 
## Call:
## glm(formula = CTX3 ~ TL + mean_depth, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4978  -0.7116  -0.5433   0.7513   2.0728  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0520     0.2973  -3.539 0.000402 ***
## TL            1.0686     0.3011   3.549 0.000387 ***
## mean_depth   -0.3232     0.3627  -0.891 0.372894    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 75.325  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 81.325
## 
## Number of Fisher Scoring iterations: 4
model8 = glm(CTX3 ~ coral + boulder + TL + BAA3, family="binomial", data = CEAR)
summary(model8)
## 
## Call:
## glm(formula = CTX3 ~ coral + boulder + TL + BAA3, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7792  -0.5862  -0.4004   0.5949   2.3857  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.2311     0.3580  -3.439 0.000584 ***
## coral         0.1658     0.3990   0.416 0.677662    
## boulder      -0.4216     0.7917  -0.533 0.594362    
## TL            0.9978     0.3204   3.114 0.001843 ** 
## BAA3         -0.8780     0.3125  -2.810 0.004957 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 65.848  on 71  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 75.848
## 
## Number of Fisher Scoring iterations: 6
model9 = glm(CTX3 ~ TL, family="binomial", data = CEAR)
summary(model9)
## 
## Call:
## glm(formula = CTX3 ~ TL, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5688  -0.6961  -0.5614   0.7796   2.0085  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0770     0.2959  -3.640 0.000273 ***
## TL            1.0542     0.2967   3.553 0.000381 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 76.123  on 74  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 80.123
## 
## Number of Fisher Scoring iterations: 4
model10 = glm(CTX3 ~ TL + coral + boulder + herbivore, family="binomial", data = CEAR)
summary(model10)
## 
## Call:
## glm(formula = CTX3 ~ TL + coral + boulder + herbivore, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5039  -0.7039  -0.5275   0.7917   2.1096  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.2053     0.3618  -3.331 0.000865 ***
## TL            1.0581     0.3009   3.516 0.000438 ***
## coral         0.2346     0.4236   0.554 0.579653    
## boulder      -0.7350     0.9673  -0.760 0.447359    
## herbivore     0.1507     0.3380   0.446 0.655746    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 74.463  on 71  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 84.463
## 
## Number of Fisher Scoring iterations: 6
model11 = glm(CTX3 ~ TL + Wave, family="binomial", data = CEAR)
summary(model11)
## 
## Call:
## glm(formula = CTX3 ~ TL + Wave, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5736  -0.6998  -0.5393   0.7857   2.0190  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0947     0.3011  -3.635 0.000278 ***
## TL            1.0324     0.3003   3.438 0.000586 ***
## Wave         -0.1343     0.3242  -0.414 0.678669    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 75.950  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 81.95
## 
## Number of Fisher Scoring iterations: 4
model12 = glm(CTX3 ~ TL + Age, family="binomial", data = CEAR)
summary(model12)
## 
## Call:
## glm(formula = CTX3 ~ TL + Age, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7054  -0.6874  -0.5733   0.7544   2.0710  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0646     0.2965  -3.590  0.00033 ***
## TL            0.9068     0.4274   2.122  0.03387 *  
## Age           0.1948     0.4224   0.461  0.64471    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 75.909  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 81.909
## 
## Number of Fisher Scoring iterations: 4
model13 = glm(CTX3 ~ TL + coral + boulder, family="binomial", data = CEAR)
summary(model13)
## 
## Call:
## glm(formula = CTX3 ~ TL + coral + boulder, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4944  -0.7055  -0.5269   0.8135   2.0207  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.1856     0.3509  -3.379 0.000728 ***
## TL            1.0429     0.2976   3.504 0.000458 ***
## coral         0.1341     0.3603   0.372 0.709707    
## boulder      -0.6986     0.9112  -0.767 0.443288    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 74.660  on 72  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 82.66
## 
## Number of Fisher Scoring iterations: 6
model14 = glm(CTX3 ~ TL + site_coral + herbivore, family="binomial", data = CEAR)
summary(model14)
## 
## Call:
## glm(formula = CTX3 ~ TL + site_coral + herbivore, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5374  -0.7067  -0.5502   0.8113   2.0771  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -1.11339    0.30354  -3.668 0.000244 ***
## TL           1.02100    0.30005   3.403 0.000667 ***
## site_coral  -0.22549    0.27931  -0.807 0.419481    
## herbivore    0.09132    0.29067   0.314 0.753399    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 75.459  on 72  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 83.459
## 
## Number of Fisher Scoring iterations: 4
model15 = glm(CTX3 ~  BAA3, family="binomial", data = CEAR)
summary(model15)
## 
## Call:
## glm(formula = CTX3 ~ BAA3, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.598  -0.697  -0.464   1.107   2.137  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0030     0.2878  -3.484 0.000493 ***
## BAA3         -0.9665     0.2909  -3.322 0.000893 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 78.787  on 74  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 82.787
## 
## Number of Fisher Scoring iterations: 4
model16 = glm(CTX3 ~ herbivore + Fishing, family="binomial", data = CEAR)
summary(model16)
## 
## Call:
## glm(formula = CTX3 ~ herbivore + Fishing, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.3095  -0.8482  -0.6522   1.1186   1.8812  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -0.87731    0.26060  -3.367 0.000761 ***
## herbivore   -0.05184    0.25316  -0.205 0.837734    
## Fishing     -0.64107    0.32371  -1.980 0.047661 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 87.283  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 93.283
## 
## Number of Fisher Scoring iterations: 4
model17 = glm(CTX3 ~ site_coral + Fishing, family="binomial", data = CEAR)
summary(model17)
## 
## Call:
## glm(formula = CTX3 ~ site_coral + Fishing, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4474  -0.8001  -0.5444   1.0408   2.3050  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -0.9964     0.2844  -3.504 0.000458 ***
## site_coral   -0.7073     0.2936  -2.409 0.015976 *  
## Fishing      -1.0116     0.3805  -2.659 0.007849 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 81.151  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 87.151
## 
## Number of Fisher Scoring iterations: 4
model18 = glm(CTX3 ~ herbivore + Fishing + mean_depth, family="binomial", data = CEAR)
summary(model18)
## 
## Call:
## glm(formula = CTX3 ~ herbivore + Fishing + mean_depth, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.426  -0.858  -0.629   1.249   2.223  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -0.92778    0.27000  -3.436  0.00059 ***
## herbivore    0.09269    0.28428   0.326  0.74438    
## Fishing     -1.16307    0.58824  -1.977  0.04802 *  
## mean_depth   0.66067    0.59824   1.104  0.26944    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 85.988  on 72  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 93.988
## 
## Number of Fisher Scoring iterations: 4
model19 = glm(CTX3 ~ coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CEAR)
summary(model19)
## 
## Call:
## glm(formula = CTX3 ~ coral + boulder + hard_bottom + soft_bottom, 
##     family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6013  -0.7638  -0.6945   0.8062   1.7763  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept) -1.29930    0.65117  -1.995   0.0460 *
## coral        0.02326    0.32907   0.071   0.9437  
## boulder     -0.39425    0.54580  -0.722   0.4701  
## hard_bottom -2.27539    4.19604  -0.542   0.5876  
## soft_bottom  0.72614    0.28465   2.551   0.0107 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 80.014  on 71  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 90.014
## 
## Number of Fisher Scoring iterations: 8
model20 = glm(CTX3 ~ site_coral + Effluent, family="binomial", data = CEAR)
summary(model20)
## 
## Call:
## glm(formula = CTX3 ~ site_coral + Effluent, family = "binomial", 
##     data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.2617  -0.7601  -0.7408   1.0954   2.0616  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.0344     0.2776  -3.726 0.000194 ***
## site_coral   -0.4388     0.2616  -1.677 0.093494 .  
## Effluent     -0.5636     0.3164  -1.782 0.074807 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 85.630  on 73  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 91.63
## 
## Number of Fisher Scoring iterations: 4
model21 = glm(CTX3 ~ site_coral, family="binomial", data = CEAR)
summary(model21)
## 
## Call:
## glm(formula = CTX3 ~ site_coral, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0685  -0.7727  -0.7613   1.2904   1.7543  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -0.9529     0.2622  -3.634 0.000279 ***
## site_coral   -0.3814     0.2438  -1.564 0.117745    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 89.036  on 74  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 93.036
## 
## Number of Fisher Scoring iterations: 4
model22 = glm(CTX3 ~ herbivore, family="binomial", data = CEAR)
summary(model22)
## 
## Call:
## glm(formula = CTX3 ~ herbivore, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8426  -0.8426  -0.8298   1.5542   1.6262  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -0.89802    0.25305  -3.549 0.000387 ***
## herbivore   -0.05827    0.24946  -0.234 0.815320    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 91.400  on 74  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 95.4
## 
## Number of Fisher Scoring iterations: 4
model23 = glm(CTX3 ~ Wave, family="binomial", data = CEAR)
summary(model23)
## 
## Call:
## glm(formula = CTX3 ~ Wave, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.9891  -0.8759  -0.7276   1.4447   1.7901  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -0.9406     0.2609  -3.606 0.000311 ***
## Wave         -0.3422     0.2895  -1.182 0.237215    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 90.011  on 74  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 94.011
## 
## Number of Fisher Scoring iterations: 4
model24 = glm(CTX3 ~ TL + BAA3 + Fishing + Effluent + herbivore + mean_depth + site_coral + Wave + Age + coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CEAR)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
summary(model24)
## 
## Call:
## glm(formula = CTX3 ~ TL + BAA3 + Fishing + Effluent + herbivore + 
##     mean_depth + site_coral + Wave + Age + coral + boulder + 
##     hard_bottom + soft_bottom, family = "binomial", data = CEAR)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9061  -0.5359  -0.3367   0.5413   2.4093  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  -2.2479     1.1286  -1.992   0.0464 *
## TL            1.0848     0.5834   1.859   0.0630 .
## BAA3         -0.5707     0.5756  -0.991   0.3214  
## Fishing      -0.3203     0.9644  -0.332   0.7398  
## Effluent      0.4149     0.6557   0.633   0.5269  
## herbivore     1.1816     0.6612   1.787   0.0739 .
## mean_depth   -0.1498     1.1431  -0.131   0.8958  
## site_coral    1.5498     1.1560   1.341   0.1800  
## Wave         -1.8868     1.3694  -1.378   0.1682  
## Age          -0.2319     0.5936  -0.391   0.6961  
## coral         0.2005     0.5208   0.385   0.7003  
## boulder      -0.1656     0.7710  -0.215   0.8299  
## hard_bottom  -7.4774     7.3464  -1.018   0.3088  
## soft_bottom   1.0215     0.7471   1.367   0.1715  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 91.455  on 75  degrees of freedom
## Residual deviance: 60.102  on 62  degrees of freedom
##   (6 observations deleted due to missingness)
## AIC: 88.102
## 
## Number of Fisher Scoring iterations: 8