R Code for GCB-19-1650.R1
rm(list = ls()) # Remove all objects from memory
library(ggplot2)
library(gridExtra)
ENSO_colours<-c("blue", "red") # Type of anomaly
my_colours<-c("#feb24c93", "#fb6a4a93", "#9e9ac893", "#a6d96a93") # Thermal regime
theme_set (theme_classic() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_line(colour = "black"),
legend.position="none",
axis.text.x = element_text(angle = 90, vjust = 0.5),
plot.title = element_text(size=12, face="bold"),
#panel.border = element_rect(colour = "black", fill=NA, size=1)
panel.border = element_blank()
))
# Plot ENOS 1971 - 2014
ENOS<-read.table(file="http://www.cpc.ncep.noaa.gov/data/indices/ersst5.nino.mth.81-10.ascii",header=TRUE)
ENOS1982_2014 <-subset(ENOS, YR>1968 & YR<2015) # subset from 1970-2014
ENOS1982_2014$Date<-paste(ENOS1982_2014$YR, ENOS1982_2014$MON, sep = "-" )
ENOS1982_2014$Date<-paste(ENOS1982_2014$Date, "15", sep = "-" )
ENOS1982_2014$Date<-as.Date(ENOS1982_2014$Date, format = "%Y-%m-%d")
ENOS1982_2014$Anomaly <- factor(ifelse(ENOS1982_2014$ANOM.3 >=0, "Positive", "Negative"))
interp <- approx(ENOS1982_2014$Date, ENOS1982_2014$ANOM.3, n=10000)
DataENSO <- data.frame(Date=interp$x, Anomaly3=interp$y)
DataENSO$Anomaly <- factor(ifelse(DataENSO$Anomaly3>=0, "Positive", "Negative"))
ENSO<-ggplot(data=DataENSO, aes(x=Date, y=Anomaly3))+
scale_x_continuous("",expand=c(0, 0))+
scale_y_continuous("SST anomaly (ºC) in Niño.3",expand=c(0, 0))+
geom_area(aes(fill=Anomaly), alpha=0.7)+
scale_fill_manual(values=ENSO_colours) + labs(title="a")+
geom_hline(yintercept=0, linetype="solid", color="black")+
geom_line(position = "identity", size=0.3)+
theme(axis.text.x=element_blank(),
axis.title.x=element_blank(),
axis.ticks.x = element_blank())+
annotate("text", x = 1900, y = 2.0, label = "El Niño \n72-73", size=3)+
annotate("text", x = 5600, y = 2.0, label = "El Niño \n82-83", size=3)+
annotate("text", x = 11100, y = 2.0, label = "El Niño \n97-98", size=3)
ENSO
# ENSOb<-ggplot(data=ENOS1982_2014, aes(x=Date, y=ANOM.3))+
# geom_hline(yintercept=0, linetype="solid", color="black")+
# scale_x_date("", limit=c(as.Date("1969-01-15"), as.Date("2014-12-31")),
# breaks= "12 months",
# expand=c(0, 0))+
# scale_y_continuous("SST anomaly (ºC) in Niño.3",expand=c(0, 0))+
# geom_area(aes(fill=Anomaly))+
# geom_line(position = "identity")+
# scale_fill_manual(values=ENSO_colours) + labs(title="(a)")
# ENSOb
# Select data
cover <- read.csv("Data/Coral_Cover_ETP.csv", header=TRUE) # Select file: Coral_Cover_ETP.csv
# Convert to numeric variable the response variable and convert to nominal variables the factors
cover$Coral_cover <- as.numeric(cover$Coral_cover) # convert to numeric variable
cover$Region <- as.factor(cover$Region) # convert to nominal factors
cover$Location <- as.factor(cover$Location)
cover$Site <- as.factor(cover$Site)
cover$Country <- as.factor(cover$Country)
cover$Thermal_regime <- factor(cover$Thermal_regime,
levels=c("Thermally_Stable", "Upwelling", "Galapagos_Islands","Seasonal"),
labels=c("Thermally stable", "Tropical upwelling", "Equatorial upwelling","Seasonal"))
cover$Lat <- as.numeric(cover$Lat)
cover$Lon <- as.numeric(cover$Lon)
cover$Year <- as.numeric(cover$Year)
#cover$Year <- as.numeric((cover$Year)-1970) # transform years to begin in 0
summary(cover)
## ID1 Reference Province
## Min. : 1.0 Fong, 2017 : 33 Cortezian : 10
## 1st Qu.:144.2 Glynn, 1983 : 31 Galapagos : 61
## Median :285.5 Calderón-Aguilera, 2006: 26 Tropical_East_Pacific:495
## Mean :285.1 Glynn, 1990 : 24
## 3rd Qu.:426.8 Guzman, 2004 : 24
## Max. :568.0 Cortés, 2010 : 23
## (Other) :405
## Ecoregion Region
## Nicoya :238 Gulf_of_Chiriqui :121
## Panama_Bight :117 Colombia : 75
## Cortezian : 71 Mexican_Central : 72
## Mexican_Tropical_Pacific : 50 Costa_Rica_Southern : 68
## Eastern_Galapagos_Islands : 31 Nicaragua_Papagayo_Zone: 49
## Northern_Galapagos_Islands: 28 Panama_Bight : 42
## (Other) : 31 (Other) :139
## Country Platform Thermal_regime
## Panama :163 Continental:470 Thermally stable :250
## Costa_Rica:131 Oceanic : 96 Tropical upwelling :177
## Mexico :123 Equatorial upwelling: 61
## Colombia : 75 Seasonal : 78
## Ecuador : 61
## Nicaragua : 11
## (Other) : 2
## Location Site Year Date
## Gulf_of_Chiriqui:121 Uva_Island : 67 Min. :1970 01/01/09: 55
## Gorgona_Island : 56 La_Azufrada : 29 1st Qu.:1987 01/01/06: 32
## Panama_Bight : 42 Cano_island : 27 Median :1999 01/01/02: 31
## Bahia_Banderas : 33 Gorgona_Island: 26 Mean :1997 01/01/03: 31
## Gulf_of_Papagayo: 30 Saboga_Island : 24 3rd Qu.:2006 01/01/97: 26
## Los_Cabos : 28 Cabo_Pulmo : 17 Max. :2014 01/01/98: 22
## (Other) :256 (Other) :376 (Other) :369
## Period_ENOS Coral_cover Algal_cover Lat
## 1971-1972: 24 Min. : 0.000 Min. : 0.00 Min. :-1.352
## 1973-1982: 59 1st Qu.: 8.422 1st Qu.: 0.00 1st Qu.: 5.551
## 1983-1997:170 Median :25.000 Median : 3.49 Median : 8.578
## 1998-2016:313 Mean :29.176 Mean :14.78 Mean : 9.499
## 3rd Qu.:45.725 3rd Qu.:20.50 3rd Qu.:10.791
## Max. :95.720 Max. :94.74 Max. :25.796
## NA's :390
## Lon
## Min. :-111.23
## 1st Qu.: -91.82
## Median : -83.87
## Mean : -87.92
## 3rd Qu.: -81.75
## Max. : -77.34
##
# Aggregate by site
aggr.site <- aggregate(Coral_cover ~ Year+Region+Location+Site+Period_ENOS+Thermal_regime,FUN=mean,data=cover)
# Aggregate by location
aggr.location <- aggregate(Coral_cover~Year+Region+Location+Period_ENOS+Thermal_regime,FUN=mean,data=aggr.site)
# Aggregate by region
aggr.region <- aggregate(Coral_cover~Year+Region+Period_ENOS+Thermal_regime,FUN=mean,data=aggr.location)
# Create groups for each of three ENSO time-intervals
ENSO.73_82 <- subset(aggr.region, Period_ENOS == "1973-1982")
ENSO.83_97 <- subset(aggr.region, Period_ENOS == "1983-1997")
ENSO.98_14 <- subset(aggr.region, Period_ENOS == "1998-2016")
# Exclude regions with cero and only one observation of coral cover per time-interval
ENSO.83_97<- ENSO.83_97[!ENSO.83_97$Region == "Costa_Rica_Central", ]
ENSO.83_97<- ENSO.83_97[!ENSO.83_97$Region == "El_Salvador", ]
ENSO.83_97<- ENSO.83_97[!ENSO.83_97$Region == "Western_Galapagos_Islands", ]
ENSO.83_97<- ENSO.83_97[!ENSO.83_97$Region == "Clipperton", ]
ENSO.83_97<- ENSO.83_97[!ENSO.83_97$Region == "Mexican_Southern", ]
ENSO.83_97<- ENSO.83_97[!ENSO.83_97$Region == "Northern_Galapagos_Islands", ]
ENSO.98_14<- ENSO.98_14[!ENSO.98_14$Region == "Clipperton", ]
ENSO.98_14<- ENSO.98_14[!ENSO.98_14$Region == "El_Salvador", ]
ENSO.98_14<- ENSO.98_14[!ENSO.98_14$Region == "Western_Galapagos_Islands", ]
ENSO.98_14<- ENSO.98_14[!ENSO.98_14$Region == "Revillagigedo_Islands", ]
ENSO.83_14 <- rbind(ENSO.83_97,ENSO.98_14) # Second and third time intervals
ENSO.73_14 <- rbind(ENSO.73_82,ENSO.83_14) # First, second and third time intervals
ENSO.73_97 <- rbind(ENSO.73_82,ENSO.83_97) # First and second and time intervals
library(nlme)
# All years 1970_2014
model1 <- lme(
Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region, data=aggr.region)
summary(model1)
## Linear mixed-effects model fit by REML
## Data: aggr.region
## AIC BIC logLik
## 1738.944 1771.674 -859.4718
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 12.54525 16.63903
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -376.2818 380.1376 182 -0.9898568
## Thermal_regimeTropical upwelling -318.4932 374.3531 14 -0.8507829
## Thermal_regimeEquatorial upwelling 231.1346 577.6963 14 0.4000970
## Thermal_regimeSeasonal 1037.2282 848.9022 182 1.2218466
## Year 0.2004 0.1901 182 1.0539580
## Thermal_regimeTropical upwelling:Year -0.0244 0.2668 182 -0.0913128
## Thermal_regimeEquatorial upwelling:Year -0.3069 0.3460 182 -0.8869674
## Thermal_regimeSeasonal:Year -0.7035 0.4622 182 -1.5220165
## p-value
## Thermal_regimeThermally stable 0.3236
## Thermal_regimeTropical upwelling 0.4092
## Thermal_regimeEquatorial upwelling 0.6951
## Thermal_regimeSeasonal 0.2233
## Year 0.2933
## Thermal_regimeTropical upwelling:Year 0.9273
## Thermal_regimeEquatorial upwelling:Year 0.3763
## Thermal_regimeSeasonal:Year 0.1297
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Thrm_S Year
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Thermal_regimeSeasonal 0.014 0.000 0.000
## Year -1.000 0.000 0.000 -0.015
## Thermal_regimeTropical upwelling:Year 0.713 -0.701 0.000 0.010 -0.713
## Thermal_regimeEquatorial upwelling:Year 0.550 0.000 -0.835 0.008 -0.550
## Thermal_regimeSeasonal:Year 0.398 0.000 0.000 -0.912 -0.397
## T_Tu:Y T_Eu:Y
## Thermal_regimeTropical upwelling
## Thermal_regimeEquatorial upwelling
## Thermal_regimeSeasonal
## Year
## Thermal_regimeTropical upwelling:Year
## Thermal_regimeEquatorial upwelling:Year 0.392
## Thermal_regimeSeasonal:Year 0.283 0.218
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.27961285 -0.68775802 -0.01799739 0.62536545 3.07507316
##
## Number of Observations: 203
## Number of Groups: 16
anova(model1)
plot(ranef(model1)) # shows symmetrical scatter effects around zero
plot(model1) # plot residuals vs fitted
resnorm1 <- resid(model1)
hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
coef.m1 <- as.data.frame(coef(summary(model1))) # Coefficients of the model
plot(model1, resid(., type = "p") ~ fitted(.) | Region, abline = 0)
plot(model1, Coral_cover ~ fitted(.) | Region, abline = c(0,1))
plot(model1, Coral_cover ~ fitted(.) | Thermal_regime, abline = c(0,1))
plot(model1, Coral_cover ~ fitted(.), abline = c(0,1))
#Using raw data (Only thermal regime is significant in model)
Model1_plot <- ggplot(aggr.region, aes(x=Year, y=Coral_cover)) +
geom_boxplot(aes(group=Year), outlier.shape = NA) +
stat_boxplot(aes(group=Year), geom = 'errorbar')+
geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
geom_smooth(span = 0.2, se=T, colour="darkgray")+
#geom_point(aes(colour=Thermal_regime), alpha=0.5) + ylim(0,79) +
scale_y_continuous("Live coral cover (%)", limits = c(-2, 80), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))+
scale_color_manual(values=my_colours) + labs(title="b")+
#annotate("text", x = 1983, y = 70, label = "*", size=8)+
annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1972, xmax = 1973, ymin = 0, ymax = 80, alpha = .2, fill="red")
Model1_plot
# Time-interval 1 - ENSO.73_82
model2 <- lme(Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region, data=ENSO.73_82)
summary(model2)
## Linear mixed-effects model fit by REML
## Data: ENSO.73_82
## AIC BIC logLik
## 164.1606 170.3413 -74.08028
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 20.41735 11.16916
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -1056.718 2780.291 4 -0.3800747
## Thermal_regimeTropical upwelling -8301.110 3522.652 4 -2.3564943
## Thermal_regimeEquatorial upwelling -3320.683 3401.869 4 -0.9761347
## Year 0.547 1.405 13 0.3894090
## Thermal_regimeTropical upwelling:Year 3.664 2.268 13 1.6156304
## Thermal_regimeEquatorial upwelling:Year 1.142 2.220 13 0.5145773
## p-value
## Thermal_regimeThermally stable 0.7232
## Thermal_regimeTropical upwelling 0.0780
## Thermal_regimeEquatorial upwelling 0.3843
## Year 0.7033
## Thermal_regimeTropical upwelling:Year 0.1302
## Thermal_regimeEquatorial upwelling:Year 0.6155
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Year T_Tu:Y
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Year -1.000 0.000 0.000
## Thermal_regimeTropical upwelling:Year 0.619 -0.785 0.000 -0.619
## Thermal_regimeEquatorial upwelling:Year 0.633 0.000 -0.774 -0.633 0.392
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -1.4753081 -0.4669789 -0.2416621 0.4616212 1.8992737
##
## Number of Observations: 22
## Number of Groups: 7
anova(model2)
plot(ranef(model2))
plot(model2)
resnorm2 <- resid(model2)
hist(resnorm2, xlab = "Residuals", main = "")
coef.m2 <- as.data.frame(coef(summary(model2)))
plot(model2, resid(., type = "p") ~ fitted(.) | Region, abline = 0)
plot(model2, Coral_cover ~ fitted(.) | Region, abline = c(0,1))
plot(model2, Coral_cover ~ fitted(.) | Thermal_regime, abline = c(0,1))
Note that this first time interval has low number of regions at each year, even the GLMM model is adjusted, please warning with interpretation/generalization of results
#Using raw data (the model is not significant)
Model2_plot <- ggplot(ENSO.73_82, aes(x=Year, y=Coral_cover, colour=Thermal_regime)) +
geom_smooth(method = lm, se=FALSE, linetype = "dashed", alpha=1, size=2)+
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2, stroke = 0.3, alpha=0.5) +
scale_y_continuous("Live coral cover (%)", limits = c(0, 80))+
scale_x_continuous("", limits = c(1973.7, 1982.3),
breaks = seq(1974, 1982, by=2), expand = c(0.02,0.02))+
scale_fill_manual(values=my_colours) +
scale_colour_manual(values=my_colours)+
labs(title="c")
Model2_plot
# Time-interval 3 - ENSO.83_97
model3 <- lme(Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region, data=ENSO.83_97)
summary(model3)
## Linear mixed-effects model fit by REML
## Data: ENSO.83_97
## AIC BIC logLik
## 483.7777 504.3822 -231.8889
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 5.569614 9.545465
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -2032.426 887.6391 51 -2.289699
## Thermal_regimeTropical upwelling -7027.188 875.9396 8 -8.022457
## Thermal_regimeEquatorial upwelling 111.787 2773.6282 8 0.040303
## Thermal_regimeSeasonal 6027.933 1928.4786 51 3.125745
## Year 1.028 0.4459 51 2.305577
## Thermal_regimeTropical upwelling:Year 2.523 0.6263 51 4.027952
## Thermal_regimeEquatorial upwelling:Year -1.084 1.4648 51 -0.740033
## Thermal_regimeSeasonal:Year -4.038 1.0594 51 -3.811622
## p-value
## Thermal_regimeThermally stable 0.0262
## Thermal_regimeTropical upwelling 0.0000
## Thermal_regimeEquatorial upwelling 0.9688
## Thermal_regimeSeasonal 0.0029
## Year 0.0252
## Thermal_regimeTropical upwelling:Year 0.0002
## Thermal_regimeEquatorial upwelling:Year 0.4627
## Thermal_regimeSeasonal:Year 0.0004
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Thrm_S Year
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Thermal_regimeSeasonal 0.015 0.000 0.000
## Year -1.000 0.000 0.000 -0.015
## Thermal_regimeTropical upwelling:Year 0.712 -0.702 0.000 0.011 -0.712
## Thermal_regimeEquatorial upwelling:Year 0.304 0.000 -0.953 0.005 -0.304
## Thermal_regimeSeasonal:Year 0.407 0.000 0.000 -0.907 -0.407
## T_Tu:Y T_Eu:Y
## Thermal_regimeTropical upwelling
## Thermal_regimeEquatorial upwelling
## Thermal_regimeSeasonal
## Year
## Thermal_regimeTropical upwelling:Year
## Thermal_regimeEquatorial upwelling:Year 0.217
## Thermal_regimeSeasonal:Year 0.290 0.124
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.98895841 -0.44529472 -0.05761071 0.48058455 3.08249147
##
## Number of Observations: 66
## Number of Groups: 10
anova(model3)
plot(ranef(model3))
plot(model3)
resnorm3 <- resid(model3)
hist(resnorm3, xlab = "Residuals", main = "")
coef.m3 <- as.data.frame(coef(summary(model3)))
plot(model3, resid(., type = "p") ~ fitted(.) | Region, abline = 0)
plot(model3, Coral_cover ~ fitted(.) | Region, abline = c(0,1))
plot(model3, Coral_cover ~ fitted(.) | Thermal_regime, abline = c(0,1))
# Create a new data frame for independent variables
NewData_3 <- expand.grid(Thermal_regime=unique(ENSO.83_97$Thermal_regime),
#Region=unique(aggr.region$Region),
Year=seq((min(ENSO.83_97$Year)), (max(ENSO.83_97$Year))))
pred_3 <- predict(model3, newdata=NewData_3, level=0, asList = FALSE)
# Using model data
Model3b_plot <- ggplot(ENSO.83_97, aes(x=Year, y=Coral_cover, colour=Thermal_regime)) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2, stroke = 0.3, alpha=0.5) +
scale_y_continuous(" ", limits = c(0, 80))+
scale_x_continuous("", limits = c(1982.7, 1997.3),
breaks = seq(1983, 1997, by=2), expand = c(0.02,0.02))+
geom_line(data=NewData_3,
aes(y=predict(model3, level=0, newdata=NewData_3)), size=2) +
theme(axis.text.y=element_blank(),
axis.title.y=element_blank(),
legend.position = c(0.58, -0.4),
legend.title=element_blank(),
legend.text=element_text(size=6),
legend.box ="horizontal")+
guides(col = guide_legend(nrow = 2))+
scale_fill_manual(values=my_colours) +
scale_colour_manual(values=my_colours)+
labs(title="d")
Model3b_plot
# Time-interval 4 - ENSO.98_14
model4 <- lme(Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region, data=ENSO.98_14)
summary(model4)
## Linear mixed-effects model fit by REML
## Data: ENSO.98_14
## AIC BIC logLik
## 868.373 894.0165 -424.1865
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 11.85156 15.42641
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -1874.3025 1407.6188 87 -1.3315413
## Thermal_regimeTropical upwelling 3051.8828 1065.1174 10 2.8653018
## Thermal_regimeEquatorial upwelling -1924.1502 2899.4700 10 -0.6636213
## Thermal_regimeSeasonal 246.7127 1590.2201 87 0.1551437
## Year 0.9478 0.7020 87 1.3502008
## Thermal_regimeTropical upwelling:Year -2.4517 0.8800 87 -2.7859220
## Thermal_regimeEquatorial upwelling:Year 0.0238 1.6068 87 0.0147957
## Thermal_regimeSeasonal:Year -1.0540 1.0543 87 -0.9997429
## p-value
## Thermal_regimeThermally stable 0.1865
## Thermal_regimeTropical upwelling 0.0168
## Thermal_regimeEquatorial upwelling 0.5219
## Thermal_regimeSeasonal 0.8771
## Year 0.1805
## Thermal_regimeTropical upwelling:Year 0.0066
## Thermal_regimeEquatorial upwelling:Year 0.9882
## Thermal_regimeSeasonal:Year 0.3202
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Thrm_S Year
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Thermal_regimeSeasonal 0.008 0.000 0.000
## Year -1.000 0.000 0.000 -0.008
## Thermal_regimeTropical upwelling:Year 0.798 -0.603 0.000 0.006 -0.798
## Thermal_regimeEquatorial upwelling:Year 0.437 0.000 -0.900 0.003 -0.437
## Thermal_regimeSeasonal:Year 0.660 0.000 0.000 -0.747 -0.659
## T_Tu:Y T_Eu:Y
## Thermal_regimeTropical upwelling
## Thermal_regimeEquatorial upwelling
## Thermal_regimeSeasonal
## Year
## Thermal_regimeTropical upwelling:Year
## Thermal_regimeEquatorial upwelling:Year 0.348
## Thermal_regimeSeasonal:Year 0.526 0.288
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -1.967177096 -0.513186415 0.003076624 0.290360208 2.709123861
##
## Number of Observations: 104
## Number of Groups: 12
anova(model4)
plot(ranef(model4))
plot(model4)
resnorm4 <- resid(model4)
hist(resnorm4, xlab = "Residuals", main = "")
coef.m4 <- as.data.frame(coef(summary(model4)))
plot(model4, resid(., type = "p") ~ fitted(.) | Region, abline = 0)
plot(model4, Coral_cover ~ fitted(.) | Region, abline = c(0,1))
plot(model4, Coral_cover ~ fitted(.) | Thermal_regime, abline = c(0,1))
# Competing model with autocorrelation structure
model4b <- lme(Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region,
data=ENSO.98_14, correlation=corCompSymm(form=~Year|Region))
anova(model4, model4b) # ~ same results
# Create a new data frame for independent variables
NewData_4 <- expand.grid(Thermal_regime=unique(ENSO.98_14$Thermal_regime),
#Region=unique(aggr.region$Region),
Year=seq((min(ENSO.98_14$Year)), (max(ENSO.98_14$Year))))
pred_4 <- predict(model4, newdata=NewData_4, level=0)
#summary(pred)
#length(pred)
# Using model data
Model4b_plot <- ggplot(ENSO.98_14, aes(x=Year, y=Coral_cover, colour=Thermal_regime)) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2, stroke = 0.3, alpha=0.5) +
scale_y_continuous(" ", limits = c(0, 80))+
scale_x_continuous("", limits = c(1997.7, 2014.3),
breaks = seq(1998, 2014, by=2), expand = c(0.02,0.02))+
geom_line(data=NewData_4, aes(y=predict(model4, level=0, newdata=NewData_4)), size=2)+
theme(axis.text.y=element_blank(), axis.title.y=element_blank())+
scale_fill_manual(values=my_colours) +
scale_colour_manual(values=my_colours)+
labs(title="e")
Model4b_plot
# Time-interval 5 - ENSO.83_14
model5 <- lme(Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region, data=ENSO.83_14)
summary(model5)
## Linear mixed-effects model fit by REML
## Data: ENSO.83_14
## AIC BIC logLik
## 1432.659 1463.535 -706.3297
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 12.62187 15.52264
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -1793.0711 516.0356 152 -3.474704
## Thermal_regimeTropical upwelling 34.1625 508.9543 11 0.067123
## Thermal_regimeEquatorial upwelling -1344.4947 910.8505 11 -1.476087
## Thermal_regimeSeasonal 1031.1773 794.8508 152 1.297322
## Year 0.9076 0.2579 152 3.518829
## Thermal_regimeTropical upwelling:Year -0.9076 0.3621 152 -2.506451
## Thermal_regimeEquatorial upwelling:Year -0.2250 0.5229 152 -0.430283
## Thermal_regimeSeasonal:Year -1.4074 0.4701 152 -2.994006
## p-value
## Thermal_regimeThermally stable 0.0007
## Thermal_regimeTropical upwelling 0.9477
## Thermal_regimeEquatorial upwelling 0.1680
## Thermal_regimeSeasonal 0.1965
## Year 0.0006
## Thermal_regimeTropical upwelling:Year 0.0132
## Thermal_regimeEquatorial upwelling:Year 0.6676
## Thermal_regimeSeasonal:Year 0.0032
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Thrm_S Year
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Thermal_regimeSeasonal 0.015 0.000 0.000
## Year -1.000 0.000 0.000 -0.016
## Thermal_regimeTropical upwelling:Year 0.712 -0.702 0.000 0.011 -0.712
## Thermal_regimeEquatorial upwelling:Year 0.493 0.000 -0.870 0.008 -0.493
## Thermal_regimeSeasonal:Year 0.536 0.000 0.000 -0.836 -0.535
## T_Tu:Y T_Eu:Y
## Thermal_regimeTropical upwelling
## Thermal_regimeEquatorial upwelling
## Thermal_regimeSeasonal
## Year
## Thermal_regimeTropical upwelling:Year
## Thermal_regimeEquatorial upwelling:Year 0.351
## Thermal_regimeSeasonal:Year 0.381 0.264
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.4907383 -0.4932930 -0.1009603 0.4709564 3.0676632
##
## Number of Observations: 170
## Number of Groups: 13
anova(model5)
plot(ranef(model5))
plot(model5)
resnorm5 <- resid(model5)
hist(resnorm5, xlab = "Residuals", main = "")
coef.m5 <- as.data.frame(coef(summary(model5)))
plot(model5, resid(., type = "p") ~ fitted(.) | Region, abline = 0)
plot(model5, Coral_cover ~ fitted(.) | Region, abline = c(0,1))
plot(model5, Coral_cover ~ fitted(.) | Thermal_regime, abline = c(0,1))
# Create a new data frame for independent variables
NewData_5 <- expand.grid(Thermal_regime=unique(ENSO.83_14$Thermal_regime),
#Region=unique(aggr.region$Region),
Year=seq((min(ENSO.83_14$Year)), (max(ENSO.83_14$Year))))
pred_5 <- predict(model5, newdata=NewData_5, level=0) # level zero=population predictions
# Using model data
Model5b_plot <- ggplot(ENSO.83_14, aes(x=Year, y=Coral_cover, colour=Thermal_regime)) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2, stroke = 0.3, alpha=0.5) +
scale_y_continuous("Live coral cover (%)", limits = c(0, 80))+
scale_x_continuous("", limits = c(1982.7, 2014.3),
breaks = seq(1983, 2014, by=2), expand = c(0.02,0.02))+
geom_line(data=NewData_5, aes(y=predict(model5, level=0, newdata=NewData_5)), size=2)+
theme(axis.text.y=element_blank(),
axis.title.y=element_blank(),
legend.position = "right",
legend.title=element_blank(),
legend.text=element_text(size=6),
legend.direction="vertical")+
scale_fill_manual(values=my_colours) +
scale_colour_manual(values=my_colours)+
labs(title="Model 5")
Model5b_plot
library(multcomp)
library(lme4)
ENSO.73_97$Year_F <- as.factor(ENSO.73_97$Year)
comp_years_ENSO.73_97 <- aov(Coral_cover ~ Year_F + Thermal_regime, data = ENSO.73_97)
m.comp_ENSO.73_97 <- glht(comp_years_ENSO.73_97, linfct = mcp(Year_F = "Tukey"))
summary(m.comp_ENSO.73_97, test = univariate())
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: Tukey Contrasts
##
##
## Fit: aov(formula = Coral_cover ~ Year_F + Thermal_regime, data = ENSO.73_97)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(>|t|)
## 1975 - 1974 == 0 -4.47130 12.39135 -0.361 0.719486
## 1976 - 1974 == 0 12.03291 13.92901 0.864 0.391098
## 1977 - 1974 == 0 4.96239 17.72786 0.280 0.780501
## 1978 - 1974 == 0 -20.66145 13.98685 -1.477 0.144851
## 1979 - 1974 == 0 12.55655 13.98685 0.898 0.372913
## 1980 - 1974 == 0 3.09738 12.55008 0.247 0.805904
## 1981 - 1974 == 0 11.38572 17.72786 0.642 0.523157
## 1982 - 1974 == 0 9.89230 11.09820 0.891 0.376306
## 1983 - 1974 == 0 -26.42818 12.56543 -2.103 0.039646 *
## 1984 - 1974 == 0 -17.00037 11.61040 -1.464 0.148349
## 1985 - 1974 == 0 -5.67990 14.11092 -0.403 0.688733
## 1986 - 1974 == 0 -16.42371 11.61040 -1.415 0.162364
## 1987 - 1974 == 0 -7.02815 10.55410 -0.666 0.508017
## 1988 - 1974 == 0 -6.08089 11.83018 -0.514 0.609129
## 1989 - 1974 == 0 -9.59011 10.80724 -0.887 0.378419
## 1990 - 1974 == 0 -9.62428 17.72786 -0.543 0.589217
## 1991 - 1974 == 0 3.56532 13.06949 0.273 0.785946
## 1992 - 1974 == 0 -1.17016 10.92692 -0.107 0.915075
## 1993 - 1974 == 0 -6.34873 11.32293 -0.561 0.577092
## 1994 - 1974 == 0 0.22993 11.28685 0.020 0.983815
## 1995 - 1974 == 0 19.70605 11.26121 1.750 0.085247 .
## 1996 - 1974 == 0 6.85509 11.80498 0.581 0.563621
## 1997 - 1974 == 0 -0.11404 11.03216 -0.010 0.991787
## 1998 - 1974 == 0 25.37737 17.76044 1.429 0.158227
## 1976 - 1975 == 0 16.50421 13.92901 1.185 0.240737
## 1977 - 1975 == 0 9.43369 17.72786 0.532 0.596595
## 1978 - 1975 == 0 -16.19016 13.98685 -1.158 0.251645
## 1979 - 1975 == 0 17.02784 13.98685 1.217 0.228212
## 1980 - 1975 == 0 7.56868 12.55008 0.603 0.548730
## 1981 - 1975 == 0 15.85702 17.72786 0.894 0.374645
## 1982 - 1975 == 0 14.36360 11.09820 1.294 0.200546
## 1983 - 1975 == 0 -21.95688 12.56543 -1.747 0.085684 .
## 1984 - 1975 == 0 -12.52908 11.61040 -1.079 0.284851
## 1985 - 1975 == 0 -1.20861 14.11092 -0.086 0.932029
## 1986 - 1975 == 0 -11.95241 11.61040 -1.029 0.307397
## 1987 - 1975 == 0 -2.55685 10.55410 -0.242 0.809404
## 1988 - 1975 == 0 -1.60960 11.83018 -0.136 0.892231
## 1989 - 1975 == 0 -5.11881 10.80724 -0.474 0.637471
## 1990 - 1975 == 0 -5.15298 17.72786 -0.291 0.772305
## 1991 - 1975 == 0 8.03662 13.06949 0.615 0.540936
## 1992 - 1975 == 0 3.30114 10.92692 0.302 0.763613
## 1993 - 1975 == 0 -1.87743 11.32293 -0.166 0.868866
## 1994 - 1975 == 0 4.70123 11.28685 0.417 0.678514
## 1995 - 1975 == 0 24.17734 11.26121 2.147 0.035848 *
## 1996 - 1975 == 0 11.32638 11.80498 0.959 0.341179
## 1997 - 1975 == 0 4.35726 11.03216 0.395 0.694273
## 1998 - 1975 == 0 29.84867 17.76044 1.681 0.098035 .
## 1977 - 1976 == 0 -7.07052 18.82512 -0.376 0.708547
## 1978 - 1976 == 0 -32.69436 15.49494 -2.110 0.039037 *
## 1979 - 1976 == 0 0.52364 15.49494 0.034 0.973154
## 1980 - 1976 == 0 -8.93553 14.16032 -0.631 0.530420
## 1981 - 1976 == 0 -0.64719 18.82512 -0.034 0.972689
## 1982 - 1976 == 0 -2.14061 12.72688 -0.168 0.866995
## 1983 - 1976 == 0 -38.46109 14.27593 -2.694 0.009139 **
## 1984 - 1976 == 0 -29.03329 13.23565 -2.194 0.032152 *
## 1985 - 1976 == 0 -17.71281 15.46694 -1.145 0.256672
## 1986 - 1976 == 0 -28.45662 13.23565 -2.150 0.035596 *
## 1987 - 1976 == 0 -19.06106 12.38563 -1.539 0.129070
## 1988 - 1976 == 0 -18.11380 13.61255 -1.331 0.188333
## 1989 - 1976 == 0 -21.62302 12.61463 -1.714 0.091668 .
## 1990 - 1976 == 0 -21.65719 18.82512 -1.150 0.254527
## 1991 - 1976 == 0 -8.46759 14.70332 -0.576 0.566839
## 1992 - 1976 == 0 -13.20307 12.76712 -1.034 0.305218
## 1993 - 1976 == 0 -18.38164 13.03667 -1.410 0.163704
## 1994 - 1976 == 0 -11.80298 13.10318 -0.901 0.371311
## 1995 - 1976 == 0 7.67314 13.12046 0.585 0.560860
## 1996 - 1976 == 0 -5.17782 13.63800 -0.380 0.705537
## 1997 - 1976 == 0 -12.14695 12.88028 -0.943 0.349430
## 1998 - 1976 == 0 13.34446 19.08526 0.699 0.487127
## 1978 - 1977 == 0 -25.62384 18.69602 -1.371 0.175621
## 1979 - 1977 == 0 7.59416 18.69602 0.406 0.686047
## 1980 - 1977 == 0 -1.86501 17.57547 -0.106 0.915846
## 1981 - 1977 == 0 6.42333 21.46244 0.299 0.765759
## 1982 - 1977 == 0 4.92991 16.84507 0.293 0.770790
## 1983 - 1977 == 0 -31.39057 17.72895 -1.771 0.081710 .
## 1984 - 1977 == 0 -21.96276 17.08625 -1.285 0.203590
## 1985 - 1977 == 0 -10.64229 18.58702 -0.573 0.569078
## 1986 - 1977 == 0 -21.38610 17.08625 -1.252 0.215553
## 1987 - 1977 == 0 -11.99054 16.35600 -0.733 0.466354
## 1988 - 1977 == 0 -11.04328 17.21646 -0.641 0.523681
## 1989 - 1977 == 0 -14.55250 16.56969 -0.878 0.383306
## 1990 - 1977 == 0 -14.58667 21.46244 -0.680 0.499348
## 1991 - 1977 == 0 -1.39707 18.13804 -0.077 0.938861
## 1992 - 1977 == 0 -6.13255 16.50716 -0.372 0.711568
## 1993 - 1977 == 0 -11.31112 16.94881 -0.667 0.507095
## 1994 - 1977 == 0 -4.73246 16.78772 -0.282 0.778990
## 1995 - 1977 == 0 14.74366 16.79982 0.878 0.383657
## 1996 - 1977 == 0 1.89270 17.23490 0.110 0.912920
## 1997 - 1977 == 0 -5.07643 16.62809 -0.305 0.761200
## 1998 - 1977 == 0 20.41498 21.83786 0.935 0.353616
## 1979 - 1978 == 0 33.21800 15.17624 2.189 0.032513 *
## 1980 - 1978 == 0 23.75884 13.87023 1.713 0.091888 .
## 1981 - 1978 == 0 32.04717 18.69602 1.714 0.091669 .
## 1982 - 1978 == 0 30.55376 12.91713 2.365 0.021262 *
## 1983 - 1978 == 0 -5.76672 13.87023 -0.416 0.679067
## 1984 - 1978 == 0 3.66108 13.23565 0.277 0.783032
## 1985 - 1978 == 0 14.98155 15.30954 0.979 0.331719
## 1986 - 1978 == 0 4.23774 13.23565 0.320 0.749947
## 1987 - 1978 == 0 13.63331 12.23241 1.115 0.269499
## 1988 - 1978 == 0 14.58056 13.22967 1.102 0.274815
## 1989 - 1978 == 0 11.07134 12.47140 0.888 0.378226
## 1990 - 1978 == 0 11.03717 18.69602 0.590 0.557174
## 1991 - 1978 == 0 24.22677 14.37764 1.685 0.097178 .
## 1992 - 1978 == 0 19.49129 12.43113 1.568 0.122154
## 1993 - 1978 == 0 14.31273 12.96851 1.104 0.274151
## 1994 - 1978 == 0 20.89138 12.74765 1.639 0.106480
## 1995 - 1978 == 0 40.36750 12.70375 3.178 0.002347 **
## 1996 - 1978 == 0 27.51654 13.18160 2.087 0.041098 *
## 1997 - 1978 == 0 20.54742 12.53397 1.639 0.106376
## 1998 - 1978 == 0 46.03883 18.69602 2.462 0.016686 *
## 1980 - 1979 == 0 -9.45916 13.87023 -0.682 0.497878
## 1981 - 1979 == 0 -1.17083 18.69602 -0.063 0.950274
## 1982 - 1979 == 0 -2.66424 12.91713 -0.206 0.837289
## 1983 - 1979 == 0 -38.98472 13.87023 -2.811 0.006667 **
## 1984 - 1979 == 0 -29.55692 13.23565 -2.233 0.029282 *
## 1985 - 1979 == 0 -18.23645 15.30954 -1.191 0.238273
## 1986 - 1979 == 0 -28.98026 13.23565 -2.190 0.032456 *
## 1987 - 1979 == 0 -19.58469 12.23241 -1.601 0.114619
## 1988 - 1979 == 0 -18.63744 13.22967 -1.409 0.164067
## 1989 - 1979 == 0 -22.14666 12.47140 -1.776 0.080837 .
## 1990 - 1979 == 0 -22.18083 18.69602 -1.186 0.240144
## 1991 - 1979 == 0 -8.99123 14.37764 -0.625 0.534105
## 1992 - 1979 == 0 -13.72671 12.43113 -1.104 0.273906
## 1993 - 1979 == 0 -18.90527 12.96851 -1.458 0.150115
## 1994 - 1979 == 0 -12.32662 12.74765 -0.967 0.337440
## 1995 - 1979 == 0 7.14950 12.70375 0.563 0.575677
## 1996 - 1979 == 0 -5.70146 13.18160 -0.433 0.666906
## 1997 - 1979 == 0 -12.67058 12.53397 -1.011 0.316124
## 1998 - 1979 == 0 12.82083 18.69602 0.686 0.495511
## 1981 - 1980 == 0 8.28834 17.57547 0.472 0.638933
## 1982 - 1980 == 0 6.79492 11.32009 0.600 0.550598
## 1983 - 1980 == 0 -29.52556 12.46401 -2.369 0.021079 *
## 1984 - 1980 == 0 -20.09776 11.68014 -1.721 0.090463 .
## 1985 - 1980 == 0 -8.77729 13.91898 -0.631 0.530698
## 1986 - 1980 == 0 -19.52109 11.68014 -1.671 0.099870 .
## 1987 - 1980 == 0 -10.12553 10.54759 -0.960 0.340915
## 1988 - 1980 == 0 -9.17828 11.73921 -0.782 0.437379
## 1989 - 1980 == 0 -12.68749 10.84126 -1.170 0.246509
## 1990 - 1980 == 0 -12.72166 17.57547 -0.724 0.471983
## 1991 - 1980 == 0 0.46794 13.03066 0.036 0.971473
## 1992 - 1980 == 0 -4.26754 10.77844 -0.396 0.693559
## 1993 - 1980 == 0 -9.44611 11.41051 -0.828 0.411040
## 1994 - 1980 == 0 -2.86745 11.16251 -0.257 0.798148
## 1995 - 1980 == 0 16.60866 11.13518 1.492 0.141057
## 1996 - 1980 == 0 3.75770 11.71215 0.321 0.749448
## 1997 - 1980 == 0 -3.21142 10.91889 -0.294 0.769684
## 1998 - 1980 == 0 22.27999 17.72895 1.257 0.213733
## 1982 - 1981 == 0 -1.49342 16.84507 -0.089 0.929650
## 1983 - 1981 == 0 -37.81390 17.72895 -2.133 0.037034 *
## 1984 - 1981 == 0 -28.38610 17.08625 -1.661 0.101862
## 1985 - 1981 == 0 -17.06563 18.58702 -0.918 0.362218
## 1986 - 1981 == 0 -27.80943 17.08625 -1.628 0.108852
## 1987 - 1981 == 0 -18.41387 16.35600 -1.126 0.264726
## 1988 - 1981 == 0 -17.46661 17.21646 -1.015 0.314404
## 1989 - 1981 == 0 -20.97583 16.56969 -1.266 0.210437
## 1990 - 1981 == 0 -21.01000 21.46244 -0.979 0.331550
## 1991 - 1981 == 0 -7.82040 18.13804 -0.431 0.667897
## 1992 - 1981 == 0 -12.55588 16.50716 -0.761 0.449855
## 1993 - 1981 == 0 -17.73445 16.94881 -1.046 0.299595
## 1994 - 1981 == 0 -11.15579 16.78772 -0.665 0.508903
## 1995 - 1981 == 0 8.32032 16.79982 0.495 0.622224
## 1996 - 1981 == 0 -4.53064 17.23490 -0.263 0.793547
## 1997 - 1981 == 0 -11.49976 16.62809 -0.692 0.491865
## 1998 - 1981 == 0 13.99165 21.83786 0.641 0.524153
## 1983 - 1982 == 0 -36.32048 11.38818 -3.189 0.002268 **
## 1984 - 1982 == 0 -26.89268 10.21712 -2.632 0.010772 *
## 1985 - 1982 == 0 -15.57221 12.98450 -1.199 0.235129
## 1986 - 1982 == 0 -26.31601 10.21712 -2.576 0.012486 *
## 1987 - 1982 == 0 -16.92045 9.03498 -1.873 0.065974 .
## 1988 - 1982 == 0 -15.97320 10.56070 -1.513 0.135653
## 1989 - 1982 == 0 -19.48241 9.33624 -2.087 0.041168 *
## 1990 - 1982 == 0 -19.51658 16.84507 -1.159 0.251213
## 1991 - 1982 == 0 -6.32698 11.93306 -0.530 0.597926
## 1992 - 1982 == 0 -11.06246 9.50127 -1.164 0.248905
## 1993 - 1982 == 0 -16.24103 9.91681 -1.638 0.106713
## 1994 - 1982 == 0 -9.66237 9.92718 -0.973 0.334300
## 1995 - 1982 == 0 9.81374 9.91884 0.989 0.326438
## 1996 - 1982 == 0 -3.03722 10.55691 -0.288 0.774568
## 1997 - 1982 == 0 -10.00634 9.63440 -1.039 0.303156
## 1998 - 1982 == 0 15.48507 16.98218 0.912 0.365501
## 1984 - 1983 == 0 9.42780 11.75029 0.802 0.425519
## 1985 - 1983 == 0 20.74827 14.11229 1.470 0.146725
## 1986 - 1983 == 0 10.00447 11.75029 0.851 0.397920
## 1987 - 1983 == 0 19.40003 10.58973 1.832 0.071921 .
## 1988 - 1983 == 0 20.34728 11.67774 1.742 0.086562 .
## 1989 - 1983 == 0 16.83807 10.84753 1.552 0.125862
## 1990 - 1983 == 0 16.80390 17.72895 0.948 0.347022
## 1991 - 1983 == 0 29.99350 12.95243 2.316 0.024012 *
## 1992 - 1983 == 0 25.25802 10.81764 2.335 0.022913 *
## 1993 - 1983 == 0 20.07945 11.41469 1.759 0.083661 .
## 1994 - 1983 == 0 26.65811 11.15947 2.389 0.020064 *
## 1995 - 1983 == 0 46.13422 11.08641 4.161 0.000102 ***
## 1996 - 1983 == 0 33.28326 11.59591 2.870 0.005657 **
## 1997 - 1983 == 0 26.31414 10.91371 2.411 0.018983 *
## 1998 - 1983 == 0 51.80555 17.57547 2.948 0.004557 **
## 1985 - 1984 == 0 11.32047 13.29590 0.851 0.397918
## 1986 - 1984 == 0 0.57667 10.73122 0.054 0.957323
## 1987 - 1984 == 0 9.97223 9.56528 1.043 0.301342
## 1988 - 1984 == 0 10.91948 10.96082 0.996 0.323140
## 1989 - 1984 == 0 7.41026 9.86453 0.751 0.455467
## 1990 - 1984 == 0 7.37610 17.08625 0.432 0.667508
## 1991 - 1984 == 0 20.56570 12.30564 1.671 0.099882 .
## 1992 - 1984 == 0 15.83022 9.93694 1.593 0.116400
## 1993 - 1984 == 0 10.65165 10.44247 1.020 0.311809
## 1994 - 1984 == 0 17.23031 10.34769 1.665 0.101099
## 1995 - 1984 == 0 36.70642 10.33163 3.553 0.000750 ***
## 1996 - 1984 == 0 23.85546 10.94767 2.179 0.033266 *
## 1997 - 1984 == 0 16.88634 10.07362 1.676 0.098884 .
## 1998 - 1984 == 0 42.37775 17.22994 2.460 0.016811 *
## 1986 - 1985 == 0 -10.74381 13.29590 -0.808 0.422252
## 1987 - 1985 == 0 -1.34824 12.34341 -0.109 0.913386
## 1988 - 1985 == 0 -0.40099 13.46282 -0.030 0.976337
## 1989 - 1985 == 0 -3.91021 12.62520 -0.310 0.757851
## 1990 - 1985 == 0 -3.94437 18.58702 -0.212 0.832661
## 1991 - 1985 == 0 9.24522 14.62291 0.632 0.529630
## 1992 - 1985 == 0 4.50974 12.54301 0.360 0.720452
## 1993 - 1985 == 0 -0.66882 13.11881 -0.051 0.959509
## 1994 - 1985 == 0 5.90983 12.91001 0.458 0.648770
## 1995 - 1985 == 0 25.38595 12.92574 1.964 0.054170 .
## 1996 - 1985 == 0 12.53499 13.48638 0.929 0.356378
## 1997 - 1985 == 0 5.56587 12.70174 0.438 0.662817
## 1998 - 1985 == 0 31.05728 19.01928 1.633 0.107720
## 1987 - 1986 == 0 9.39556 9.56528 0.982 0.329917
## 1988 - 1986 == 0 10.34282 10.96082 0.944 0.349150
## 1989 - 1986 == 0 6.83360 9.86453 0.693 0.491143
## 1990 - 1986 == 0 6.79943 17.08625 0.398 0.692081
## 1991 - 1986 == 0 19.98903 12.30564 1.624 0.109537
## 1992 - 1986 == 0 15.25355 9.93694 1.535 0.130032
## 1993 - 1986 == 0 10.07498 10.44247 0.965 0.338514
## 1994 - 1986 == 0 16.65364 10.34769 1.609 0.112777
## 1995 - 1986 == 0 36.12975 10.33163 3.497 0.000892 ***
## 1996 - 1986 == 0 23.27879 10.94767 2.126 0.037595 *
## 1997 - 1986 == 0 16.30967 10.07362 1.619 0.110682
## 1998 - 1986 == 0 41.80108 17.22994 2.426 0.018286 *
## 1988 - 1987 == 0 0.94725 9.60093 0.099 0.921735
## 1989 - 1987 == 0 -2.56196 8.45035 -0.303 0.762802
## 1990 - 1987 == 0 -2.59613 16.35600 -0.159 0.874417
## 1991 - 1987 == 0 10.59347 10.94645 0.968 0.337052
## 1992 - 1987 == 0 5.85799 8.48300 0.691 0.492507
## 1993 - 1987 == 0 0.67942 9.02061 0.075 0.940212
## 1994 - 1987 == 0 7.25808 8.93426 0.812 0.419781
## 1995 - 1987 == 0 26.73419 8.99812 2.971 0.004264 **
## 1996 - 1987 == 0 13.88323 9.68175 1.434 0.156775
## 1997 - 1987 == 0 6.91411 8.54920 0.809 0.421858
## 1998 - 1987 == 0 32.40552 16.43749 1.971 0.053290 .
## 1989 - 1988 == 0 -3.50922 9.86721 -0.356 0.723354
## 1990 - 1988 == 0 -3.54339 17.21646 -0.206 0.837633
## 1991 - 1988 == 0 9.64621 11.83017 0.815 0.418074
## 1992 - 1988 == 0 4.91073 9.84435 0.499 0.619718
## 1993 - 1988 == 0 -0.26783 10.30569 -0.026 0.979352
## 1994 - 1988 == 0 6.31082 10.19723 0.619 0.538341
## 1995 - 1988 == 0 25.78694 10.27908 2.509 0.014838 *
## 1996 - 1988 == 0 12.93598 10.83425 1.194 0.237181
## 1997 - 1988 == 0 5.96686 9.81995 0.608 0.545729
## 1998 - 1988 == 0 31.45827 17.09058 1.841 0.070615 .
## 1990 - 1989 == 0 -0.03417 16.56969 -0.002 0.998362
## 1991 - 1989 == 0 13.15543 11.14389 1.181 0.242458
## 1992 - 1989 == 0 8.41995 8.81831 0.955 0.343497
## 1993 - 1989 == 0 3.24138 9.28861 0.349 0.728339
## 1994 - 1989 == 0 9.82004 9.23988 1.063 0.292136
## 1995 - 1989 == 0 29.29616 9.30826 3.147 0.002566 **
## 1996 - 1989 == 0 16.44520 9.95360 1.652 0.103721
## 1997 - 1989 == 0 9.47607 8.85495 1.070 0.288840
## 1998 - 1989 == 0 34.96748 16.58200 2.109 0.039148 *
## 1991 - 1990 == 0 13.18960 18.13804 0.727 0.469944
## 1992 - 1990 == 0 8.45412 16.50716 0.512 0.610427
## 1993 - 1990 == 0 3.27555 16.94881 0.193 0.847407
## 1994 - 1990 == 0 9.85421 16.78772 0.587 0.559413
## 1995 - 1990 == 0 29.33032 16.79982 1.746 0.085952 .
## 1996 - 1990 == 0 16.47936 17.23490 0.956 0.342827
## 1997 - 1990 == 0 9.51024 16.62809 0.572 0.569500
## 1998 - 1990 == 0 35.00165 21.83786 1.603 0.114232
## 1992 - 1991 == 0 -4.73548 11.14904 -0.425 0.672543
## 1993 - 1991 == 0 -9.91405 11.25688 -0.881 0.381989
## 1994 - 1991 == 0 -3.33539 11.41643 -0.292 0.771174
## 1995 - 1991 == 0 16.14073 11.71213 1.378 0.173284
## 1996 - 1991 == 0 3.28977 12.19133 0.270 0.788206
## 1997 - 1991 == 0 -3.67936 10.91889 -0.337 0.737314
## 1998 - 1991 == 0 21.81205 17.96916 1.214 0.229558
## 1993 - 1992 == 0 -5.17857 9.37525 -0.552 0.582750
## 1994 - 1992 == 0 1.40009 9.19789 0.152 0.879525
## 1995 - 1992 == 0 20.87621 9.26574 2.253 0.027924 *
## 1996 - 1992 == 0 8.02525 9.92997 0.808 0.422177
## 1997 - 1992 == 0 1.05612 8.81978 0.120 0.905085
## 1998 - 1992 == 0 26.54753 16.58390 1.601 0.114674
## 1994 - 1993 == 0 6.57866 9.74645 0.675 0.502281
## 1995 - 1993 == 0 26.05477 9.96383 2.615 0.011270 *
## 1996 - 1993 == 0 13.20381 10.56836 1.249 0.216381
## 1997 - 1993 == 0 6.23469 9.27410 0.672 0.503993
## 1998 - 1993 == 0 31.72610 16.95725 1.871 0.066231 .
## 1995 - 1994 == 0 19.47612 9.67209 2.014 0.048539 *
## 1996 - 1994 == 0 6.62516 10.29019 0.644 0.522138
## 1997 - 1994 == 0 -0.34397 9.22056 -0.037 0.970366
## 1998 - 1994 == 0 25.14744 16.78165 1.499 0.139244
## 1996 - 1995 == 0 -12.85096 10.19848 -1.260 0.212517
## 1997 - 1995 == 0 -19.82008 9.38795 -2.111 0.038928 *
## 1998 - 1995 == 0 5.67133 16.70278 0.340 0.735386
## 1997 - 1996 == 0 -6.96912 10.02258 -0.695 0.489525
## 1998 - 1996 == 0 18.52229 16.99746 1.090 0.280199
## 1998 - 1997 == 0 25.49141 16.61787 1.534 0.130292
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)
comp_years_ENSO.73_97 <- lmer(Coral_cover ~ Year_F + Thermal_regime + (1|Region), data = ENSO.73_97)
m.comp_ENSO.73_97 <- glht(comp_years_ENSO.73_97, linfct = mcp(Year_F = "Tukey"))
summary(m.comp_ENSO.73_97, test = univariate())
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: Tukey Contrasts
##
##
## Fit: lmer(formula = Coral_cover ~ Year_F + Thermal_regime + (1 | Region),
## data = ENSO.73_97)
##
## Linear Hypotheses:
## Estimate Std. Error z value Pr(>|z|)
## 1975 - 1974 == 0 -4.47130 11.54088 -0.387 0.698437
## 1976 - 1974 == 0 10.78675 12.99333 0.830 0.406440
## 1977 - 1974 == 0 4.18247 16.58124 0.252 0.800855
## 1978 - 1974 == 0 -24.47855 13.38940 -1.828 0.067519 .
## 1979 - 1974 == 0 8.11631 13.27936 0.611 0.541069
## 1980 - 1974 == 0 -1.50943 11.90946 -0.127 0.899144
## 1981 - 1974 == 0 10.60580 16.58124 0.640 0.522415
## 1982 - 1974 == 0 10.52035 10.52308 1.000 0.317436
## 1983 - 1974 == 0 -28.55756 11.78166 -2.424 0.015355 *
## 1984 - 1974 == 0 -18.23537 10.85852 -1.679 0.093082 .
## 1985 - 1974 == 0 -8.53985 13.24648 -0.645 0.519129
## 1986 - 1974 == 0 -17.65870 10.85852 -1.626 0.103896
## 1987 - 1974 == 0 -9.34535 9.97130 -0.937 0.348643
## 1988 - 1974 == 0 -8.84397 11.09397 -0.797 0.425343
## 1989 - 1974 == 0 -12.54089 10.15234 -1.235 0.216730
## 1990 - 1974 == 0 -10.40420 16.58124 -0.627 0.530352
## 1991 - 1974 == 0 3.99944 12.35090 0.324 0.746076
## 1992 - 1974 == 0 -3.58816 10.34820 -0.347 0.728785
## 1993 - 1974 == 0 -5.95211 10.58776 -0.562 0.574000
## 1994 - 1974 == 0 -0.45699 10.70266 -0.043 0.965941
## 1995 - 1974 == 0 16.06957 10.64920 1.509 0.131301
## 1996 - 1974 == 0 2.50447 11.23106 0.223 0.823540
## 1997 - 1974 == 0 -1.57991 10.55353 -0.150 0.880998
## 1998 - 1974 == 0 17.27682 17.11701 1.009 0.312813
## 1976 - 1975 == 0 15.25804 12.99333 1.174 0.240276
## 1977 - 1975 == 0 8.65376 16.58124 0.522 0.601739
## 1978 - 1975 == 0 -20.00725 13.38940 -1.494 0.135108
## 1979 - 1975 == 0 12.58761 13.27936 0.948 0.343176
## 1980 - 1975 == 0 2.96187 11.90946 0.249 0.803594
## 1981 - 1975 == 0 15.07710 16.58124 0.909 0.363199
## 1982 - 1975 == 0 14.99165 10.52308 1.425 0.154260
## 1983 - 1975 == 0 -24.08626 11.78166 -2.044 0.040915 *
## 1984 - 1975 == 0 -13.76407 10.85852 -1.268 0.204947
## 1985 - 1975 == 0 -4.06855 13.24648 -0.307 0.758735
## 1986 - 1975 == 0 -13.18740 10.85852 -1.214 0.224566
## 1987 - 1975 == 0 -4.87405 9.97130 -0.489 0.624977
## 1988 - 1975 == 0 -4.37267 11.09397 -0.394 0.693471
## 1989 - 1975 == 0 -8.06959 10.15234 -0.795 0.426701
## 1990 - 1975 == 0 -5.93290 16.58124 -0.358 0.720487
## 1991 - 1975 == 0 8.47074 12.35090 0.686 0.492814
## 1992 - 1975 == 0 0.88313 10.34820 0.085 0.931990
## 1993 - 1975 == 0 -1.48082 10.58776 -0.140 0.888770
## 1994 - 1975 == 0 4.01430 10.70266 0.375 0.707605
## 1995 - 1975 == 0 20.54086 10.64920 1.929 0.053748 .
## 1996 - 1975 == 0 6.97576 11.23106 0.621 0.534525
## 1997 - 1975 == 0 2.89138 10.55353 0.274 0.784106
## 1998 - 1975 == 0 21.74812 17.11701 1.271 0.203887
## 1977 - 1976 == 0 -6.60428 17.56081 -0.376 0.706857
## 1978 - 1976 == 0 -35.26530 14.68888 -2.401 0.016359 *
## 1979 - 1976 == 0 -2.67044 14.57475 -0.183 0.854623
## 1980 - 1976 == 0 -12.29618 13.34548 -0.921 0.356855
## 1981 - 1976 == 0 -0.18095 17.56081 -0.010 0.991779
## 1982 - 1976 == 0 -0.26640 12.06663 -0.022 0.982386
## 1983 - 1976 == 0 -39.34431 13.33628 -2.950 0.003176 **
## 1984 - 1976 == 0 -29.02211 12.40131 -2.340 0.019271 *
## 1985 - 1976 == 0 -19.32660 14.50895 -1.332 0.182845
## 1986 - 1976 == 0 -28.44545 12.40131 -2.294 0.021805 *
## 1987 - 1976 == 0 -20.13210 11.66540 -1.726 0.084384 .
## 1988 - 1976 == 0 -19.63072 12.72318 -1.543 0.122853
## 1989 - 1976 == 0 -23.32764 11.82333 -1.973 0.048493 *
## 1990 - 1976 == 0 -21.19095 17.56081 -1.207 0.227541
## 1991 - 1976 == 0 -6.78731 13.90163 -0.488 0.625381
## 1992 - 1976 == 0 -14.37491 12.04586 -1.193 0.232733
## 1993 - 1976 == 0 -16.73886 12.19356 -1.373 0.169826
## 1994 - 1976 == 0 -11.24374 12.37149 -0.909 0.363433
## 1995 - 1976 == 0 5.28282 12.33158 0.428 0.668362
## 1996 - 1976 == 0 -8.28228 12.88812 -0.643 0.520465
## 1997 - 1976 == 0 -12.36666 12.24695 -1.010 0.312603
## 1998 - 1976 == 0 6.49007 18.21294 0.356 0.721583
## 1978 - 1977 == 0 -28.66102 17.62226 -1.626 0.103862
## 1979 - 1977 == 0 3.93384 17.53314 0.224 0.822472
## 1980 - 1977 == 0 -5.69190 16.57166 -0.343 0.731244
## 1981 - 1977 == 0 6.42333 19.98938 0.321 0.747955
## 1982 - 1977 == 0 6.33788 15.90706 0.398 0.690312
## 1983 - 1977 == 0 -32.74003 16.58000 -1.975 0.048306 *
## 1984 - 1977 == 0 -22.41783 16.07079 -1.395 0.163033
## 1985 - 1977 == 0 -12.72231 17.48987 -0.727 0.466974
## 1986 - 1977 == 0 -21.84117 16.07079 -1.359 0.174128
## 1987 - 1977 == 0 -13.52782 15.43334 -0.877 0.380741
## 1988 - 1977 == 0 -13.02643 16.11672 -0.808 0.418943
## 1989 - 1977 == 0 -16.72336 15.57667 -1.074 0.282995
## 1990 - 1977 == 0 -14.58667 19.98938 -0.730 0.465561
## 1991 - 1977 == 0 -0.18303 17.14040 -0.011 0.991480
## 1992 - 1977 == 0 -7.77063 15.59577 -0.498 0.618306
## 1993 - 1977 == 0 -10.13458 15.89063 -0.638 0.523623
## 1994 - 1977 == 0 -4.63946 15.84935 -0.293 0.769734
## 1995 - 1977 == 0 11.88710 15.80763 0.752 0.452060
## 1996 - 1977 == 0 -1.67800 16.29637 -0.103 0.917989
## 1997 - 1977 == 0 -5.76238 15.74470 -0.366 0.714374
## 1998 - 1977 == 0 13.09435 20.74834 0.631 0.527973
## 1979 - 1978 == 0 32.59486 14.53534 2.242 0.024932 *
## 1980 - 1978 == 0 22.96912 13.33415 1.723 0.084965 .
## 1981 - 1978 == 0 35.08435 17.62226 1.991 0.046491 *
## 1982 - 1978 == 0 34.99890 12.52010 2.795 0.005183 **
## 1983 - 1978 == 0 -4.07901 13.30003 -0.307 0.759078
## 1984 - 1978 == 0 6.24318 12.72700 0.491 0.623747
## 1985 - 1978 == 0 15.93870 14.56998 1.094 0.273981
## 1986 - 1978 == 0 6.81985 12.72700 0.536 0.592057
## 1987 - 1978 == 0 15.13320 11.85294 1.277 0.201692
## 1988 - 1978 == 0 15.63458 12.70409 1.231 0.218445
## 1989 - 1978 == 0 11.93766 12.02762 0.993 0.320944
## 1990 - 1978 == 0 14.07435 17.62226 0.799 0.424482
## 1991 - 1978 == 0 28.47799 13.88335 2.051 0.040244 *
## 1992 - 1978 == 0 20.89039 12.05337 1.733 0.083068 .
## 1993 - 1978 == 0 18.52644 12.45726 1.487 0.136962
## 1994 - 1978 == 0 24.02156 12.11859 1.982 0.047456 *
## 1995 - 1978 == 0 40.54812 12.03924 3.368 0.000757 ***
## 1996 - 1978 == 0 26.98302 12.51629 2.156 0.031097 *
## 1997 - 1978 == 0 22.89864 12.01121 1.906 0.056593 .
## 1998 - 1978 == 0 41.75537 18.09019 2.308 0.020989 *
## 1980 - 1979 == 0 -9.62574 13.00349 -0.740 0.459153
## 1981 - 1979 == 0 2.48949 17.53314 0.142 0.887090
## 1982 - 1979 == 0 2.40404 12.39708 0.194 0.846239
## 1983 - 1979 == 0 -36.67387 12.98167 -2.825 0.004727 **
## 1984 - 1979 == 0 -26.35168 12.60904 -2.090 0.036626 *
## 1985 - 1979 == 0 -16.65616 14.46177 -1.152 0.249429
## 1986 - 1979 == 0 -25.77501 12.60904 -2.044 0.040937 *
## 1987 - 1979 == 0 -17.46166 11.61594 -1.503 0.132775
## 1988 - 1979 == 0 -16.96028 12.42333 -1.365 0.172192
## 1989 - 1979 == 0 -20.65720 11.78322 -1.753 0.079584 .
## 1990 - 1979 == 0 -18.52051 17.53314 -1.056 0.290825
## 1991 - 1979 == 0 -4.11687 13.81657 -0.298 0.765729
## 1992 - 1979 == 0 -11.70447 11.80617 -0.991 0.321497
## 1993 - 1979 == 0 -14.06842 12.35252 -1.139 0.254740
## 1994 - 1979 == 0 -8.57330 12.25506 -0.700 0.484194
## 1995 - 1979 == 0 7.95326 12.02144 0.662 0.508234
## 1996 - 1979 == 0 -5.61184 12.52619 -0.448 0.654147
## 1997 - 1979 == 0 -9.69622 12.12151 -0.800 0.423758
## 1998 - 1979 == 0 9.16051 17.53314 0.522 0.601344
## 1981 - 1980 == 0 12.11523 16.57166 0.731 0.464730
## 1982 - 1980 == 0 12.02978 10.79131 1.115 0.264951
## 1983 - 1980 == 0 -27.04813 11.68049 -2.316 0.020576 *
## 1984 - 1980 == 0 -16.72594 11.02419 -1.517 0.129215
## 1985 - 1980 == 0 -7.03042 13.02290 -0.540 0.589300
## 1986 - 1980 == 0 -16.14927 11.02419 -1.465 0.142950
## 1987 - 1980 == 0 -7.83592 9.95235 -0.787 0.431081
## 1988 - 1980 == 0 -7.33454 11.02239 -0.665 0.505781
## 1989 - 1980 == 0 -11.03146 10.16142 -1.086 0.277646
## 1990 - 1980 == 0 -8.89477 16.57166 -0.537 0.591443
## 1991 - 1980 == 0 5.50887 12.49041 0.441 0.659178
## 1992 - 1980 == 0 -2.07873 10.17350 -0.204 0.838097
## 1993 - 1980 == 0 -4.44268 10.85133 -0.409 0.682236
## 1994 - 1980 == 0 1.05244 10.65146 0.099 0.921292
## 1995 - 1980 == 0 17.57900 10.44836 1.682 0.092479 .
## 1996 - 1980 == 0 4.01390 10.99635 0.365 0.715096
## 1997 - 1980 == 0 -0.07048 10.58354 -0.007 0.994686
## 1998 - 1980 == 0 18.78625 16.69755 1.125 0.260551
## 1982 - 1981 == 0 -0.08545 15.90706 -0.005 0.995714
## 1983 - 1981 == 0 -39.16336 16.58000 -2.362 0.018172 *
## 1984 - 1981 == 0 -28.84117 16.07079 -1.795 0.072712 .
## 1985 - 1981 == 0 -19.14565 17.48987 -1.095 0.273661
## 1986 - 1981 == 0 -28.26450 16.07079 -1.759 0.078620 .
## 1987 - 1981 == 0 -19.95115 15.43334 -1.293 0.196104
## 1988 - 1981 == 0 -19.44977 16.11672 -1.207 0.227506
## 1989 - 1981 == 0 -23.14669 15.57667 -1.486 0.137283
## 1990 - 1981 == 0 -21.01000 19.98938 -1.051 0.293232
## 1991 - 1981 == 0 -6.60636 17.14040 -0.385 0.699922
## 1992 - 1981 == 0 -14.19396 15.59577 -0.910 0.362761
## 1993 - 1981 == 0 -16.55791 15.89063 -1.042 0.297415
## 1994 - 1981 == 0 -11.06279 15.84935 -0.698 0.485179
## 1995 - 1981 == 0 5.46377 15.80763 0.346 0.729612
## 1996 - 1981 == 0 -8.10133 16.29637 -0.497 0.619101
## 1997 - 1981 == 0 -12.18571 15.74470 -0.774 0.438956
## 1998 - 1981 == 0 6.67102 20.74834 0.322 0.747816
## 1983 - 1982 == 0 -39.07791 10.80419 -3.617 0.000298 ***
## 1984 - 1982 == 0 -28.75572 9.66202 -2.976 0.002919 **
## 1985 - 1982 == 0 -19.06020 12.21054 -1.561 0.118533
## 1986 - 1982 == 0 -28.17905 9.66202 -2.916 0.003540 **
## 1987 - 1982 == 0 -19.86570 8.66723 -2.292 0.021903 *
## 1988 - 1982 == 0 -19.36432 10.03473 -1.930 0.053640 .
## 1989 - 1982 == 0 -23.06124 8.88364 -2.596 0.009434 **
## 1990 - 1982 == 0 -20.92455 15.90706 -1.315 0.188367
## 1991 - 1982 == 0 -6.52091 11.41351 -0.571 0.567774
## 1992 - 1982 == 0 -14.10851 9.10049 -1.550 0.121069
## 1993 - 1982 == 0 -16.47246 9.44989 -1.743 0.081309 .
## 1994 - 1982 == 0 -10.97734 9.51402 -1.154 0.248579
## 1995 - 1982 == 0 5.54922 9.45316 0.587 0.557189
## 1996 - 1982 == 0 -8.01588 10.07762 -0.795 0.426373
## 1997 - 1982 == 0 -12.10026 9.41004 -1.286 0.198482
## 1998 - 1982 == 0 6.75647 16.41912 0.412 0.680706
## 1984 - 1983 == 0 10.32219 11.04432 0.935 0.349986
## 1985 - 1983 == 0 20.01771 13.23496 1.512 0.130410
## 1986 - 1983 == 0 10.89886 11.04432 0.987 0.323726
## 1987 - 1983 == 0 19.21221 9.96319 1.928 0.053815 .
## 1988 - 1983 == 0 19.71359 10.89291 1.810 0.070333 .
## 1989 - 1983 == 0 16.01667 10.15110 1.578 0.114606
## 1990 - 1983 == 0 18.15336 16.58000 1.095 0.273562
## 1991 - 1983 == 0 32.55700 12.31173 2.644 0.008184 **
## 1992 - 1983 == 0 24.96940 10.19214 2.450 0.014291 *
## 1993 - 1983 == 0 22.60545 10.73815 2.105 0.035278 *
## 1994 - 1983 == 0 28.10057 10.64150 2.641 0.008274 **
## 1995 - 1983 == 0 44.62713 10.43917 4.275 1.91e-05 ***
## 1996 - 1983 == 0 31.06203 10.98229 2.828 0.004678 **
## 1997 - 1983 == 0 26.97765 10.48547 2.573 0.010086 *
## 1998 - 1983 == 0 45.83438 16.65527 2.752 0.005924 **
## 1985 - 1984 == 0 9.69552 12.41109 0.781 0.434686
## 1986 - 1984 == 0 0.57667 9.99469 0.058 0.953990
## 1987 - 1984 == 0 8.89002 9.01109 0.987 0.323856
## 1988 - 1984 == 0 9.39140 10.29879 0.912 0.361825
## 1989 - 1984 == 0 5.69448 9.22654 0.617 0.537113
## 1990 - 1984 == 0 7.83117 16.07079 0.487 0.626051
## 1991 - 1984 == 0 22.23481 11.65226 1.908 0.056366 .
## 1992 - 1984 == 0 14.64720 9.38370 1.561 0.118543
## 1993 - 1984 == 0 12.28325 9.79307 1.254 0.209740
## 1994 - 1984 == 0 17.77837 9.78340 1.817 0.069187 .
## 1995 - 1984 == 0 34.30493 9.72011 3.529 0.000417 ***
## 1996 - 1984 == 0 20.73983 10.32702 2.008 0.044611 *
## 1997 - 1984 == 0 16.65545 9.68935 1.719 0.085625 .
## 1998 - 1984 == 0 35.51219 16.58169 2.142 0.032222 *
## 1986 - 1985 == 0 -9.11885 12.41109 -0.735 0.462502
## 1987 - 1985 == 0 -0.80550 11.58995 -0.070 0.944592
## 1988 - 1985 == 0 -0.30412 12.62393 -0.024 0.980780
## 1989 - 1985 == 0 -4.00104 11.78740 -0.339 0.734283
## 1990 - 1985 == 0 -1.86435 17.48987 -0.107 0.915109
## 1991 - 1985 == 0 12.53929 13.84210 0.906 0.364999
## 1992 - 1985 == 0 4.95169 11.79268 0.420 0.674562
## 1993 - 1985 == 0 2.58773 12.32426 0.210 0.833691
## 1994 - 1985 == 0 8.08285 12.13193 0.666 0.505254
## 1995 - 1985 == 0 24.60942 12.07339 2.038 0.041518 *
## 1996 - 1985 == 0 11.04432 12.60353 0.876 0.380874
## 1997 - 1985 == 0 6.95993 12.10879 0.575 0.565438
## 1998 - 1985 == 0 25.81667 18.10075 1.426 0.153789
## 1987 - 1986 == 0 8.31335 9.01109 0.923 0.356232
## 1988 - 1986 == 0 8.81473 10.29879 0.856 0.392053
## 1989 - 1986 == 0 5.11781 9.22654 0.555 0.579111
## 1990 - 1986 == 0 7.25450 16.07079 0.451 0.651695
## 1991 - 1986 == 0 21.65814 11.65226 1.859 0.063069 .
## 1992 - 1986 == 0 14.07054 9.38370 1.499 0.133753
## 1993 - 1986 == 0 11.70659 9.79307 1.195 0.231933
## 1994 - 1986 == 0 17.20171 9.78340 1.758 0.078704 .
## 1995 - 1986 == 0 33.72827 9.72011 3.470 0.000521 ***
## 1996 - 1986 == 0 20.16317 10.32702 1.952 0.050883 .
## 1997 - 1986 == 0 16.07879 9.68935 1.659 0.097030 .
## 1998 - 1986 == 0 34.93552 16.58169 2.107 0.035129 *
## 1988 - 1987 == 0 0.50138 9.01911 0.056 0.955668
## 1989 - 1987 == 0 -3.19554 7.92902 -0.403 0.686935
## 1990 - 1987 == 0 -1.05885 15.43334 -0.069 0.945302
## 1991 - 1987 == 0 13.34479 10.48582 1.273 0.203142
## 1992 - 1987 == 0 5.75719 7.90401 0.728 0.466376
## 1993 - 1987 == 0 3.39324 8.57595 0.396 0.692349
## 1994 - 1987 == 0 8.88836 8.60993 1.032 0.301914
## 1995 - 1987 == 0 25.41492 8.50936 2.987 0.002820 **
## 1996 - 1987 == 0 11.84982 9.16945 1.292 0.196248
## 1997 - 1987 == 0 7.76544 8.35591 0.929 0.352716
## 1998 - 1987 == 0 26.62217 15.71365 1.694 0.090226 .
## 1989 - 1988 == 0 -3.69692 9.21921 -0.401 0.688419
## 1990 - 1988 == 0 -1.56023 16.11672 -0.097 0.922879
## 1991 - 1988 == 0 12.84341 11.29044 1.138 0.255310
## 1992 - 1988 == 0 5.25581 9.26139 0.567 0.570377
## 1993 - 1988 == 0 2.89185 9.73799 0.297 0.766492
## 1994 - 1988 == 0 8.38697 9.79546 0.856 0.391881
## 1995 - 1988 == 0 24.91354 9.68476 2.572 0.010098 *
## 1996 - 1988 == 0 11.34844 10.26745 1.105 0.269037
## 1997 - 1988 == 0 7.26405 9.49247 0.765 0.444127
## 1998 - 1988 == 0 26.12079 16.25351 1.607 0.108036
## 1990 - 1989 == 0 2.13669 15.57667 0.137 0.890895
## 1991 - 1989 == 0 16.54033 10.64132 1.554 0.120101
## 1992 - 1989 == 0 8.95273 8.29032 1.080 0.280186
## 1993 - 1989 == 0 6.58878 8.78282 0.750 0.453141
## 1994 - 1989 == 0 12.08390 8.84377 1.366 0.171822
## 1995 - 1989 == 0 28.61046 8.74151 3.273 0.001064 **
## 1996 - 1989 == 0 15.04536 9.37943 1.604 0.108696
## 1997 - 1989 == 0 10.96098 8.61449 1.272 0.203235
## 1998 - 1989 == 0 29.81771 15.82095 1.885 0.059471 .
## 1991 - 1990 == 0 14.40364 17.14040 0.840 0.400722
## 1992 - 1990 == 0 6.81604 15.59577 0.437 0.662079
## 1993 - 1990 == 0 4.45209 15.89063 0.280 0.779347
## 1994 - 1990 == 0 9.94721 15.84935 0.628 0.530260
## 1995 - 1990 == 0 26.47377 15.80763 1.675 0.093984 .
## 1996 - 1990 == 0 12.90867 16.29637 0.792 0.428291
## 1997 - 1990 == 0 8.82429 15.74470 0.560 0.575165
## 1998 - 1990 == 0 27.68102 20.74834 1.334 0.182161
## 1992 - 1991 == 0 -7.58760 10.69415 -0.710 0.478008
## 1993 - 1991 == 0 -9.95155 10.79300 -0.922 0.356509
## 1994 - 1991 == 0 -4.45643 11.01723 -0.404 0.685847
## 1995 - 1991 == 0 12.07013 11.19679 1.078 0.281034
## 1996 - 1991 == 0 -1.49497 11.67802 -0.128 0.898136
## 1997 - 1991 == 0 -5.57935 10.27000 -0.543 0.586946
## 1998 - 1991 == 0 13.27738 17.41404 0.762 0.445790
## 1993 - 1992 == 0 -2.36395 8.93695 -0.265 0.791384
## 1994 - 1992 == 0 3.13117 8.88116 0.353 0.724416
## 1995 - 1992 == 0 19.65773 8.77353 2.241 0.025054 *
## 1996 - 1992 == 0 6.09263 9.40883 0.648 0.517280
## 1997 - 1992 == 0 2.00825 8.62079 0.233 0.815797
## 1998 - 1992 == 0 20.86498 15.83636 1.318 0.187659
## 1994 - 1993 == 0 5.49512 9.18328 0.598 0.549584
## 1995 - 1993 == 0 22.02168 9.44488 2.332 0.019722 *
## 1996 - 1993 == 0 8.45658 10.07440 0.839 0.401238
## 1997 - 1993 == 0 4.37220 9.03913 0.484 0.628601
## 1998 - 1993 == 0 23.22893 16.36777 1.419 0.155844
## 1995 - 1994 == 0 16.52656 9.12575 1.811 0.070144 .
## 1996 - 1994 == 0 2.96146 9.71664 0.305 0.760532
## 1997 - 1994 == 0 -1.12292 8.97845 -0.125 0.900469
## 1998 - 1994 == 0 17.73381 16.26093 1.091 0.275459
## 1996 - 1995 == 0 -13.56510 9.51514 -1.426 0.153974
## 1997 - 1995 == 0 -17.64948 9.02016 -1.957 0.050386 .
## 1998 - 1995 == 0 1.20725 15.94979 0.076 0.939665
## 1997 - 1996 == 0 -4.08438 9.63559 -0.424 0.671650
## 1998 - 1996 == 0 14.77235 16.23225 0.910 0.362790
## 1998 - 1997 == 0 18.85673 16.16209 1.167 0.243321
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)
ENSO.83_97$Year_F <- as.factor(ENSO.83_97$Year)
comp_years_ENSO.83_97 <- aov(Coral_cover ~ Year_F + Thermal_regime, data = ENSO.83_97)
m.comp_ENSO.83_97 <- glht(comp_years_ENSO.83_97, linfct = mcp(Year_F = "Tukey"))
summary(m.comp_ENSO.83_97, test = univariate())
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: Tukey Contrasts
##
##
## Fit: aov(formula = Coral_cover ~ Year_F + Thermal_regime, data = ENSO.83_97)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(>|t|)
## 1984 - 1983 == 0 12.63306 10.73834 1.176 0.245341
## 1985 - 1983 == 0 23.00412 12.87771 1.786 0.080494 .
## 1986 - 1983 == 0 13.20973 10.73834 1.230 0.224764
## 1987 - 1983 == 0 21.57678 9.64613 2.237 0.030080 *
## 1988 - 1983 == 0 20.66936 10.59561 1.951 0.057064 .
## 1989 - 1983 == 0 19.00163 9.88250 1.923 0.060582 .
## 1990 - 1983 == 0 19.05974 16.14394 1.181 0.243697
## 1991 - 1983 == 0 30.47638 11.75526 2.593 0.012656 *
## 1992 - 1983 == 0 26.22468 9.82761 2.668 0.010424 *
## 1993 - 1983 == 0 22.70780 10.41826 2.180 0.034330 *
## 1994 - 1983 == 0 27.36693 10.13028 2.701 0.009571 **
## 1995 - 1983 == 0 46.35981 10.05929 4.609 3.12e-05 ***
## 1996 - 1983 == 0 33.00128 10.52201 3.136 0.002949 **
## 1997 - 1983 == 0 27.11954 9.90776 2.737 0.008721 **
## 1998 - 1983 == 0 50.67763 15.96056 3.175 0.002643 **
## 1985 - 1984 == 0 10.37105 12.14299 0.854 0.397394
## 1986 - 1984 == 0 0.57667 9.73609 0.059 0.953020
## 1987 - 1984 == 0 8.94372 8.68959 1.029 0.308632
## 1988 - 1984 == 0 8.03629 10.01193 0.803 0.426205
## 1989 - 1984 == 0 6.36857 8.95911 0.711 0.480691
## 1990 - 1984 == 0 6.42668 15.56418 0.413 0.681547
## 1991 - 1984 == 0 17.84332 11.21559 1.591 0.118328
## 1992 - 1984 == 0 13.59162 9.07939 1.497 0.141086
## 1993 - 1984 == 0 10.07474 9.47877 1.063 0.293269
## 1994 - 1984 == 0 14.73387 9.45110 1.559 0.125715
## 1995 - 1984 == 0 33.72675 9.45421 3.567 0.000842 ***
## 1996 - 1984 == 0 20.36822 10.02743 2.031 0.047906 *
## 1997 - 1984 == 0 14.48648 9.19785 1.575 0.121968
## 1998 - 1984 == 0 38.04457 15.72629 2.419 0.019480 *
## 1986 - 1985 == 0 -9.79439 12.14299 -0.807 0.423967
## 1987 - 1985 == 0 -1.42734 11.25848 -0.127 0.899656
## 1988 - 1985 == 0 -2.33476 12.28558 -0.190 0.850096
## 1989 - 1985 == 0 -4.00248 11.53382 -0.347 0.730124
## 1990 - 1985 == 0 -3.94437 16.86340 -0.234 0.816077
## 1991 - 1985 == 0 7.47227 13.34819 0.560 0.578277
## 1992 - 1985 == 0 3.22056 11.41388 0.282 0.779058
## 1993 - 1985 == 0 -0.29631 12.00152 -0.025 0.980407
## 1994 - 1985 == 0 4.36282 11.76040 0.371 0.712323
## 1995 - 1985 == 0 23.35569 11.79263 1.981 0.053514 .
## 1996 - 1985 == 0 9.99717 12.33377 0.811 0.421708
## 1997 - 1985 == 0 4.11543 11.57395 0.356 0.723749
## 1998 - 1985 == 0 27.67351 17.37918 1.592 0.118013
## 1987 - 1986 == 0 8.36705 8.68959 0.963 0.340535
## 1988 - 1986 == 0 7.45963 10.01193 0.745 0.459937
## 1989 - 1986 == 0 5.79191 8.95911 0.646 0.521112
## 1990 - 1986 == 0 5.85001 15.56418 0.376 0.708709
## 1991 - 1986 == 0 17.26665 11.21559 1.540 0.130383
## 1992 - 1986 == 0 13.01495 9.07939 1.433 0.158345
## 1993 - 1986 == 0 9.49808 9.47877 1.002 0.321457
## 1994 - 1986 == 0 14.15720 9.45110 1.498 0.140835
## 1995 - 1986 == 0 33.15008 9.45421 3.506 0.001011 **
## 1996 - 1986 == 0 19.79155 10.02743 1.974 0.054306 .
## 1997 - 1986 == 0 13.90981 9.19785 1.512 0.137156
## 1998 - 1986 == 0 37.46790 15.72629 2.383 0.021292 *
## 1988 - 1987 == 0 -0.90742 8.74129 -0.104 0.917763
## 1989 - 1987 == 0 -2.57515 7.66915 -0.336 0.738531
## 1990 - 1987 == 0 -2.51704 14.88438 -0.169 0.866439
## 1991 - 1987 == 0 8.89960 9.95455 0.894 0.375864
## 1992 - 1987 == 0 4.64790 7.72334 0.602 0.550200
## 1993 - 1987 == 0 1.13102 8.19465 0.138 0.890814
## 1994 - 1987 == 0 5.79015 8.13147 0.712 0.479943
## 1995 - 1987 == 0 24.78303 8.20210 3.022 0.004061 **
## 1996 - 1987 == 0 11.42450 8.83683 1.293 0.202390
## 1997 - 1987 == 0 5.54276 7.77891 0.713 0.479655
## 1998 - 1987 == 0 29.10085 14.97563 1.943 0.057993 .
## 1989 - 1988 == 0 -1.66772 8.98535 -0.186 0.853554
## 1990 - 1988 == 0 -1.60961 15.67568 -0.103 0.918652
## 1991 - 1988 == 0 9.80703 10.73547 0.914 0.365634
## 1992 - 1988 == 0 5.55532 8.94231 0.621 0.537443
## 1993 - 1988 == 0 2.03845 9.40460 0.217 0.829341
## 1994 - 1988 == 0 6.69758 9.25539 0.724 0.472873
## 1995 - 1988 == 0 25.69045 9.32684 2.754 0.008335 **
## 1996 - 1988 == 0 12.33193 9.83302 1.254 0.215995
## 1997 - 1988 == 0 6.45019 8.91294 0.724 0.472844
## 1998 - 1988 == 0 30.00827 15.52440 1.933 0.059277 .
## 1990 - 1989 == 0 0.05811 15.09372 0.004 0.996945
## 1991 - 1989 == 0 11.47475 10.13212 1.133 0.263164
## 1992 - 1989 == 0 7.22305 8.03904 0.898 0.373501
## 1993 - 1989 == 0 3.70617 8.43122 0.440 0.662258
## 1994 - 1989 == 0 8.36530 8.41647 0.994 0.325351
## 1995 - 1989 == 0 27.35817 8.48860 3.223 0.002308 **
## 1996 - 1989 == 0 13.99965 9.08284 1.541 0.129943
## 1997 - 1989 == 0 8.11791 8.06336 1.007 0.319203
## 1998 - 1989 == 0 31.67600 15.10151 2.098 0.041351 *
## 1991 - 1990 == 0 11.41664 16.52167 0.691 0.492958
## 1992 - 1990 == 0 7.16494 15.00227 0.478 0.635156
## 1993 - 1990 == 0 3.64806 15.45405 0.236 0.814413
## 1994 - 1990 == 0 8.30719 15.26756 0.544 0.588940
## 1995 - 1990 == 0 27.30007 15.29240 1.785 0.080682 .
## 1996 - 1990 == 0 13.94154 15.71347 0.887 0.379470
## 1997 - 1990 == 0 8.05980 15.12441 0.533 0.596613
## 1998 - 1990 == 0 31.61789 19.92053 1.587 0.119173
## 1992 - 1991 == 0 -4.25170 10.13330 -0.420 0.676706
## 1993 - 1991 == 0 -7.76858 10.25039 -0.758 0.452305
## 1994 - 1991 == 0 -3.10945 10.36711 -0.300 0.765550
## 1995 - 1991 == 0 15.88343 10.63208 1.494 0.141882
## 1996 - 1991 == 0 2.52490 11.06538 0.228 0.820496
## 1997 - 1991 == 0 -3.35684 9.91459 -0.339 0.736437
## 1998 - 1991 == 0 20.20125 16.31768 1.238 0.221865
## 1993 - 1992 == 0 -3.51687 8.56943 -0.410 0.683379
## 1994 - 1992 == 0 1.14225 8.34681 0.137 0.891735
## 1995 - 1992 == 0 20.13513 8.41472 2.393 0.020766 *
## 1996 - 1992 == 0 6.77660 9.03465 0.750 0.456952
## 1997 - 1992 == 0 0.89486 8.00445 0.112 0.911461
## 1998 - 1992 == 0 24.45295 15.09334 1.620 0.111899
## 1994 - 1993 == 0 4.65913 8.89980 0.524 0.603079
## 1995 - 1993 == 0 23.65200 9.10746 2.597 0.012515 *
## 1996 - 1993 == 0 10.29348 9.66220 1.065 0.292167
## 1997 - 1993 == 0 4.41174 8.46723 0.521 0.604788
## 1998 - 1993 == 0 27.96982 15.45530 1.810 0.076736 .
## 1995 - 1994 == 0 18.99287 8.77765 2.164 0.035597 *
## 1996 - 1994 == 0 5.63435 9.34971 0.603 0.549656
## 1997 - 1994 == 0 -0.24739 8.36574 -0.030 0.976534
## 1998 - 1994 == 0 23.31070 15.25958 1.528 0.133312
## 1996 - 1995 == 0 -13.35853 9.25795 -1.443 0.155674
## 1997 - 1995 == 0 -19.24026 8.52051 -2.258 0.028622 *
## 1998 - 1995 == 0 4.31782 15.17647 0.285 0.777271
## 1997 - 1996 == 0 -5.88174 9.10739 -0.646 0.521537
## 1998 - 1996 == 0 17.67635 15.42992 1.146 0.257765
## 1998 - 1997 == 0 23.55809 15.11098 1.559 0.125704
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)
comp_years_ENSO.83_97 <- lmer(Coral_cover ~ Year_F + Thermal_regime + (1|Region), data = ENSO.83_97)
m.comp_ENSO.83_97 <- glht(comp_years_ENSO.83_97, linfct = mcp(Year_F = "Tukey"))
summary(m.comp_ENSO.83_97, test = univariate())
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: Tukey Contrasts
##
##
## Fit: lmer(formula = Coral_cover ~ Year_F + Thermal_regime + (1 | Region),
## data = ENSO.83_97)
##
## Linear Hypotheses:
## Estimate Std. Error z value Pr(>|z|)
## 1984 - 1983 == 0 13.1746 9.6934 1.359 0.174105
## 1985 - 1983 == 0 21.7107 11.5876 1.874 0.060984 .
## 1986 - 1983 == 0 13.7512 9.6934 1.419 0.156009
## 1987 - 1983 == 0 21.0603 8.7182 2.416 0.015707 *
## 1988 - 1983 == 0 19.7522 9.4754 2.085 0.037108 *
## 1989 - 1983 == 0 17.7873 8.8753 2.004 0.045055 *
## 1990 - 1983 == 0 20.4597 14.5093 1.410 0.158506
## 1991 - 1983 == 0 32.4150 10.7660 3.011 0.002605 **
## 1992 - 1983 == 0 25.5605 8.8932 2.874 0.004051 **
## 1993 - 1983 == 0 25.2039 9.4139 2.677 0.007422 **
## 1994 - 1983 == 0 27.8705 9.3193 2.991 0.002784 **
## 1995 - 1983 == 0 43.7075 9.1076 4.799 1.59e-06 ***
## 1996 - 1983 == 0 29.3358 9.6058 3.054 0.002258 **
## 1997 - 1983 == 0 26.3461 9.1966 2.865 0.004173 **
## 1998 - 1983 == 0 44.8944 14.5670 3.082 0.002057 **
## 1985 - 1984 == 0 8.5361 10.8616 0.786 0.431929
## 1986 - 1984 == 0 0.5767 8.6905 0.066 0.947095
## 1987 - 1984 == 0 7.8857 7.8664 1.002 0.316124
## 1988 - 1984 == 0 6.5776 9.0337 0.728 0.466542
## 1989 - 1984 == 0 4.6127 8.0392 0.574 0.566118
## 1990 - 1984 == 0 7.2851 14.0989 0.517 0.605354
## 1991 - 1984 == 0 19.2404 10.2261 1.882 0.059903 .
## 1992 - 1984 == 0 12.3859 8.2354 1.504 0.132586
## 1993 - 1984 == 0 12.0293 8.5336 1.410 0.158647
## 1994 - 1984 == 0 14.6959 8.5911 1.711 0.087157 .
## 1995 - 1984 == 0 30.5329 8.5386 3.576 0.000349 ***
## 1996 - 1984 == 0 16.1613 9.0915 1.778 0.075464 .
## 1997 - 1984 == 0 13.1715 8.5505 1.540 0.123454
## 1998 - 1984 == 0 31.7198 14.6143 2.170 0.029971 *
## 1986 - 1985 == 0 -7.9594 10.8616 -0.733 0.463679
## 1987 - 1985 == 0 -0.6504 10.1581 -0.064 0.948947
## 1988 - 1985 == 0 -1.9585 11.0528 -0.177 0.859355
## 1989 - 1985 == 0 -3.9234 10.3249 -0.380 0.703952
## 1990 - 1985 == 0 -1.2510 15.2599 -0.082 0.934664
## 1991 - 1985 == 0 10.7043 12.1558 0.881 0.378538
## 1992 - 1985 == 0 3.8498 10.3161 0.373 0.709012
## 1993 - 1985 == 0 3.4932 10.8105 0.323 0.746598
## 1994 - 1985 == 0 6.1598 10.6111 0.581 0.561574
## 1995 - 1985 == 0 21.9968 10.5644 2.082 0.037327 *
## 1996 - 1985 == 0 7.6252 11.0683 0.689 0.490873
## 1997 - 1985 == 0 4.6354 10.6382 0.436 0.663030
## 1998 - 1985 == 0 23.1837 15.9477 1.454 0.146019
## 1987 - 1986 == 0 7.3090 7.8664 0.929 0.352813
## 1988 - 1986 == 0 6.0009 9.0337 0.664 0.506510
## 1989 - 1986 == 0 4.0361 8.0392 0.502 0.615635
## 1990 - 1986 == 0 6.7085 14.0989 0.476 0.634206
## 1991 - 1986 == 0 18.6638 10.2261 1.825 0.067983 .
## 1992 - 1986 == 0 11.8092 8.2354 1.434 0.151584
## 1993 - 1986 == 0 11.4526 8.5336 1.342 0.179576
## 1994 - 1986 == 0 14.1192 8.5911 1.643 0.100287
## 1995 - 1986 == 0 29.9562 8.5386 3.508 0.000451 ***
## 1996 - 1986 == 0 15.5846 9.0915 1.714 0.086491 .
## 1997 - 1986 == 0 12.5949 8.5505 1.473 0.140753
## 1998 - 1986 == 0 31.1432 14.6143 2.131 0.033088 *
## 1988 - 1987 == 0 -1.3081 7.8856 -0.166 0.868247
## 1989 - 1987 == 0 -3.2730 6.9073 -0.474 0.635612
## 1990 - 1987 == 0 -0.6006 13.5493 -0.044 0.964646
## 1991 - 1987 == 0 11.3547 9.2046 1.234 0.217357
## 1992 - 1987 == 0 4.5002 6.8957 0.653 0.514009
## 1993 - 1987 == 0 4.1436 7.4986 0.553 0.580552
## 1994 - 1987 == 0 6.8102 7.5755 0.899 0.368667
## 1995 - 1987 == 0 22.6472 7.4602 3.036 0.002399 **
## 1996 - 1987 == 0 8.2756 8.0553 1.027 0.304255
## 1997 - 1987 == 0 5.2858 7.3836 0.716 0.474061
## 1998 - 1987 == 0 23.8341 13.8016 1.727 0.084183 .
## 1989 - 1988 == 0 -1.9649 8.0540 -0.244 0.807263
## 1990 - 1988 == 0 0.7075 14.1095 0.050 0.960006
## 1991 - 1988 == 0 12.6628 9.8796 1.282 0.199942
## 1992 - 1988 == 0 5.8083 8.0764 0.719 0.472037
## 1993 - 1988 == 0 5.4517 8.5430 0.638 0.523378
## 1994 - 1988 == 0 8.1183 8.5901 0.945 0.344621
## 1995 - 1988 == 0 23.9553 8.4498 2.835 0.004582 **
## 1996 - 1988 == 0 9.5837 8.9830 1.067 0.286032
## 1997 - 1988 == 0 6.5939 8.3337 0.791 0.428806
## 1998 - 1988 == 0 25.1422 14.2292 1.767 0.077237 .
## 1990 - 1989 == 0 2.6724 13.6724 0.195 0.845033
## 1991 - 1989 == 0 14.6277 9.3339 1.567 0.117077
## 1992 - 1989 == 0 7.7732 7.2522 1.072 0.283791
## 1993 - 1989 == 0 7.4166 7.6680 0.967 0.333440
## 1994 - 1989 == 0 10.0832 7.7727 1.297 0.194543
## 1995 - 1989 == 0 25.9201 7.6539 3.387 0.000708 ***
## 1996 - 1989 == 0 11.5485 8.2286 1.403 0.160480
## 1997 - 1989 == 0 8.5588 7.6040 1.126 0.260348
## 1998 - 1989 == 0 27.1071 13.8879 1.952 0.050956 .
## 1991 - 1990 == 0 11.9553 15.0555 0.794 0.427148
## 1992 - 1990 == 0 5.1008 13.6710 0.373 0.709068
## 1993 - 1990 == 0 4.7442 13.9361 0.340 0.733538
## 1994 - 1990 == 0 7.4108 13.8970 0.533 0.593853
## 1995 - 1990 == 0 23.2477 13.8676 1.676 0.093657 .
## 1996 - 1990 == 0 8.8761 14.3554 0.618 0.536367
## 1997 - 1990 == 0 5.8864 13.8179 0.426 0.670109
## 1998 - 1990 == 0 24.4347 18.2804 1.337 0.181333
## 1992 - 1991 == 0 -6.8545 9.3771 -0.731 0.464789
## 1993 - 1991 == 0 -7.2111 9.4980 -0.759 0.447718
## 1994 - 1991 == 0 -4.5445 9.6806 -0.469 0.638751
## 1995 - 1991 == 0 11.2925 9.8019 1.152 0.249293
## 1996 - 1991 == 0 -3.0791 10.2296 -0.301 0.763412
## 1997 - 1991 == 0 -6.0689 8.9638 -0.677 0.498379
## 1998 - 1991 == 0 12.4794 15.3030 0.815 0.414793
## 1993 - 1992 == 0 -0.3566 7.8551 -0.045 0.963790
## 1994 - 1992 == 0 2.3100 7.7932 0.296 0.766916
## 1995 - 1992 == 0 18.1470 7.6652 2.367 0.017911 *
## 1996 - 1992 == 0 3.7754 8.2423 0.458 0.646917
## 1997 - 1992 == 0 0.7856 7.5923 0.103 0.917585
## 1998 - 1992 == 0 19.3339 13.8951 1.391 0.164098
## 1994 - 1993 == 0 2.6666 8.0552 0.331 0.740613
## 1995 - 1993 == 0 18.5036 8.3018 2.229 0.025823 *
## 1996 - 1993 == 0 4.1320 8.8776 0.465 0.641617
## 1997 - 1993 == 0 1.1422 7.9987 0.143 0.886446
## 1998 - 1993 == 0 19.6905 14.4180 1.366 0.172036
## 1995 - 1994 == 0 15.8370 7.9637 1.989 0.046741 *
## 1996 - 1994 == 0 1.4654 8.4976 0.172 0.863086
## 1997 - 1994 == 0 -1.5244 7.9007 -0.193 0.847006
## 1998 - 1994 == 0 17.0240 14.3210 1.189 0.234543
## 1996 - 1995 == 0 -14.3716 8.2863 -1.734 0.082852 .
## 1997 - 1995 == 0 -17.3614 7.9086 -2.195 0.028146 *
## 1998 - 1995 == 0 1.1870 13.9845 0.085 0.932359
## 1997 - 1996 == 0 -2.9898 8.4655 -0.353 0.723962
## 1998 - 1996 == 0 15.5586 14.2172 1.094 0.273802
## 1998 - 1997 == 0 18.5483 14.2427 1.302 0.192813
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)
Figure2<-grid.arrange(ENSO, Model1_plot, arrangeGrob(
Model2_plot, Model3b_plot, Model4b_plot, widths = c(3.9/12, 3.80/12, 4.30/12), ncol = 3),
nrow=3)
#ggsave(file="Fig1_V7.pdf", plot=Figure2, width=6.69, height=6.69)
FIGURE 2 Illustration of the influence of most intense ENSO events on the coral cover in the ETP. (a) The upper panel indicates the positive (red) and negative (blue) SST anomalies in the Niño-3 region during 1971–2014 (NOAA Climate Prediction Center’s Extended Reconstructed Sea Surface Temperature ERSSTv5). The vertical orange bars indicate the strongest El Niño events. (b) The panel displays, at the horizontal axis, the 44-year live-coral cover aggregated at the region scale (n = 202) for ETP coral reefs with its fitted linear trend (gray dashed band). The fitted smooth line trend represents the long-term cycles of loss and recovery (blue line with the best polynomial fit with a 95% confidence level interval and a span = 0.2). The vertical axis shows the live coral cover. Box plots describe the minimum, maximum, interquartile ranges and median values of live-coral cover for each year. Notice the abrupt decrease in coral cover after 1982–83 El Niño; a smaller decline occurred after 1997–98. Random intercepts and random slopes models for the time-intervals: (c) 1974–1982, (d) 1983–1997, and (e) 1998–2014.
# Load packages
library(tidyverse)
library(dplyr)
library(data.table)
# Select DHW data file: maxDHW.csv
dhw <- read.csv("Data/maxDHW.csv", header=TRUE)
# Exclude years 1981, and 2017-2019
dhw <- dhw[!dhw$Year == 1981, ]
# Create groups for plot
ts.Cano_island <- subset(dhw, dhw$Site == "Cano_island")
ts.Uva_island <- subset(dhw, dhw$Site == "Uva_Island")
ts.Gorgona_island <- subset(dhw, dhw$Site == "Gorgona_Island")
ts.Darwin_island <- subset(dhw, dhw$Site == "Darwin_North_Anchorage")
ts.Bahia_Banderas <- subset(dhw, dhw$Site == "Bahia_Banderas")
dhw.best.represented<-rbind(ts.Cano_island, ts.Uva_island, ts.Gorgona_island,
ts.Darwin_island, ts.Bahia_Banderas)
dhw.best.represented$Thermal_regime<-factor(dhw.best.represented$Site, levels =
c("Cano_island", "Uva_Island", "Gorgona_Island",
"Darwin_North_Anchorage",
"Bahia_Banderas"))
# Figure 3a
Figure3a<-ggplot(dhw.best.represented, aes(x=Year, y=maxDHW,
colour=Thermal_regime)) + theme_bw() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.text.x = element_text(angle = 90, vjust = 0.5),
legend.background = element_blank(),
legend.position = c(0.77,0.77),
legend.title = element_blank(),
legend.text = element_text(size=8))+
ggtitle("a") +
scale_x_continuous(limits = c(1982,2014),
breaks = seq(1982,2014, 1),
expand = c(0.05 , 0.05),
"Years")+
scale_y_continuous(limits = c(0, 28),
breaks = seq(0,28, 4),
"Degree heating weeks (°C-weeks)")+
annotate("rect", xmin = 1982, xmax = 1983.5, ymin = 0, ymax = 28, fill="#fee8c8", alpha = .3)+
annotate("rect", xmin = 1997, xmax = 1998.5, ymin = 0, ymax = 28, fill="#fee8c8", alpha = .3)+
geom_hline(yintercept=4, linetype=2)+
geom_hline(yintercept = 8, linetype=2)+
geom_line() +
scale_colour_manual(values=c("#8c2d04","#feb24c", "#fb6a4a", "#9e9ac8", "#a6d96a"),
labels=c( "Thermally stable - Caño Island",
"Thermally stable - Uva Island",
"Tropical upwelling - Gorgona Island",
"Equatorial upwelling - Darwin Island",
"Seasonal - Bahía Banderas"))
We tested the hypothesis that the strength of the Log_annual_rate_of_change (response variable) is a function of the maxDHW experienced. We had measured the rate of change from four Thermal regimes, and fitted Thermal regimes as a random intercept, and estimate a common slope (change in the rate of change) for maxDHW across all Thermal regimes by fitting it as a fixed effect.
## Load data
roc.cover <- read.csv("Data/RoC_DHW.csv", header=TRUE) ### Select file: RoC_DWH.csv
# Load packages
library(lme4)
library(lmerTest)
library(MuMIn)
model6 <- lmerTest::lmer(Log_annual_rate_of_change ~ maxDHW + (1|Thermal_regime), data=roc.cover)
step(model6)
## Backward reduced random-effect table:
##
## Eliminated npar logLik AIC LRT Df Pr(>Chisq)
## <none> 4 -17.738 43.476
## (1 | Thermal_regime) 0 3 -27.772 61.545 20.069 1 7.469e-06
##
## <none>
## (1 | Thermal_regime) ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Backward reduced fixed-effect table:
## Degrees of freedom method: Satterthwaite
##
## Eliminated Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## maxDHW 0 0.65054 0.65054 1 128.59 9.873 0.002082 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Model found:
## Log_annual_rate_of_change ~ maxDHW + (1 | Thermal_regime)
summary(model6)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Log_annual_rate_of_change ~ maxDHW + (1 | Thermal_regime)
## Data: roc.cover
##
## REML criterion at convergence: 35.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.7962 -0.1472 0.1167 0.4152 1.8621
##
## Random effects:
## Groups Name Variance Std.Dev.
## Thermal_regime (Intercept) 0.02501 0.1581
## Residual 0.06589 0.2567
## Number of obs: 133, groups: Thermal_regime, 4
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) -0.085763 0.084256 3.155381 -1.018 0.38032
## maxDHW -0.016316 0.005193 128.594887 -3.142 0.00208 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr)
## maxDHW -0.165
r.squaredGLMM(model6) # returns the marginal and the conditional R2
## R2m R2c
## [1,] 0.05249512 0.3131505
# marginal R2 describes the proportion of variance explained by the fixed factor(s) alone:
# conditional R2 describes the proportion of variance explained by both the fixed and random factors
# Nakagawa, S. & Schielzeth, H. (2013).
roc.cover$ENSO_Year<-factor(roc.cover$ENSO_Year, levels =
c("No", "1982-1984", "1997-1998"))
roc.cover$Thermal_regime<-factor(roc.cover$Thermal_regime, levels =
c("Thermally stable", "Equatorial upwelling",
"Tropical upwelling", "Seasonal"))
# Figure 3b
Figure3b<-ggplot(roc.cover, aes(x=maxDHW, y=(Log_annual_rate_of_change),
fill=Thermal_regime, shape=ENSO_Year)) +
ggtitle("b") +
scale_x_continuous(limits = c(0,30),
breaks = seq(0,30, 5),
expand = c(0.05 , 0.05),
"Degree heating weeks (°C-weeks)")+
scale_y_continuous(limits = c(-1.7, 1),
breaks = seq(-1.5,1, 0.5),
"Annual rate of change in coral cover")+
geom_point(size=3, alpha=0.5) +
geom_abline(slope = 0, intercept = 0, linetype=2)+
geom_vline(xintercept=4, linetype=2)+
geom_vline(xintercept = 8, linetype=2)+
scale_fill_manual(values=c("#feb24c93", "#9e9ac893", "#fb6a4a93", "#a6d96a93"),
labels=c( "Thermally stable", "Equatorial upwelling", "Tropical upwelling", "Seasonal"))+
scale_shape_manual(values=c(21, 22, 24),
labels=c("No ENSO", "1982-1984", "1997-1998"))+
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.text = element_text(size=8),
legend.title = element_blank(),
legend.position = c(0.68, 0.6),
#legend.position = "right",
legend.background = element_blank())
# Figure3b
grid.arrange(Figure3a, Figure3b, nrow = 1, widths = c(3/5, 2/5))
# ggsave(file="Figure_3.svg", dpi = 300,
# plot=grid.arrange(Figure3a, Figure3b, nrow = 1, widths = c(3/5, 2/5)), width = 12, height = 4, units = "in")
FIGURE 3 Heat stress and its effect on coral cover across the ETP. a The sequence of yearly maximum DHW experienced by the best-represented individual coral reefs sites from 1982 to 2014. When cumulative thermal stress reaches 4°C-weeks and 8°C-weeks or higher (horizontal dotted lines), bleaching is likely, as well as coral mortality from thermal stress (Liu et al., 2006), respectively. Although the thresholds were developed in seasonal systems, and are not universally applicable for equatorial regions, they are still useful for separating responses into groups. b The association between the maximum DHW and the coral cover change at each of four thermal regimes (dot colors as Fig. 2). Each point (n = 133) represents the DHW and the coral cover annual rate of change per individual coral reef site. The horizontal dotted line divides the positive (> 0) and the negative (< 0) rate of change caused by coral growth or mortality, respectively. The vertical dotted line indicates the DHW thresholds of 4°C-weeks and 8°C-weeks, respectively. The vertical and horizontal dotted lines create four response quadrants: I) heat stress and positive coral cover change (resilient response), II) no heat stress and positive coral cover change, III) no heat stress and negative coral cover change, and IV) heat stress and negative coral cover change.
No stress
no.stress <- subset(roc.cover, maxDHW < 4) # subset of DHW < 4
length(no.stress$maxDHW)/length(roc.cover$maxDHW) # ratio no stress: total
## [1] 0.8496241
1- length(no.stress$maxDHW)/length(roc.cover$maxDHW) # ratio stress: total
## [1] 0.1503759
positive.rate <- subset(no.stress, Log_annual_rate_of_change > 0) # subset of Rate > 0
length(positive.rate$Log_annual_rate_of_change) # Number of observations in
## [1] 48
negative.rate <- subset(no.stress, Log_annual_rate_of_change < 0) #subset of Rate > 0
length(negative.rate$Log_annual_rate_of_change) # Number of observations in
## [1] 58
No stress thermally stable
no.stress.Thermally_Stable <- subset(no.stress, Thermal_regime == "Thermally stable")
positive.rate <- subset(no.stress.Thermally_Stable, Log_annual_rate_of_change > 0)
negative.rate <- subset(no.stress.Thermally_Stable, Log_annual_rate_of_change < 0)
length(positive.rate$Log_annual_rate_of_change)/length(negative.rate$Log_annual_rate_of_change)
## [1] 1.2
No stress tropical upwelling
no.stress.upwelling <- subset(no.stress, Thermal_regime == "Tropical upwelling")
positive.rate <- subset(no.stress.upwelling, Log_annual_rate_of_change > 0)
negative.rate <- subset(no.stress.upwelling, Log_annual_rate_of_change < 0)
length(positive.rate$Log_annual_rate_of_change)/length(negative.rate$Log_annual_rate_of_change)
## [1] 1
No stress equatorial upwelling
no.stress.Galapagos_Islands <- subset(no.stress, Thermal_regime == "Equatorial upwelling")
positive.rate <- subset(no.stress.Galapagos_Islands, Log_annual_rate_of_change > 0)
negative.rate <- subset(no.stress.Galapagos_Islands, Log_annual_rate_of_change < 0)
length(positive.rate$Log_annual_rate_of_change)/length(negative.rate$Log_annual_rate_of_change)
## [1] 1
No stress seasonal
no.stress.seasonal <- subset(no.stress, Thermal_regime == "Seasonal")
positive.rate <- subset(no.stress.seasonal, Log_annual_rate_of_change > 0)
negative.rate <- subset(no.stress.seasonal, Log_annual_rate_of_change < 0)
length(positive.rate$Log_annual_rate_of_change)/length(negative.rate$Log_annual_rate_of_change)
## [1] 0.07142857
library(pals)
library(dplyr)
library(reshape2)
library(RColorBrewer)
# Barplot number of surveys per year
obs_num = as.data.frame(table(cover$Year,cover$Region))
colnames(obs_num) = c("Year", "Region", "Freq")
wide_obs_num = dcast(obs_num, Region~Year, value = "Freq")
df = data.matrix(wide_obs_num[,2:45])
as.table(df)
## 1970 1971 1972 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
## A 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## B 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## C 0 0 1 0 0 0 0 0 1 1 0 0 1 0
## D 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## E 0 0 0 0 0 0 0 0 0 1 0 1 0 4
## F 0 0 0 2 3 2 0 0 0 0 0 1 0 1
## G 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## H 3 10 2 12 3 5 3 5 2 5 2 3 5 3
## I 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## J 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## K 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## L 0 0 0 0 0 0 0 2 0 0 0 0 0 0
## M 0 0 0 0 0 0 0 0 0 0 0 1 0 0
## N 2 6 0 2 1 0 0 0 0 0 0 1 4 2
## O 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## P 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998
## A 0 0 0 0 0 0 0 0 0 1 0 0 0 0
## B 0 0 5 0 0 0 0 1 0 0 0 0 0 0
## C 0 0 1 2 4 0 0 1 0 0 2 2 0 4
## D 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## E 12 1 2 0 1 0 0 14 0 5 3 6 0 1
## F 0 1 1 0 1 0 0 0 2 0 0 0 0 0
## G 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## H 4 5 2 4 1 1 0 1 1 1 1 0 1 1
## I 0 0 0 0 0 0 2 0 0 0 0 0 16 10
## J 0 0 1 1 1 0 3 1 1 0 0 0 2 2
## K 0 0 0 0 0 0 0 0 0 0 0 0 2 1
## L 0 0 0 0 0 0 0 0 0 1 1 4 4 2
## M 0 0 0 0 0 0 0 1 0 0 0 0 0 0
## N 0 1 5 1 2 0 1 1 1 1 1 1 1 1
## O 0 0 0 0 0 0 0 0 1 1 0 0 0 0
## P 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
## A 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## B 0 0 0 1 0 0 0 1 0 0 4 0 0 0
## C 7 4 3 4 6 4 3 6 3 2 3 2 2 3
## D 0 0 0 0 0 0 0 0 0 0 0 4 0 1
## E 1 0 5 0 4 2 2 0 1 0 2 0 0 0
## F 0 0 1 1 0 1 3 6 2 2 0 0 1 0
## G 0 0 0 0 0 0 0 0 0 0 1 0 0 0
## H 0 1 1 14 12 1 1 1 1 0 1 2 0 0
## I 0 0 0 6 3 0 1 1 4 0 17 6 2 0
## J 0 0 0 1 2 0 0 0 0 5 7 0 0 1
## K 1 5 5 3 2 0 0 0 0 0 2 0 0 0
## L 0 0 2 0 1 0 1 3 2 0 17 3 1 1
## M 0 0 0 0 0 1 2 14 8 0 0 0 0 1
## N 1 1 1 1 1 1 0 0 0 0 1 0 0 0
## O 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## P 0 0 0 0 0 2 0 0 0 0 0 0 0 0
## 2013 2014
## A 0 0
## B 1 1
## C 2 1
## D 4 2
## E 0 0
## F 0 0
## G 0 0
## H 0 0
## I 2 2
## J 0 0
## K 0 0
## L 1 3
## M 0 0
## N 0 0
## O 0 0
## P 0 0
df[ df>1 ] <- 1
levels(cover$Region) # How many regions? = how many colours
## [1] "Clipperton" "Cocos_Islands"
## [3] "Colombia" "Costa_Rica_Central"
## [5] "Costa_Rica_Southern" "Eastern_Galapagos_Islands"
## [7] "El_Salvador" "Gulf_of_Chiriqui"
## [9] "Mexican_Central" "Mexican_Northern"
## [11] "Mexican_Southern" "Nicaragua_Papagayo_Zone"
## [13] "Northern_Galapagos_Islands" "Panama_Bight"
## [15] "Revillagigedo_Islands" "Western_Galapagos_Islands"
Regions <- c(levels(obs_num$Region))
color.regions = warmcool(17)
# Figure 2a
par(mfcol=c(2,1), cex.main = 1.5, mar = c(4,4,1,1), cex.lab = 1.5, cex.axis = 1, las = 1)
barplot(df,
ylim=c(0,15),
col = color.regions,
ylab="Number of regions surveyed per year",
xlab="Year",
#lwd = 1,
las = 2,
axis.lty = 1,
cex.names = 0.4,
cex.axis = 0.8)
# Legend as a box
legend( #"bottomright",
x = 2, y = 16,
xpd = NA, # or TRUE
legend = Regions,
fill = color.regions[1:17],
inset=c(-0.5,0),
cex = 0.35,
text.font=0.5,
x.intersp = -0.5,
y.intersp = 1,
lwd = 0.1,
bty="n")
# Figure 2b
obs_num = as.data.frame(table(cover$Year,cover$Country)) # Table per country
colnames(obs_num) = c("Year", "Country", "Freq")
wide_obs_num = dcast(obs_num, Country~Year, value = "Freq")
dfc = data.matrix(wide_obs_num[,2:45])
as.table(dfc)
## 1970 1971 1972 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
## A 0 0 1 0 0 0 0 0 1 1 0 0 1 0
## B 0 0 0 0 0 0 0 2 0 1 0 1 0 4
## C 0 0 0 2 3 2 0 0 0 0 0 2 0 1
## D 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## E 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## F 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## G 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## H 5 16 2 14 4 5 3 5 2 5 2 4 9 5
## 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998
## A 0 0 1 2 4 0 0 1 0 0 2 2 0 4
## B 12 1 7 0 1 0 0 15 0 6 4 10 4 3
## C 0 1 1 0 1 0 0 1 2 0 0 0 0 0
## D 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## E 0 0 0 0 0 0 0 0 0 1 0 0 0 0
## F 0 0 1 1 1 0 5 1 2 1 0 0 20 13
## G 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## H 4 6 7 5 3 1 1 2 2 2 2 1 2 2
## 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
## A 7 4 3 4 6 4 3 6 3 2 3 2 2 3
## B 1 0 7 1 5 2 3 4 3 0 12 7 1 2
## C 0 0 1 1 0 4 5 20 10 2 0 0 1 1
## D 0 0 0 0 0 0 0 0 0 0 1 0 0 0
## E 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## F 1 5 5 10 7 0 1 1 4 5 26 6 2 1
## G 0 0 0 0 0 0 0 0 0 0 11 0 0 0
## H 1 2 2 15 13 2 1 1 1 0 2 2 0 0
## 2013 2014
## A 2 1
## B 6 6
## C 0 0
## D 0 0
## E 0 0
## F 2 2
## G 0 0
## H 0 0
dfc[ dfc>1 ] <- 1 # replace all values greater than one with one
color.countries <- brewer.pal(9, "Oranges")
countries = c(levels(obs_num$Country))
barplot(dfc,
col = color.countries,
ylim=c(0,10),
ylab="Number of countries surveyed per year",
xlab="Year",
las = 2,
axis.lty = 1,
cex.names = 0.4,
cex.axis = 0.8)
# Legend as a box
legend( #"bottomright",
x = 2, y = 10,
xpd = NA, # or TRUE
legend = countries,
fill = color.countries[1:9],
inset=c(-0.5,0),
cex = 0.35,
text.font=1,
x.intersp = -0.5,
y.intersp = 1,
lwd = 0.1,
bty="n")
FIGURE S1 Regions and countries surveyed per year. (a) Number of regions surveyed per year in the ETP. Since 1970, the number of surveys in all regions increased by year up to a maximum of 10 regions surveyed in 2009. (b) Number of countries surveyed per year (Colombia, Costa Rica, Ecuador, El Salvador, France, Mexico, Nicaragua and Panama). Since 1970, the number of surveys in all the countries reached a maximum of 6 countries in 2009.
Temporal variation in the live coral cover for 1970–2014.
The smooth line represents the best fit to the time series with a 95% confidence level interval and a span = 0.3.
library(ggplot2)
library(lemon)
aggr.region_S2<-aggr.region
summary(aggr.region_S2$Thermal_regime)
## Thermally stable Tropical upwelling Equatorial upwelling
## 75 75 25
## Seasonal
## 28
aggr.region_S2$Thermal_regime<-factor(aggr.region_S2$Thermal_regime,
levels=c("Thermally stable", "Tropical upwelling",
"Equatorial upwelling", "Seasonal"),
labels = c ("a. Thermally stable", "b. Tropical upwelling",
"c. Equatorial upwelling", "d. Seasonal"))
FigureS2<-ggplot(aggr.region_S2, aes(x=Year, y=Coral_cover)) +
theme_bw() + theme(panel.border = element_blank(), # set ggplot to white background
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_line(),
strip.background = element_blank(),
strip.text = element_text(face="bold",hjust = 0, vjust = -1))+
geom_point()+ geom_smooth (span = 0.3) +
scale_x_continuous(limits=c(1970, 2014),
breaks = seq(1970, 2014, by=5),
expand = c(0.01, 0.01), "Year") +
scale_y_continuous(limits=c(-19, 91), expand = c(0, 0), "Live coral cover (%)") +
facet_wrap(Thermal_regime~., ncol=1, scales = "free_x", strip.position ="top")
FigureS2
#ggsave(file="FigureS2.svg", plot=FigureS2, width=6.69, height=6.69)
FIGURE S2 Temporal variation in the live coral cover for 1970–2014. (a) Thermally stable regime (n = 75). (b) Tropical upwelling regime (n = 75). (c) Equatorial upwelling regime (n = 25). (d) Seasonal regime (n = 28). The smooth line represents the best fit to the time series with a 95% confidence level interval and a span = 0.3.
FigureS2b<-ggplot(aggr.region_S2, aes(x=Year, y=Coral_cover)) +
theme_bw() + theme(panel.border = element_blank(), # set ggplot to white background
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_line(),
strip.background = element_blank(),
strip.text = element_text(face="bold",hjust = 0, vjust = -1))+
geom_smooth (span = 0.3, colour="gray") + geom_point(aes(colour=Region)) +
scale_x_continuous(limits=c(1970, 2014),
breaks = seq(1970, 2014, by=5),
expand = c(0.01, 0.01), "Year") +
scale_y_continuous(limits=c(-19, 91), expand = c(0, 0), "Live coral cover (%)") +
facet_wrap(Thermal_regime~., ncol=1, scales = "free_x", strip.position ="top") +
theme(legend.position = "right", legend.direction = "vertical" )
FigureS2b
#ggsave(file="FigureS2.svg", plot=FigureS2b, width=6.69, height=6.69)
FIGURE S2 Temporal variation in the live coral cover for 1970–2014. (a) Thermally stable regime (n = 75). (b) Tropical upwelling regime (n = 75). (c) Equatorial upwelling regime (n = 25). (d) Seasonal regime (n = 28). The smooth line represents the best fit to the time series with a 95% confidence level interval and a span = 0.3. Colors represent the regions sampled in each thermal regime.
We found in published studies four comprehensive monitoring datasets for Uva Island, Gorgona Island, Costa Rica, and the Eastern and Northern Galapagos Islands, which correspond to well recognized long-term monitoring programs
# Create groups
Uva_Island <- subset(aggr.site, Site == "Uva_Island")
Gorgona <-subset(aggr.site, Site == "La_Azufrada")
Cano_island <-subset(aggr.site, Site == "Cano_island")
EGI <-subset(aggr.site, Region == "Eastern_Galapagos_Islands")
Monitoring_sites <- rbind(Uva_Island,Gorgona,Cano_island,EGI)
Monitoring_sites$Thermal_regime<-factor(Monitoring_sites$Thermal_regime,
levels=c("Thermally stable", "Tropical upwelling",
"Equatorial upwelling", "Seasonal"))
model7 <- lme(Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region, data=Monitoring_sites)
summary(model7)
## Linear mixed-effects model fit by REML
## Data: Monitoring_sites
## AIC BIC logLik
## 736.7157 756.7142 -360.3579
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 0.0007454146 10.93506
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -575.3388 307.9802 1 -1.868103
## Thermal_regimeTropical upwelling 262.8581 520.3591 1 0.505148
## Thermal_regimeEquatorial upwelling 1078.2137 310.2684 1 3.475100
## Year 0.2977 0.1547 90 1.923978
## Thermal_regimeTropical upwelling:Year -0.4036 0.3025 90 -1.334386
## Thermal_regimeEquatorial upwelling:Year -0.8301 0.2195 90 -3.782741
## p-value
## Thermal_regimeThermally stable 0.3129
## Thermal_regimeTropical upwelling 0.7022
## Thermal_regimeEquatorial upwelling 0.1784
## Year 0.0575
## Thermal_regimeTropical upwelling:Year 0.1854
## Thermal_regimeEquatorial upwelling:Year 0.0003
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Year T_Tu:Y
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Year -1.000 0.000 0.000
## Thermal_regimeTropical upwelling:Year 0.511 -0.859 0.000 -0.511
## Thermal_regimeEquatorial upwelling:Year 0.705 0.000 -0.709 -0.705 0.361
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -1.8628050 -0.7098789 -0.1002282 0.6820665 2.4590209
##
## Number of Observations: 96
## Number of Groups: 4
anova(model7)
plot(ranef(model7))
plot(model7)
resnorm7 <- resid(model7)
hist(resnorm7, xlab = "Residuals", main = "")
coef.m7 <- as.data.frame(coef(summary(model7)))
plot(model7, resid(., type = "p") ~ fitted(.) | Region, abline = 0)
plot(model7, Coral_cover ~ fitted(.) | Region, abline = c(0,1))
plot(model7, Coral_cover ~ fitted(.) | Thermal_regime, abline = c(0,1))
summary(Monitoring_sites$Region)
## Clipperton Cocos_Islands
## 0 0
## Colombia Costa_Rica_Central
## 22 0
## Costa_Rica_Southern Eastern_Galapagos_Islands
## 13 28
## El_Salvador Gulf_of_Chiriqui
## 0 33
## Mexican_Central Mexican_Northern
## 0 0
## Mexican_Southern Nicaragua_Papagayo_Zone
## 0 0
## Northern_Galapagos_Islands Panama_Bight
## 0 0
## Revillagigedo_Islands Western_Galapagos_Islands
## 0 0
Monitoring_sites$Region<-factor(Monitoring_sites$Region,
levels=c("Costa_Rica_Southern", "Gulf_of_Chiriqui",
"Colombia", "Eastern_Galapagos_Islands"))
Region.labels <- as_labeller(c(`Costa_Rica_Southern` = "Thermally stable",
`Gulf_of_Chiriqui` = "Thermally stable",
`Colombia` = "Tropical upwelling",
`Eastern_Galapagos_Islands` = "Equatorial upwelling"))
FigureS3 <-ggplot(Monitoring_sites, aes(x=Year, y=Coral_cover)) +
geom_boxplot(aes(group=Year), outlier.shape = NA) +
stat_boxplot(aes(group=Year), geom = 'errorbar')+
geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
scale_y_continuous("Live coral cover (%)", limits = c(-10, 95),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))+
annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1972, xmax = 1973, ymin = 0, ymax = 80, alpha = .2, fill="red")
#FigureS3
FigureS3a<- FigureS3 + geom_point(aes(colour=Thermal_regime), alpha=0.8) +
theme(legend.position = "bottom") + ggtitle("a") +
scale_colour_manual(values=my_colours) +
geom_smooth(span = 0.3, se=T, colour="darkgray")
#FigureS3a
FigureS3b<-FigureS3 + geom_point(aes(colour=Location), alpha=0.8) +
facet_wrap(~Region, labeller=Region.labels)+
geom_smooth(span = 0.3, se=F, colour="darkgray") +
ggtitle("b") + theme(legend.position = "bottom")
#FigureS3b
FigureS3_all<-grid.arrange(arrangeGrob(FigureS3a,FigureS3b,
heights=c(1.2/3, 1.8/3)))
#ggsave(file="FigS3.svg", plot=FigureS3_all, width=6.69, height=7.69)
FIGURE S3 Temporal variation in the live coral cover for 1970–2014 for the four best-represented monitoring locations with its fitted linear trend (red dashed band). (a) Average live-coral cover trend for the four best-represented monitoring locations. (b) Comprehensive monitoring datasets were found in published studies for Costa Rica Southern (Caño Island), Gulf of Chiriquí (Uva Island), Colombia (Gorgona Island), and Eastern Galapagos Islands (Floreana, La Espanola, Marchena, San Cristobal, Santa Cruz, and Santa Fe).
Model 1: All years (1970_2014) removing each thermal regime
model1_Model1_NoThermallyStable <- lme(
Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region,
data=subset(aggr.region, Thermal_regime!="Thermally stable"))
summary(model1_Model1_NoThermallyStable)
## Linear mixed-effects model fit by REML
## Data: subset(aggr.region, Thermal_regime != "Thermally stable")
## AIC BIC logLik
## 1121.751 1144.183 -552.8754
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 14.39849 18.48283
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeTropical upwelling -325.2603 416.3072 7 -0.7812988
## Thermal_regimeEquatorial upwelling 233.0673 642.0373 7 0.3630121
## Thermal_regimeSeasonal 1091.9919 953.7136 7 1.1449893
## Year 0.1794 0.2081 116 0.8620877
## Thermal_regimeEquatorial upwelling:Year -0.2869 0.3827 116 -0.7494770
## Thermal_regimeSeasonal:Year -0.7108 0.5204 116 -1.3659955
## p-value
## Thermal_regimeTropical upwelling 0.4602
## Thermal_regimeEquatorial upwelling 0.7273
## Thermal_regimeSeasonal 0.2898
## Year 0.3904
## Thermal_regimeEquatorial upwelling:Year 0.4551
## Thermal_regimeSeasonal:Year 0.1746
## Correlation:
## Thr_Tu Thr_Eu Thrm_S Year T_Eu:Y
## Thermal_regimeEquatorial upwelling 0.000
## Thermal_regimeSeasonal 0.000 0.000
## Year -1.000 0.000 0.000
## Thermal_regimeEquatorial upwelling:Year 0.544 -0.839 0.000 -0.544
## Thermal_regimeSeasonal:Year 0.400 0.000 -0.917 -0.400 0.217
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.0543416 -0.6676586 -0.0749493 0.6290682 2.7690585
##
## Number of Observations: 128
## Number of Groups: 10
anova(model1_Model1_NoThermallyStable)
Model1_NoThermallyStable <- ggplot(data=subset(aggr.region, Thermal_regime!="Thermally stable"), aes(x=Year, y=Coral_cover)) +
geom_boxplot(aes(group=Year), outlier.shape = NA) +
stat_boxplot(aes(group=Year), geom = 'errorbar')+
geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
geom_smooth(span = 0.2, se=T, colour="darkgray")+
#geom_point(aes(colour=Thermal_regime), alpha=0.5) +
scale_y_continuous("Live coral cover (%)", limits = c(-5, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))+
scale_color_manual(values=my_colours) + labs(title="a")+
#annotate("text", x = 1983, y = 70, label = "*", size=8)+
annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1972, xmax = 1973, ymin = 0, ymax = 80, alpha = .2, fill="red")
# Model1_NoThermallyStable
model1_Model1_NoTropical_Upwelling <- lme(
Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region,
data=subset(aggr.region, Thermal_regime!="Tropical upwelling"))
summary(model1_Model1_NoTropical_Upwelling)
## Linear mixed-effects model fit by REML
## Data: subset(aggr.region, Thermal_regime != "Tropical upwelling")
## AIC BIC logLik
## 1071.526 1093.958 -527.7628
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 7.304633 15.29287
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -383.7268 342.7238 112 -1.1196384
## Thermal_regimeEquatorial upwelling 186.0471 526.2945 11 0.3535038
## Thermal_regimeSeasonal 996.7332 763.3534 112 1.3057296
## Year 0.2043 0.1715 112 1.1908313
## Thermal_regimeEquatorial upwelling:Year -0.2878 0.3144 112 -0.9156186
## Thermal_regimeSeasonal:Year -0.6872 0.4157 112 -1.6532810
## p-value
## Thermal_regimeThermally stable 0.2653
## Thermal_regimeEquatorial upwelling 0.7304
## Thermal_regimeSeasonal 0.1943
## Year 0.2362
## Thermal_regimeEquatorial upwelling:Year 0.3618
## Thermal_regimeSeasonal:Year 0.1011
## Correlation:
## Thr_Ts Thr_Eu Thrm_S Year T_Eu:Y
## Thermal_regimeEquatorial upwelling 0.000
## Thermal_regimeSeasonal 0.016 0.000
## Year -1.000 0.000 -0.017
## Thermal_regimeEquatorial upwelling:Year 0.546 -0.838 0.009 -0.546
## Thermal_regimeSeasonal:Year 0.398 0.000 -0.911 -0.397 0.217
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.17613688 -0.78949307 -0.01633052 0.53848693 2.59536164
##
## Number of Observations: 128
## Number of Groups: 12
anova(model1_Model1_NoTropical_Upwelling)
Model1_NoTropical_Upwelling <- ggplot(data=subset(aggr.region, Thermal_regime!="Tropical upwelling"), aes(x=Year, y=Coral_cover)) +
geom_boxplot(aes(group=Year), outlier.shape = NA) +
stat_boxplot(aes(group=Year), geom = 'errorbar')+
geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
geom_smooth(span = 0.2, se=T, colour="darkgray")+
#geom_point(aes(colour=Thermal_regime), alpha=0.5) +
scale_y_continuous("Live coral cover (%)", limits = c(-5, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))+
scale_color_manual(values=my_colours) + labs(title="b")+
#annotate("text", x = 1983, y = 70, label = "*", size=8)+
annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1972, xmax = 1973, ymin = 0, ymax = 80, alpha = .2, fill="red")
#Model1_NoTropical_Upwelling
model1_Model1_NoEquatorialUpwelling <- lme(
Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region,
data=subset(aggr.region, Thermal_regime!="Equatorial upwelling"))
summary(model1_Model1_NoEquatorialUpwelling)
## Linear mixed-effects model fit by REML
## Data: subset(aggr.region, Thermal_regime != "Equatorial upwelling")
## AIC BIC logLik
## 1519.4 1544.58 -751.7001
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 13.05005 16.25116
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -377.3963 372.0442 161 -1.0143858
## Thermal_regimeTropical upwelling -331.3816 366.4117 12 -0.9043969
## Thermal_regimeSeasonal 1044.5202 831.3348 161 1.2564375
## Year 0.2009 0.1861 161 1.0797967
## Thermal_regimeTropical upwelling:Year -0.0185 0.2611 161 -0.0710180
## Thermal_regimeSeasonal:Year -0.7077 0.4527 161 -1.5632421
## p-value
## Thermal_regimeThermally stable 0.3119
## Thermal_regimeTropical upwelling 0.3836
## Thermal_regimeSeasonal 0.2108
## Year 0.2818
## Thermal_regimeTropical upwelling:Year 0.9435
## Thermal_regimeSeasonal:Year 0.1200
## Correlation:
## Thr_Ts Thr_Tu Thrm_S Year T_Tu:Y
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeSeasonal 0.013 0.000
## Year -1.000 0.000 -0.014
## Thermal_regimeTropical upwelling:Year 0.713 -0.701 0.010 -0.713
## Thermal_regimeSeasonal:Year 0.399 0.000 -0.912 -0.398 0.283
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.33867507 -0.65989684 -0.01749346 0.63243168 3.15005831
##
## Number of Observations: 178
## Number of Groups: 13
anova(model1_Model1_NoEquatorialUpwelling)
Model1_No_EqUpwelling <- ggplot(data=subset(aggr.region, Thermal_regime!="Equatorial upwelling"), aes(x=Year, y=Coral_cover)) +
geom_boxplot(aes(group=Year), outlier.shape = NA) +
stat_boxplot(aes(group=Year), geom = 'errorbar')+
geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
geom_smooth(span = 0.2, se=T, colour="darkgray")+
#geom_point(aes(colour=Thermal_regime), alpha=0.5) +
scale_y_continuous("Live coral cover (%)", limits = c(-5, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))+
scale_color_manual(values=my_colours) + labs(title="c")+
#annotate("text", x = 1983, y = 70, label = "*", size=8)+
annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1972, xmax = 1973, ymin = 0, ymax = 80, alpha = .2, fill="red")
# Model1_No_EqUpwelling
model1_Model1_NoSeasonal <- lme(
Coral_cover ~ -1 + Thermal_regime * Year, random = ~1|Region,
data=subset(aggr.region, Thermal_regime!="Seasonal"))
summary(model1_Model1_NoSeasonal)
## Linear mixed-effects model fit by REML
## Data: subset(aggr.region, Thermal_regime != "Seasonal")
## AIC BIC logLik
## 1501.822 1526.861 -742.9109
##
## Random effects:
## Formula: ~1 | Region
## (Intercept) Residual
## StdDev: 13.68379 16.5809
##
## Fixed effects: Coral_cover ~ -1 + Thermal_regime * Year
## Value Std.Error DF t-value
## Thermal_regimeThermally stable -386.8361 380.4004 11 -1.0169181
## Thermal_regimeTropical upwelling -336.7578 374.1751 11 -0.9000007
## Thermal_regimeEquatorial upwelling 236.1062 576.4625 11 0.4095777
## Year 0.2060 0.1903 159 1.0825575
## Thermal_regimeTropical upwelling:Year -0.0210 0.2668 159 -0.0786044
## Thermal_regimeEquatorial upwelling:Year -0.3151 0.3455 159 -0.9118227
## p-value
## Thermal_regimeThermally stable 0.3310
## Thermal_regimeTropical upwelling 0.3874
## Thermal_regimeEquatorial upwelling 0.6900
## Year 0.2806
## Thermal_regimeTropical upwelling:Year 0.9374
## Thermal_regimeEquatorial upwelling:Year 0.3632
## Correlation:
## Thr_Ts Thr_Tu Thr_Eu Year T_Tu:Y
## Thermal_regimeTropical upwelling 0.000
## Thermal_regimeEquatorial upwelling 0.000 0.000
## Year -1.000 0.000 0.000
## Thermal_regimeTropical upwelling:Year 0.713 -0.701 0.000 -0.713
## Thermal_regimeEquatorial upwelling:Year 0.551 0.000 -0.835 -0.551 0.393
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.29410007 -0.67127700 -0.01898876 0.68352406 3.08803534
##
## Number of Observations: 175
## Number of Groups: 14
anova(model1_Model1_NoSeasonal)
Model1_NoSeasonal <- ggplot(data=subset(aggr.region, Thermal_regime!="Seasonal"), aes(x=Year, y=Coral_cover)) +
geom_boxplot(aes(group=Year), outlier.shape = NA) +
stat_boxplot(aes(group=Year), geom = 'errorbar')+
geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
geom_smooth(span = 0.2, se=T, colour="darkgray")+
#geom_point(aes(colour=Thermal_regime), alpha=0.5) +
scale_y_continuous("Live coral cover (%)", limits = c(-5, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))+
scale_color_manual(values=my_colours) + labs(title="d")+
#annotate("text", x = 1983, y = 70, label = "*", size=8)+
annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80, alpha = .2, fill="red")+
annotate("rect", xmin = 1972, xmax = 1973, ymin = 0, ymax = 80, alpha = .2, fill="red")
#Model1_NoSeasonal
FigureS4<-grid.arrange(Model1_NoThermallyStable, Model1_NoTropical_Upwelling,
Model1_No_EqUpwelling, Model1_NoSeasonal,
ncol = 2)
#ggsave(file="FigS4.pdf", plot=FigureS5, width=6.69, height=6.69)
Figure S4: Coral cover trends excluding (a) Thermally stable, (b) Tropical upwelling, (c) Equatorial upwelling, and (d) Seasonal thermal regimes
To use “bootMer” models need to be run with lme4 instead of nlme. Please check accuracy of the new (b) models
# 1. Build lme4 model:
model1b <- lmer(
Coral_cover ~ Thermal_regime * Year +
(1|Region), data=aggr.region, REML = FALSE)
summary(model1b)
## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: Coral_cover ~ Thermal_regime * Year + (1 | Region)
## Data: aggr.region
##
## AIC BIC logLik deviance df.resid
## 1757.4 1790.5 -868.7 1737.4 193
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.27927 -0.72367 -0.01805 0.63561 3.09102
##
## Random effects:
## Groups Name Variance Std.Dev.
## Region (Intercept) 95.09 9.751
## Residual 272.58 16.510
## Number of obs: 203, groups: Region, 16
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) -376.66123 373.68559 201.99026
## Thermal_regimeTropical upwelling 113.26629 524.31829 202.24674
## Thermal_regimeEquatorial upwelling 588.01224 682.19129 197.01240
## Thermal_regimeSeasonal 1389.07741 907.62131 202.83558
## Year 0.20069 0.18698 201.75471
## Thermal_regimeTropical upwelling:Year -0.05175 0.26224 202.06878
## Thermal_regimeEquatorial upwelling:Year -0.29705 0.34139 196.60807
## Thermal_regimeSeasonal:Year -0.69147 0.45351 202.75097
## t value Pr(>|t|)
## (Intercept) -1.008 0.315
## Thermal_regimeTropical upwelling 0.216 0.829
## Thermal_regimeEquatorial upwelling 0.862 0.390
## Thermal_regimeSeasonal 1.530 0.127
## Year 1.073 0.284
## Thermal_regimeTropical upwelling:Year -0.197 0.844
## Thermal_regimeEquatorial upwelling:Year -0.870 0.385
## Thermal_regimeSeasonal:Year -1.525 0.129
##
## Correlation of Fixed Effects:
## (Intr) Thr_Tu Thr_Eu Thrm_S Year T_Tu:Y T_Eu:Y
## Thrml_rgmTu -0.713
## Thrml_rgmEu -0.548 0.390
## Thrml_rgmSs -0.397 0.283 0.218
## Year -1.000 0.713 0.548 0.397
## Thrml_rTu:Y 0.713 -1.000 -0.391 -0.283 -0.713
## Thrml_rEu:Y 0.548 -0.390 -1.000 -0.217 -0.548 0.391
## Thrml_rgS:Y 0.398 -0.283 -0.218 -1.000 -0.397 0.283 0.217
anova(model1b) # Thermal regime is not significant anymore??
ranova(model1b) # Region seems the only significant effect
drop1(model1b)
Not sure if this if right since the model itself is not significant
# 2. Predict values:
pred1 <- predict(model1b, re.form = NA)
#3. Bootstrap CI:
boot1 <- bootMer(model1b, predict, nsim = 1000, re.form = NULL) # include random effects, reduce CI a lot!
std.err <- apply(boot1$t, 2, sd)
CI.lo_1 <- pred1 - std.err*1.96
CI.hi_1 <- pred1 + std.err*1.96
#Plot
Model1b_plot<- ggplot(
aggr.region, aes(x = Year, y = Coral_cover, colour = Thermal_regime)) +
geom_line(aes(y = pred1),size=2) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2, stroke = 0.3, alpha=0.5) +
geom_ribbon(aes(ymin = CI.lo_1, ymax = CI.hi_1),
size=2, alpha = 0.03, linetype = 0) +
scale_color_manual(values=my_colours) +
scale_fill_manual(values=my_colours) +
scale_y_continuous("Live coral cover (%)",
limits = c(-20, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1969, 2015),
breaks = seq(1970, 2014, by=2), expand = c(0,0))
Model1b_plot
Not enough data
# 1. Build lme4 model:
model3b <- lmer(
Coral_cover ~ Thermal_regime * Year +
(1|Region), data=ENSO.83_97, REML = FALSE)
summary(model3b)
## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: Coral_cover ~ Thermal_regime * Year + (1 | Region)
## Data: ENSO.83_97
##
## AIC BIC logLik deviance df.resid
## 506.7 528.6 -243.4 486.7 56
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.0485 -0.5244 -0.0721 0.4890 3.2655
##
## Random effects:
## Groups Name Variance Std.Dev.
## Region (Intercept) 13.12 3.622
## Residual 84.48 9.191
## Number of obs: 66, groups: Region, 10
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) -2085.2528 849.2084 60.0798
## Thermal_regimeTropical upwelling -5020.5691 1187.3127 62.4593
## Thermal_regimeEquatorial upwelling 2197.0397 2802.4619 57.5480
## Thermal_regimeSeasonal 8274.4993 2002.6425 63.4562
## Year 1.0546 0.4267 60.0267
## Thermal_regimeTropical upwelling:Year 2.5355 0.5963 62.4179
## Thermal_regimeEquatorial upwelling:Year -1.1105 1.4097 57.5416
## Thermal_regimeSeasonal:Year -4.1450 1.0053 63.4138
## t value Pr(>|t|)
## (Intercept) -2.456 0.016978 *
## Thermal_regimeTropical upwelling -4.229 7.82e-05 ***
## Thermal_regimeEquatorial upwelling 0.784 0.436274
## Thermal_regimeSeasonal 4.132 0.000107 ***
## Year 2.472 0.016307 *
## Thermal_regimeTropical upwelling:Year 4.252 7.22e-05 ***
## Thermal_regimeEquatorial upwelling:Year -0.788 0.434073
## Thermal_regimeSeasonal:Year -4.123 0.000111 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Thr_Tu Thr_Eu Thrm_S Year T_Tu:Y T_Eu:Y
## Thrml_rgmTu -0.715
## Thrml_rgmEu -0.303 0.217
## Thrml_rgmSs -0.414 0.296 0.125
## Year -1.000 0.715 0.303 0.414
## Thrml_rTu:Y 0.716 -1.000 -0.217 -0.296 -0.716
## Thrml_rEu:Y 0.303 -0.216 -1.000 -0.125 -0.303 0.217
## Thrml_rgS:Y 0.414 -0.296 -0.126 -1.000 -0.414 0.296 0.125
anova(model3b) # Thermal regime and its interaction with year are significant
ranova(model3b) # random effects are not
drop1(model3b)
# 2. Predict values:
pred3 <- predict(model3b, re.form = NA)
#3. Bootstrap CI:
boot3 <- bootMer(model3b, predict, nsim = 1000, re.form = NA) # No random effects
std.err <- apply(boot3$t, 2, sd)
CI.lo_3 <- pred3 - std.err*1.96
CI.hi_3 <- pred3 + std.err*1.96
#Plot
Model3b_plot<- ggplot(
ENSO.83_97, aes(x = Year, y = Coral_cover, colour = Thermal_regime))+
geom_line(aes(y = pred3),size=2) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2, stroke = 0.3, alpha=0.5) +
geom_ribbon(aes(ymin = CI.lo_3, ymax = CI.hi_3),
size=2, alpha = 0.03, linetype = 0) +
scale_fill_manual(values=my_colours)+
scale_colour_manual(values=my_colours) +
scale_x_continuous("", limits = c(1982.7, 1998.2),
breaks = seq(1983, 1997, by=2),
expand = c(0.02,0.02))+
scale_y_continuous("Live coral cover (%)",
limits = c(-20, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))
Model3b_plot
#ggsave(file="Model3b_plot.png", plot=Model3b_plot, width=4, height=4)
#ggsave(file="Model3b_plot.pdf", plot=Model3b_plot, width=4, height=4)
# 1. Build lme4 model:
model4b <- lmer(
Coral_cover ~ Thermal_regime * Year +
(1|Region), data=ENSO.98_14, REML = FALSE)
summary(model4b)
## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: Coral_cover ~ Thermal_regime * Year + (1 | Region)
## Data: ENSO.98_14
##
## AIC BIC logLik deviance df.resid
## 896.3 922.8 -438.2 876.3 94
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9576 -0.5586 -0.0027 0.2837 2.7825
##
## Random effects:
## Groups Name Variance Std.Dev.
## Region (Intercept) 81.54 9.03
## Residual 228.45 15.11
## Number of obs: 104, groups: Region, 12
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) -1723.2489 1349.0589 103.8734
## Thermal_regimeTropical upwelling 4931.1394 1694.6395 103.9964
## Thermal_regimeEquatorial upwelling -397.0246 3139.2328 96.2899
## Thermal_regimeSeasonal 1958.6900 2050.7623 100.1819
## Year 0.8727 0.6728 103.8861
## Thermal_regimeTropical upwelling:Year -2.4541 0.8449 103.9980
## Thermal_regimeEquatorial upwelling:Year 0.1964 1.5650 96.2689
## Thermal_regimeSeasonal:Year -0.9740 1.0221 100.0849
## t value Pr(>|t|)
## (Intercept) -1.277 0.20432
## Thermal_regimeTropical upwelling 2.910 0.00442 **
## Thermal_regimeEquatorial upwelling -0.126 0.89962
## Thermal_regimeSeasonal 0.955 0.34182
## Year 1.297 0.19747
## Thermal_regimeTropical upwelling:Year -2.904 0.00449 **
## Thermal_regimeEquatorial upwelling:Year 0.126 0.90037
## Thermal_regimeSeasonal:Year -0.953 0.34293
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Thr_Tu Thr_Eu Thrm_S Year T_Tu:Y T_Eu:Y
## Thrml_rgmTu -0.796
## Thrml_rgmEu -0.430 0.342
## Thrml_rgmSs -0.651 0.519 0.280
## Year -1.000 0.796 0.430 0.651
## Thrml_rTu:Y 0.796 -1.000 -0.342 -0.519 -0.796
## Thrml_rEu:Y 0.430 -0.342 -1.000 -0.280 -0.430 0.342
## Thrml_rgS:Y 0.651 -0.519 -0.280 -1.000 -0.651 0.519 0.280
anova(model4b) # Thermal regime and its interaction with year are significant
ranova(model4b) # random effects are significant
drop1(model4b)
# 2. Predict values:
pred4 <- predict(model4b, re.form = NA)
#3. Bootstrap CI:
boot4 <- bootMer(model4b, predict, nsim = 1000, re.form = NULL) # Include random effects
std.err <- apply(boot4$t, 2, sd)
CI.lo_4 <- pred4 - std.err*1.96
CI.hi_4 <- pred4 + std.err*1.96
#Plot
Model4b_plot<- ggplot(ENSO.98_14, aes(
x = Year, y = Coral_cover, colour = Thermal_regime)) +
geom_line(aes(y = pred4),size=2) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2,
stroke = 0.3, alpha=0.5) +
geom_ribbon(aes(ymin = CI.lo_4, ymax = CI.hi_4),size=2,
alpha = 0.03, linetype = 0) +
scale_y_continuous("Live coral cover (%)",
limits = c(-20, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1997.7, 2014.3),
breaks = seq(1998, 2014, by=2), expand = c(0.02,0.02))+
scale_color_manual(values=my_colours) +
scale_fill_manual(values=my_colours)
Model4b_plot
#ggsave(file="Model4b_plot.png", plot=Model4b_plot, width=4, height=4)
#ggsave(file="Model4b_plot.pdf", plot=Model4b_plot, width=4, height=4)
# 1. Build lme4 model:
model5b <- lmer(
Coral_cover ~ Thermal_regime * Year +
(1|Region), data=ENSO.83_14, REML = FALSE)
summary(model5b)
## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: Coral_cover ~ Thermal_regime * Year + (1 | Region)
## Data: ENSO.83_14
##
## AIC BIC logLik deviance df.resid
## 1453.3 1484.7 -716.7 1433.3 160
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.4879 -0.5122 -0.1008 0.4671 3.0884
##
## Random effects:
## Groups Name Variance Std.Dev.
## Region (Intercept) 95.58 9.777
## Residual 235.87 15.358
## Number of obs: 170, groups: Region, 13
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) -1793.4643 507.5993 163.9918
## Thermal_regimeTropical upwelling 1908.5107 710.6627 168.1130
## Thermal_regimeEquatorial upwelling 334.0786 1027.8011 166.7244
## Thermal_regimeSeasonal 2795.1759 921.5719 168.5964
## Year 0.9080 0.2538 163.7270
## Thermal_regimeTropical upwelling:Year -0.9480 0.3551 167.9676
## Thermal_regimeEquatorial upwelling:Year -0.1683 0.5134 166.5944
## Thermal_regimeSeasonal:Year -1.3932 0.4604 168.3969
## t value Pr(>|t|)
## (Intercept) -3.533 0.000533 ***
## Thermal_regimeTropical upwelling 2.686 0.007967 **
## Thermal_regimeEquatorial upwelling 0.325 0.745557
## Thermal_regimeSeasonal 3.033 0.002804 **
## Year 3.578 0.000455 ***
## Thermal_regimeTropical upwelling:Year -2.670 0.008338 **
## Thermal_regimeEquatorial upwelling:Year -0.328 0.743526
## Thermal_regimeSeasonal:Year -3.026 0.002866 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Thr_Tu Thr_Eu Thrm_S Year T_Tu:Y T_Eu:Y
## Thrml_rgmTu -0.714
## Thrml_rgmEu -0.494 0.353
## Thrml_rgmSs -0.536 0.383 0.265
## Year -1.000 0.714 0.494 0.536
## Thrml_rTu:Y 0.715 -1.000 -0.353 -0.383 -0.715
## Thrml_rEu:Y 0.494 -0.353 -1.000 -0.265 -0.494 0.353
## Thrml_rgS:Y 0.536 -0.383 -0.265 -1.000 -0.536 0.383 0.265
anova(model5b) # Thermal regime and its interaction with year are significant
ranova(model5b) # random effects are significant
drop1(model5b)
# 2. Predict values:
pred5 <- predict(model5b,re.form = NA)
#3. Bootstrap CI:
boot5 <- bootMer(model5b, predict, nsim = 1000, re.form = NULL) # Include random effects
std.err <- apply(boot5$t, 2, sd)
CI.lo_5 <- pred5 - std.err*1.96
CI.hi_5 <- pred5 + std.err*1.96
#Plot
Model5b_plot<- ggplot(ENSO.83_14, aes(
x = Year, y = Coral_cover, colour = Thermal_regime)) +
geom_line(aes(y = pred5),size=2) +
geom_point(aes(fill=factor(Thermal_regime)),
shape = 21, colour = "black", size = 2,
stroke = 0.3, alpha=0.5) +
geom_ribbon(aes(ymin = CI.lo_5, ymax = CI.hi_5),size=2,
alpha = 0.03, linetype = 0) +
scale_y_continuous("Live coral cover (%)",
limits = c(-20, 90),
breaks = seq(0, 90, by=20), expand = c(0,0))+
scale_x_continuous("", limits = c(1983, 2014.3),
breaks = seq(1983, 2014, by=2), expand = c(0.02,0.02))+
scale_color_manual(values=my_colours) +
scale_fill_manual(values=my_colours)
Model5b_plot
#ggsave(file="Model5b_plot.png", plot=Model4b_plot, width=4, height=4)
# Creates bibliography
#knitr::write_bib(c(.packages()), "packages.bib")
Auguie, Baptiste. 2017. GridExtra: Miscellaneous Functions for “Grid” Graphics. https://CRAN.R-project.org/package=gridExtra.
Bartoń, Kamil. 2019. MuMIn: Multi-Model Inference. https://CRAN.R-project.org/package=MuMIn.
Bates, Douglas, and Martin Maechler. 2019. Matrix: Sparse and Dense Matrix Classes and Methods. https://CRAN.R-project.org/package=Matrix.
Bates, Douglas, Martin Maechler, Ben Bolker, and Steven Walker. 2019. Lme4: Linear Mixed-Effects Models Using ’Eigen’ and S4. https://CRAN.R-project.org/package=lme4.
Dowle, Matt, and Arun Srinivasan. 2019. Data.table: Extension of ‘Data.frame‘. https://CRAN.R-project.org/package=data.table.
Edwards, Stefan McKinnon. 2019. Lemon: Freshing up Your ’Ggplot2’ Plots. https://CRAN.R-project.org/package=lemon.
Genz, Alan, Frank Bretz, Tetsuhisa Miwa, Xuefei Mi, and Torsten Hothorn. 2019. Mvtnorm: Multivariate Normal and T Distributions. https://CRAN.R-project.org/package=mvtnorm.
Henry, Lionel, and Hadley Wickham. 2019. Purrr: Functional Programming Tools. https://CRAN.R-project.org/package=purrr.
Hothorn, Torsten. 2019. TH.data: TH’s Data Archive. https://CRAN.R-project.org/package=TH.data.
Hothorn, Torsten, Frank Bretz, and Peter Westfall. 2019. Multcomp: Simultaneous Inference in General Parametric Models. https://CRAN.R-project.org/package=multcomp.
Kuznetsova, Alexandra, Per Bruun Brockhoff, and Rune Haubo Bojesen Christensen. 2019. LmerTest: Tests in Linear Mixed Effects Models. https://CRAN.R-project.org/package=lmerTest.
Müller, Kirill, and Hadley Wickham. 2019. Tibble: Simple Data Frames. https://CRAN.R-project.org/package=tibble.
Neuwirth, Erich. 2014. RColorBrewer: ColorBrewer Palettes. https://CRAN.R-project.org/package=RColorBrewer.
Pinheiro, José, Douglas Bates, and R-core. 2019. Nlme: Linear and Nonlinear Mixed Effects Models. https://CRAN.R-project.org/package=nlme.
R Core Team. 2020. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Richard A. Becker, Original S code by, Allan R. Wilks. R version by Ray Brownrigg. Enhancements by Thomas P Minka, and Alex Deckmyn. 2018. Maps: Draw Geographical Maps. https://CRAN.R-project.org/package=maps.
Ripley, Brian. 2019. MASS: Support Functions and Datasets for Venables and Ripley’s Mass. https://CRAN.R-project.org/package=MASS.
Therneau, Terry M. 2019. Survival: Survival Analysis. https://CRAN.R-project.org/package=survival.
Wickham, Hadley. 2017a. Reshape2: Flexibly Reshape Data: A Reboot of the Reshape Package. https://CRAN.R-project.org/package=reshape2.
———. 2017b. Tidyverse: Easily Install and Load the ’Tidyverse’. https://CRAN.R-project.org/package=tidyverse.
———. 2019a. Forcats: Tools for Working with Categorical Variables (Factors). https://CRAN.R-project.org/package=forcats.
———. 2019b. Stringr: Simple, Consistent Wrappers for Common String Operations. https://CRAN.R-project.org/package=stringr.
Wickham, Hadley, and Lionel Henry. 2020. Tidyr: Tidy Messy Data. https://CRAN.R-project.org/package=tidyr.
Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, and Hiroaki Yutani. 2019. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics. https://CRAN.R-project.org/package=ggplot2.
Wickham, Hadley, Romain François, Lionel Henry, and Kirill Müller. 2019. Dplyr: A Grammar of Data Manipulation. https://CRAN.R-project.org/package=dplyr.
Wickham, Hadley, Jim Hester, and Romain Francois. 2018. Readr: Read Rectangular Text Data. https://CRAN.R-project.org/package=readr.
Wright, Kevin. 2018. Pals: Color Palettes, Colormaps, and Tools to Evaluate Them. https://CRAN.R-project.org/package=pals.