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,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.000           0           0 1.000       0 2.62089          27.8167
## 2   0.128           0           0 0.872       0 2.64007          35.3690
##   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
## 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
##Check structure of data and change character to numeric
#convert column 'a' from character to numeric
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         : chr  "13" "13" "13.5" "12" ...
##  $ Age        : chr  "6" "4" "3" "2" ...
##  $ 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      : chr  "0" "0.4" "0" "0.53333" ...
##  $ 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   : chr  "" "" "" "" ...
##  $ fishing    : num  37.6 37.4 39.9 37.7 37.3 ...
##  $ mean_depth : chr  "-4.1565" "-4.0627" "-1.3427" "-3.1513" ...
##  $ BAA3       : chr  "67" "67" "67" "." ...
##  $ BAA5       : chr  "69" "." "." "." ...
##  $ BAA7       : chr  "." "." "." "." ...
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      : chr  "0" "0.4" "0" "0.53333" ...
##  $ 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  "." "." "." "." ...

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

# 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    .
# 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       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       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    .
CTST$CTX3= as.numeric(CTST$CTX3)
## 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  -0.851 -0.851 -0.568 -1.419 -0.568 ...
##  $ Age        : num  1.4859 -0.0935 -0.8832 -1.6729 3.0653 ...
##  $ site_coral : num  0.074 0.074 0.074 0.074 0.074 ...
##  $ herbivore  : num  -0.908 -0.908 -0.908 -0.908 -0.908 ...
##  $ CTX3       : num  0 1 0 1 1 1 1 1 0 1 ...
##  $ EC50       : chr  "0" "1" "0" "0.75" ...
##  $ CXT1B      : chr  "0" "0.4" "0" "0.53333" ...
##  $ Buffer     : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ boulder    : num  -0.364 -0.364 5.506 -0.364 -0.364 ...
##  $ hard_bottom: num  -0.102 -0.102 -0.102 -0.102 -0.102 ...
##  $ soft_bottom: num  -0.169 -0.169 -0.169 -0.169 -0.169 ...
##  $ coral      : num  0.443 0.443 -3.293 0.443 0.443 ...
##  $ unknown    : num  -0.25 -0.25 -0.25 -0.25 -0.25 ...
##  $ wave       : num  -0.741 -0.737 -0.742 -0.742 -0.736 ...
##  $ effluent   : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ fishing    : num  0.689 0.662 0.949 0.703 0.653 ...
##  $ mean_depth : num  0.993 1.018 1.766 1.269 0.967 ...
##  $ BAA3       : num  0.972 0.972 0.972 0 0.972 ...
##  $ BAA5       : chr  "69" "." "." "." ...
##  $ BAA7       : chr  "." "." "." "." ...

Create glm models for CTST dataframe

#fit models
model1 <- glm(CTX3 ~ TL + BAA3, family="binomial", data = CTST)
model2 <- glm(CTX3 ~ TL + BAA3 + fishing, family="binomial", data = CTST)
model3 <- glm(CTX3 ~ TL + fishing, family="binomial", data = CTST)
model4 = glm(CTX3 ~ TL + fishing + effluent, family="binomial", data = CTST)
model5 = glm(CTX3 ~ herbivore + BAA3, family="binomial", data = CTST)
model6 = glm(CTX3 ~ TL + effluent, family="binomial", data = CTST)
model7 = glm(CTX3~ TL + mean_depth, family="binomial", data = CTST)
model8 = glm(CTX3 ~ coral + boulder + TL + BAA3, family="binomial", data = CTST)
model9 = glm(CTX3 ~ TL, family="binomial", data = CTST)
model10 = glm(CTX3 ~ TL + coral + boulder + herbivore, family="binomial", data = CTST)
model11 = glm(CTX3 ~ TL + wave, family="binomial", data = CTST)
model12 = glm(CTX3 ~ TL + Age, family="binomial", data = CTST)
model13 = glm(CTX3 ~ TL + coral + boulder, family="binomial", data = CTST)
model14 = glm(CTX3 ~ TL + site_coral + herbivore, family="binomial", data = CTST)
model15 = glm(CTX3 ~  BAA3, family="binomial", data = CTST)
model16 = glm(CTX3 ~ herbivore + fishing, family="binomial", data = CTST)
model17 = glm(CTX3 ~ site_coral + fishing, family="binomial", data = CTST)
model18 = glm(CTX3 ~ herbivore + fishing + mean_depth, family="binomial", data = CTST)
model19 = glm(CTX3 ~ coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CTST)
model20 = glm(CTX3 ~ site_coral + effluent, family="binomial", data = CTST)
model21 = glm(CTX3 ~ site_coral, family="binomial", data = CTST)
model22 = glm(CTX3 ~ herbivore, family="binomial", data = CTST)
model23 = glm(CTX3 ~ wave, family="binomial", data = CTST)
model24 = glm(CTX3 ~ TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CTST)
model25 = glm(CTX3~1,family="binomial", data = CTST)

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, model25)
#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 + site_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', '1')

#calculate AIC of each model
aictab(cand.set = models, modnames = mod.names)
## 
## Model selection based on AICc:
## 
##                                                                                                                                  K
## site_coral + fishing                                                                                                             3
## TL + BAA3 + fishing                                                                                                              4
## TL + fishing + effluent                                                                                                          4
## TL + BAA3                                                                                                                        3
## TL + effluent                                                                                                                    3
## TL + fishing                                                                                                                     3
## site_coral + effluent                                                                                                            3
## coral + boulder + TL + BAA3                                                                                                      5
## TL + site_coral + herbivore_biomass                                                                                              4
## site_coral                                                                                                                       2
## herbivore_biomass + fishing                                                                                                      3
## BAA3                                                                                                                             2
## herbivore + fishing + mean_depth                                                                                                 4
## TL + wave                                                                                                                        3
## herbivore + BAA3                                                                                                                 3
## TL + mean_depth                                                                                                                  3
## TL, data                                                                                                                         2
## TL + Age                                                                                                                         3
## 1                                                                                                                                1
## TL + coral + boulder                                                                                                             4
## wave                                                                                                                             2
## TL + coral + boulder + herbivore                                                                                                 5
## herbivore                                                                                                                        2
## TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom 14
## coral + boulder + hard_bottom + soft_bottom                                                                                      5
##                                                                                                                                   AICc
## site_coral + fishing                                                                                                             88.33
## TL + BAA3 + fishing                                                                                                              89.42
## TL + fishing + effluent                                                                                                          90.35
## TL + BAA3                                                                                                                        91.48
## TL + effluent                                                                                                                    91.52
## TL + fishing                                                                                                                     91.60
## site_coral + effluent                                                                                                            91.92
## coral + boulder + TL + BAA3                                                                                                      95.26
## TL + site_coral + herbivore_biomass                                                                                              96.49
## site_coral                                                                                                                       96.57
## herbivore_biomass + fishing                                                                                                      96.95
## BAA3                                                                                                                             97.19
## herbivore + fishing + mean_depth                                                                                                 99.08
## TL + wave                                                                                                                        99.31
## herbivore + BAA3                                                                                                                 99.34
## TL + mean_depth                                                                                                                  99.47
## TL, data                                                                                                                        100.95
## TL + Age                                                                                                                        102.89
## 1                                                                                                                               103.52
## TL + coral + boulder                                                                                                            103.62
## wave                                                                                                                            103.79
## TL + coral + boulder + herbivore                                                                                                104.95
## herbivore                                                                                                                       105.53
## TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom 105.87
## coral + boulder + hard_bottom + soft_bottom                                                                                     110.43
##                                                                                                                                 Delta_AICc
## site_coral + fishing                                                                                                                  0.00
## TL + BAA3 + fishing                                                                                                                   1.09
## TL + fishing + effluent                                                                                                               2.02
## TL + BAA3                                                                                                                             3.15
## TL + effluent                                                                                                                         3.19
## TL + fishing                                                                                                                          3.27
## site_coral + effluent                                                                                                                 3.59
## coral + boulder + TL + BAA3                                                                                                           6.93
## TL + site_coral + herbivore_biomass                                                                                                   8.16
## site_coral                                                                                                                            8.24
## herbivore_biomass + fishing                                                                                                           8.62
## BAA3                                                                                                                                  8.86
## herbivore + fishing + mean_depth                                                                                                     10.75
## TL + wave                                                                                                                            10.98
## herbivore + BAA3                                                                                                                     11.01
## TL + mean_depth                                                                                                                      11.14
## TL, data                                                                                                                             12.62
## TL + Age                                                                                                                             14.56
## 1                                                                                                                                    15.19
## TL + coral + boulder                                                                                                                 15.29
## wave                                                                                                                                 15.46
## TL + coral + boulder + herbivore                                                                                                     16.62
## herbivore                                                                                                                            17.20
## TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom      17.54
## coral + boulder + hard_bottom + soft_bottom                                                                                          22.10
##                                                                                                                                 AICcWt
## site_coral + fishing                                                                                                              0.35
## TL + BAA3 + fishing                                                                                                               0.21
## TL + fishing + effluent                                                                                                           0.13
## TL + BAA3                                                                                                                         0.07
## TL + effluent                                                                                                                     0.07
## TL + fishing                                                                                                                      0.07
## site_coral + effluent                                                                                                             0.06
## coral + boulder + TL + BAA3                                                                                                       0.01
## TL + site_coral + herbivore_biomass                                                                                               0.01
## site_coral                                                                                                                        0.01
## herbivore_biomass + fishing                                                                                                       0.00
## BAA3                                                                                                                              0.00
## herbivore + fishing + mean_depth                                                                                                  0.00
## TL + wave                                                                                                                         0.00
## herbivore + BAA3                                                                                                                  0.00
## TL + mean_depth                                                                                                                   0.00
## TL, data                                                                                                                          0.00
## TL + Age                                                                                                                          0.00
## 1                                                                                                                                 0.00
## TL + coral + boulder                                                                                                              0.00
## wave                                                                                                                              0.00
## TL + coral + boulder + herbivore                                                                                                  0.00
## herbivore                                                                                                                         0.00
## TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom   0.00
## coral + boulder + hard_bottom + soft_bottom                                                                                       0.00
##                                                                                                                                 Cum.Wt
## site_coral + fishing                                                                                                              0.35
## TL + BAA3 + fishing                                                                                                               0.56
## TL + fishing + effluent                                                                                                           0.69
## TL + BAA3                                                                                                                         0.76
## TL + effluent                                                                                                                     0.83
## TL + fishing                                                                                                                      0.90
## site_coral + effluent                                                                                                             0.96
## coral + boulder + TL + BAA3                                                                                                       0.97
## TL + site_coral + herbivore_biomass                                                                                               0.98
## site_coral                                                                                                                        0.98
## herbivore_biomass + fishing                                                                                                       0.99
## BAA3                                                                                                                              0.99
## herbivore + fishing + mean_depth                                                                                                  0.99
## TL + wave                                                                                                                         1.00
## herbivore + BAA3                                                                                                                  1.00
## TL + mean_depth                                                                                                                   1.00
## TL, data                                                                                                                          1.00
## TL + Age                                                                                                                          1.00
## 1                                                                                                                                 1.00
## TL + coral + boulder                                                                                                              1.00
## wave                                                                                                                              1.00
## TL + coral + boulder + herbivore                                                                                                  1.00
## herbivore                                                                                                                         1.00
## TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom   1.00
## coral + boulder + hard_bottom + soft_bottom                                                                                       1.00
##                                                                                                                                     LL
## site_coral + fishing                                                                                                            -41.01
## TL + BAA3 + fishing                                                                                                             -40.44
## TL + fishing + effluent                                                                                                         -40.91
## TL + BAA3                                                                                                                       -42.58
## TL + effluent                                                                                                                   -42.60
## TL + fishing                                                                                                                    -42.64
## site_coral + effluent                                                                                                           -42.80
## coral + boulder + TL + BAA3                                                                                                     -42.22
## TL + site_coral + herbivore_biomass                                                                                             -43.98
## site_coral                                                                                                                      -46.21
## herbivore_biomass + fishing                                                                                                     -45.32
## BAA3                                                                                                                            -46.52
## herbivore + fishing + mean_depth                                                                                                -45.27
## TL + wave                                                                                                                       -46.49
## herbivore + BAA3                                                                                                                -46.51
## TL + mean_depth                                                                                                                 -46.58
## TL, data                                                                                                                        -48.40
## TL + Age                                                                                                                        -48.29
## 1                                                                                                                               -50.73
## TL + coral + boulder                                                                                                            -47.54
## wave                                                                                                                            -49.81
## TL + coral + boulder + herbivore                                                                                                -47.06
## herbivore                                                                                                                       -50.69
## TL + BAA3 + fishing + effluent + herbivore + mean_depth + site_coral + wave + Age + coral + boulder + hard_bottom + soft_bottom -35.66
## coral + boulder + hard_bottom + soft_bottom                                                                                     -49.81

Summaries for all models

model1 <- glm(CTX3 ~ TL + BAA3, family="binomial", data = CTST)
summary(model1)
## 
## Call:
## glm(formula = CTX3 ~ TL + BAA3, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0284  -0.9713   0.5458   0.7650   1.7769  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7249     0.2705   2.680  0.00737 **
## TL           -0.8091     0.3066  -2.639  0.00831 **
## BAA3         -1.1179     0.3633  -3.077  0.00209 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  85.16  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 91.16
## 
## Number of Fisher Scoring iterations: 4
model2 <- glm(CTX3 ~ TL + BAA3 + fishing, family="binomial", data = CTST)
summary(model2)
## 
## Call:
## glm(formula = CTX3 ~ TL + BAA3 + fishing, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.3611  -0.8974   0.4277   0.8113   1.6634  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.8172     0.2972   2.749  0.00597 **
## TL           -0.8022     0.3118  -2.573  0.01009 * 
## BAA3         -0.7766     0.3870  -2.007  0.04478 * 
## fishing      -0.8665     0.4668  -1.857  0.06338 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  80.882  on 75  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 88.882
## 
## Number of Fisher Scoring iterations: 5
model3 <- glm(CTX3 ~ TL + fishing, family="binomial", data = CTST)
summary(model3)
## 
## Call:
## glm(formula = CTX3 ~ TL + fishing, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2820  -1.0491   0.4089   0.9265   1.4920  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.8438     0.2924   2.886  0.00390 **
## TL           -0.6538     0.2938  -2.225  0.02607 * 
## fishing      -1.1706     0.4398  -2.662  0.00777 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  85.28  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 91.28
## 
## Number of Fisher Scoring iterations: 5
model4 = glm(CTX3 ~ TL + fishing + effluent, family="binomial", data = CTST)
summary(model4)
## 
## Call:
## glm(formula = CTX3 ~ TL + fishing + effluent, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9960  -0.9998   0.3629   0.8919   1.5794  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)   0.7512     0.2973   2.527   0.0115 *
## TL           -0.6963     0.3013  -2.311   0.0208 *
## fishing      -0.7818     0.4670  -1.674   0.0941 .
## effluent     -0.9800     0.5484  -1.787   0.0739 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  81.812  on 75  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 89.812
## 
## Number of Fisher Scoring iterations: 5
model5 = glm(CTX3 ~ herbivore + BAA3, family="binomial", data = CTST)
summary(model5)
## 
## Call:
## glm(formula = CTX3 ~ herbivore + BAA3, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0425  -1.0794   0.5812   0.9371   1.2787  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)  0.63368    0.25566   2.479  0.01319 * 
## herbivore   -0.02527    0.22707  -0.111  0.91139   
## BAA3        -0.91719    0.34820  -2.634  0.00844 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  93.019  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 99.019
## 
## Number of Fisher Scoring iterations: 4
model6 = glm(CTX3 ~ TL + effluent, family="binomial", data = CTST)
summary(model6)
## 
## Call:
## glm(formula = CTX3 ~ TL + effluent, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0356  -1.0532   0.4226   0.8735   1.5840  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.6116     0.2690   2.273  0.02300 * 
## TL           -0.6420     0.2931  -2.191  0.02848 * 
## effluent     -1.4113     0.5021  -2.811  0.00494 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  85.20  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 91.2
## 
## Number of Fisher Scoring iterations: 5
model7 = glm(CTX3~ TL + mean_depth, family="binomial", data = CTST)
summary(model7)
## 
## Call:
## glm(formula = CTX3 ~ TL + mean_depth, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2377  -1.1751   0.6480   0.9324   1.5083  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.8143     0.2658   3.063  0.00219 **
## TL           -0.6566     0.2905  -2.260  0.02379 * 
## mean_depth   -0.5807     0.3178  -1.827  0.06767 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  93.151  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 99.151
## 
## Number of Fisher Scoring iterations: 4
model8 = glm(CTX3 ~ coral + boulder + TL + BAA3, family="binomial", data = CTST)
summary(model8)
## 
## Call:
## glm(formula = CTX3 ~ coral + boulder + TL + BAA3, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0112  -0.9598   0.5325   0.7454   1.7844  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7392     0.2772   2.667  0.00766 **
## coral        -0.1802     0.3207  -0.562  0.57421   
## boulder      -0.2405     0.2947  -0.816  0.41444   
## TL           -0.8427     0.3148  -2.677  0.00744 **
## BAA3         -1.0887     0.3669  -2.967  0.00300 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  84.443  on 74  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 94.443
## 
## Number of Fisher Scoring iterations: 4
model9 = glm(CTX3 ~ TL, family="binomial", data = CTST)
summary(model9)
## 
## Call:
## glm(formula = CTX3 ~ TL, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8039  -1.2411   0.7122   0.9433   1.4620  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7450     0.2516    2.96  0.00307 **
## TL           -0.5843     0.2783   -2.10  0.03574 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  96.793  on 77  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 100.79
## 
## Number of Fisher Scoring iterations: 4
model10 = glm(CTX3 ~ TL + coral + boulder + herbivore, family="binomial", data = CTST)
summary(model10)
## 
## Call:
## glm(formula = CTX3 ~ TL + coral + boulder + herbivore, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9624  -1.1984   0.6786   0.9026   1.4617  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)  0.77310    0.26088   2.963  0.00304 **
## TL          -0.74662    0.31069  -2.403  0.01626 * 
## coral       -0.03327    0.32188  -0.103  0.91768   
## boulder     -0.32243    0.29071  -1.109  0.26738   
## herbivore    0.23806    0.24806   0.960  0.33720   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  94.13  on 74  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 104.13
## 
## Number of Fisher Scoring iterations: 4
model11 = glm(CTX3 ~ TL + wave, family="binomial", data = CTST)
summary(model11)
## 
## Call:
## glm(formula = CTX3 ~ TL + wave, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9537  -1.1249   0.6520   0.9081   1.6267  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7600     0.2591   2.934  0.00335 **
## TL           -0.7440     0.3044  -2.444  0.01452 * 
## wave          0.5218     0.2779   1.878  0.06042 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  92.986  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 98.986
## 
## Number of Fisher Scoring iterations: 4
model12 = glm(CTX3 ~ TL + Age, family="binomial", data = CTST)
summary(model12)
## 
## Call:
## glm(formula = CTX3 ~ TL + Age, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8243  -1.2509   0.7092   0.9382   1.4356  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7420     0.2523   2.941  0.00327 **
## TL           -0.5170     0.3120  -1.657  0.09749 . 
## Age          -0.1418     0.3021  -0.469  0.63873   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  96.575  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 102.57
## 
## Number of Fisher Scoring iterations: 4
model13 = glm(CTX3 ~ TL + coral + boulder, family="binomial", data = CTST)
summary(model13)
## 
## Call:
## glm(formula = CTX3 ~ TL + coral + boulder, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8864  -1.1349   0.6945   0.9075   1.5147  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7846     0.2594   3.025  0.00249 **
## TL           -0.6501     0.2886  -2.252  0.02429 * 
## coral        -0.1315     0.3044  -0.432  0.66577   
## boulder      -0.3572     0.2850  -1.253  0.21007   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  95.077  on 75  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 103.08
## 
## Number of Fisher Scoring iterations: 4
model14 = glm(CTX3 ~ TL + site_coral + herbivore, family="binomial", data = CTST)
summary(model14)
## 
## Call:
## glm(formula = CTX3 ~ TL + site_coral + herbivore, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2128  -1.2298   0.6406   0.8811   1.3963  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)   0.6598     0.2787   2.367   0.0179 *
## TL           -0.6463     0.3180  -2.032   0.0421 *
## site_coral    1.2291     0.5925   2.074   0.0381 *
## herbivore     0.1014     0.2385   0.425   0.6707  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  87.954  on 75  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 95.954
## 
## Number of Fisher Scoring iterations: 5
model15 = glm(CTX3 ~  BAA3, family="binomial", data = CTST)
summary(model15)
## 
## Call:
## glm(formula = CTX3 ~ BAA3, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0525  -1.0707   0.5907   0.9245   1.2880  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.6288     0.2515   2.500  0.01241 * 
## BAA3         -0.9106     0.3422  -2.661  0.00779 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  93.032  on 77  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 97.032
## 
## Number of Fisher Scoring iterations: 3
model16 = glm(CTX3 ~ herbivore + fishing, family="binomial", data = CTST)
summary(model16)
## 
## Call:
## glm(formula = CTX3 ~ herbivore + fishing, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2867  -1.1571   0.5431   0.9395   1.3014  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.7044     0.2749   2.562  0.01040 * 
## herbivore     0.0242     0.2331   0.104  0.91732   
## fishing      -1.0209     0.3926  -2.600  0.00933 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  90.633  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 96.633
## 
## Number of Fisher Scoring iterations: 5
model17 = glm(CTX3 ~ site_coral + fishing, family="binomial", data = CTST)
summary(model17)
## 
## Call:
## glm(formula = CTX3 ~ site_coral + fishing, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.3100  -1.1291   0.4813   0.8567   1.3308  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.5543     0.3078   1.801  0.07172 . 
## site_coral    1.4052     0.7148   1.966  0.04932 * 
## fishing      -1.0658     0.4119  -2.587  0.00968 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  82.01  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 88.01
## 
## Number of Fisher Scoring iterations: 5
model18 = glm(CTX3 ~ herbivore + fishing + mean_depth, family="binomial", data = CTST)
summary(model18)
## 
## Call:
## glm(formula = CTX3 ~ herbivore + fishing + mean_depth, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2898  -1.1494   0.5482   0.9397   1.3486  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  0.72109    0.28123   2.564   0.0103 *
## herbivore   -0.01531    0.26687  -0.057   0.9542  
## fishing     -0.98973    0.40825  -2.424   0.0153 *
## mean_depth  -0.10583    0.34684  -0.305   0.7603  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  90.539  on 75  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 98.539
## 
## Number of Fisher Scoring iterations: 5
model19 = glm(CTX3 ~ coral + boulder + hard_bottom + soft_bottom, family="binomial", data = CTST)
summary(model19)
## 
## Call:
## glm(formula = CTX3 ~ coral + boulder + hard_bottom + soft_bottom, 
##     family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7334  -1.2672   0.8516   0.8777   1.3046  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept)  0.18232    0.60553   0.301    0.763
## coral       -0.11315    0.29958  -0.378    0.706
## boulder     -0.26309    0.27805  -0.946    0.344
## hard_bottom -5.72108    6.47606  -0.883    0.377
## soft_bottom -0.09371    0.20831  -0.450    0.653
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  99.61  on 74  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 109.61
## 
## Number of Fisher Scoring iterations: 4
model20 = glm(CTX3 ~ site_coral + effluent, family="binomial", data = CTST)
summary(model20)
## 
## Call:
## glm(formula = CTX3 ~ site_coral + effluent, family = "binomial", 
##     data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.1343  -1.3583   0.4974   0.9531   1.0067  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)   0.3233     0.3229   1.001    0.317  
## site_coral    1.2487     0.8028   1.555    0.120  
## effluent     -1.2181     0.5473  -2.226    0.026 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  85.597  on 76  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 91.597
## 
## Number of Fisher Scoring iterations: 6
model21 = glm(CTX3 ~ site_coral, family="binomial", data = CTST)
summary(model21)
## 
## Call:
## glm(formula = CTX3 ~ site_coral, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8921  -1.4713   0.8603   0.9096   0.9096  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)   0.5786     0.2618   2.210   0.0271 *
## site_coral    1.2189     0.5531   2.204   0.0275 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  92.413  on 77  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 96.413
## 
## Number of Fisher Scoring iterations: 4
model22 = glm(CTX3 ~ herbivore, family="binomial", data = CTST)
summary(model22)
## 
## Call:
## glm(formula = CTX3 ~ herbivore, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5044  -1.4351   0.8825   0.9399   0.9399  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)  0.64594    0.23907   2.702  0.00689 **
## herbivore    0.06379    0.21158   0.301  0.76305   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance: 101.38  on 77  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 105.38
## 
## Number of Fisher Scoring iterations: 4
model23 = glm(CTX3 ~ wave, family="binomial", data = CTST)
summary(model23)
## 
## Call:
## glm(formula = CTX3 ~ wave, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7821  -1.3491   0.7925   1.0109   1.0150  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.6510     0.2402   2.710  0.00672 **
## wave          0.3451     0.2603   1.326  0.18494   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance:  99.63  on 77  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 103.63
## 
## 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 = CTST)
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 = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0058  -0.7644   0.2950   0.7580   1.8163  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)  
## (Intercept)  0.27337    1.01368   0.270   0.7874  
## TL          -1.00191    0.43194  -2.320   0.0204 *
## BAA3        -0.46293    0.48859  -0.947   0.3434  
## fishing     -0.85276    0.68529  -1.244   0.2134  
## effluent    -1.08272    1.19833  -0.904   0.3662  
## herbivore    0.18874    0.63296   0.298   0.7656  
## mean_depth   0.44625    0.58527   0.762   0.4458  
## site_coral   1.58342    1.29745   1.220   0.2223  
## wave         0.25800    0.81770   0.316   0.7524  
## Age          0.14648    0.38768   0.378   0.7056  
## coral        0.27709    0.43017   0.644   0.5195  
## boulder     -0.09633    0.35855  -0.269   0.7882  
## hard_bottom -1.72563   10.71512  -0.161   0.8721  
## soft_bottom -0.27337    0.37262  -0.734   0.4632  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.468  on 78  degrees of freedom
## Residual deviance:  71.312  on 65  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 99.312
## 
## Number of Fisher Scoring iterations: 7
model25 = glm(CTX3~1, family="binomial", data = CTST)
summary(model25)
## 
## Call:
## glm(formula = CTX3 ~ 1, family = "binomial", data = CTST)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.4653  -1.4653   0.9145   0.9145   0.9145  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)   0.6554     0.2372   2.763  0.00573 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 101.47  on 78  degrees of freedom
## Residual deviance: 101.47  on 78  degrees of freedom
##   (30 observations deleted due to missingness)
## AIC: 103.47
## 
## Number of Fisher Scoring iterations: 4