greenhouse_df <- read_csv("greenhouse_6point.csv",
col_types = cols(gh = col_factor(levels = c("1",
"2", "3", "4", "5", "6")), year = col_factor(levels = c("2022",
"2024")), source = col_factor(levels = c("kop",
"bio"))))
plot(greenhouse_df$gh, greenhouse_df$crith_prop)
plot(greenhouse_df$gh, greenhouse_df$api_prop)
plot(greenhouse_df$gh, greenhouse_df$average_bruise)
plot(greenhouse_df$total_pesticide_applied_ml, greenhouse_df$crith_prop)
plot(greenhouse_df$total_pesticide_applied_ml, greenhouse_df$api_prop)
plot(greenhouse_df$total_pesticide_applied_ml, greenhouse_df$average_bruise)
plot(greenhouse_df$total_fung, greenhouse_df$crith_prop)
plot(greenhouse_df$total_fung, greenhouse_df$api_prop)
plot(greenhouse_df$total_fung, greenhouse_df$average_bruise)
plot(greenhouse_df$total_insec, greenhouse_df$crith_prop)
plot(greenhouse_df$total_insec, greenhouse_df$api_prop)
plot(greenhouse_df$total_insec, greenhouse_df$average_bruise)
plot(greenhouse_df$avg_hives_in_phase, greenhouse_df$crith_prop)
plot(greenhouse_df$avg_hives_in_phase, greenhouse_df$api_prop)
plot(greenhouse_df$avg_hives_in_phase, greenhouse_df$average_bruise)
# List of your logical treatment variables
treat_vars <- c("azaguard", "botanigard_22wp", "botanigard_es", "captiva_prime", "nofly", "venerate_cg", "m_pede", "rootshield_plus", "lalstop_k61", "beleaf_50sg", "coragen", "entrust_sc", "pylon", "grotto", "luna_tranquility", "previcur_flex", "fontelis", "quadristop", "milstop")
# Reshape the data to long format
greenhouse_long <- greenhouse_df %>%
pivot_longer(cols = all_of(treat_vars),
names_to = "treatment",
values_to = "applied")
# Create boxplots of crith_prop vs each treatment
ggplot(greenhouse_long, aes(x = applied, y = crith_prop)) +
geom_point() +
facet_wrap(~ treatment)
ggplot(greenhouse_long, aes(x = applied, y = api_prop)) +
geom_point() +
facet_wrap(~ treatment)
ggplot(greenhouse_long, aes(x = applied, y = average_bruise)) +
geom_point() +
facet_wrap(~ treatment)
## Long data and logical data transform ##
greenhouse_long$applied_L <- ifelse(greenhouse_long$applied == 0, 0, 1)
greenhouse_long$applied_L <- as.logical(greenhouse_long$applied_L)
chem_cols <- c(
"azaguard","botanigard_22wp","botanigard_es","captiva_prime","nofly",
"venerate_cg","m_pede","rootshield_plus","lalstop_k61","beleaf_50sg",
"coragen","entrust_sc","pylon","grotto","luna_tranquility",
"previcur_flex","fontelis","quadristop","milstop"
)
greenhouse_df[paste0(chem_cols, "_L")] <-
lapply(greenhouse_df[chem_cols], function(x) x > 0)
chem_info <- data.frame(
pesticide = c(
"coragen_L","lalstop_k61_L","previcur_flex_L","pylon_L","luna_tranquility_L",
"rootshield_plus_L","milstop_L","quadristop_L","azaguard_L","botanigard_22wp_L",
"botanigard_es_L","captiva_prime_L","fontelis_L","m_pede_L","nofly_L",
"venerate_cg_L","beleaf_50sg_L","entrust_sc_L","grotto_L"
),
type = c(
"insecticide","fungicide","fungicide","insecticide","fungicide",
"fungicide","fungicide","fungicide","insecticide","insecticide",
"insecticide","insecticide","fungicide","insecticide","insecticide",
"insecticide","insecticide","insecticide","fungicide"
),
mode = c(
"synthetic","biological","synthetic","synthetic","synthetic",
"biological","synthetic","synthetic","biological","biological",
"biological","biological","synthetic","biological","biological",
"biological","synthetic","synthetic","synthetic"
)
)
chem_info$type <- factor(chem_info$type,
levels = c("insecticide", "fungicide"))
chem_info$mode <- factor(chem_info$mode,
levels = c("biological", "synthetic"))
chem_info <- chem_info[order(chem_info$type, chem_info$mode), ]
# Create combined classification
chem_info$class <- paste(chem_info$type, chem_info$mode, sep = "_")
chem_info <- chem_info[order(chem_info$mode), ]
# Four colors
chem_colors <- c(
"insecticide_synthetic" = "brown4",
"insecticide_biological" = "orchid1",
"fungicide_synthetic" = "deepskyblue4",
"fungicide_biological" = "lightskyblue"
)
mod_1 <- glm(
cbind(crith_pos, crith_neg) ~
total_insec_bio,
data = greenhouse_df,
family = binomial("logit"))
Anova(mod_1)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_insec_bio 31.002 1 2.578e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(mod_1)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_insec_bio,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.197e-01 1.138e-01 -1.931 0.0535 .
## total_insec_bio 4.885e-06 8.852e-07 5.518 3.42e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 211.42 on 4 degrees of freedom
## AIC: 245.32
##
## Number of Fisher Scoring iterations: 4
mod_2 <- glm(
cbind(crith_pos, crith_neg) ~
total_insec_synth,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_2)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_insec_synth,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -5.105e-01 1.035e-01 -4.933 8.12e-07 ***
## total_insec_synth 1.926e-04 2.063e-05 9.336 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 129.36 on 4 degrees of freedom
## AIC: 163.26
##
## Number of Fisher Scoring iterations: 4
Anova(mod_2)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_insec_synth 113.06 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_3 <- glm(
cbind(crith_pos, crith_neg) ~
total_fung_bio,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_3)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_fung_bio, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 4.045e-01 7.840e-02 5.159 2.48e-07 ***
## total_fung_bio -5.049e-05 1.664e-05 -3.034 0.00241 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 233.14 on 4 degrees of freedom
## AIC: 267.04
##
## Number of Fisher Scoring iterations: 4
Anova(mod_3)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_fung_bio 9.2818 1 0.002314 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_4 <- glm(
cbind(crith_pos, crith_neg) ~
total_fung_synth,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_4)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_fung_synth,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -6.470e-01 1.272e-01 -5.086 3.66e-07 ***
## total_fung_synth 2.895e-05 3.518e-06 8.231 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 158.72 on 4 degrees of freedom
## AIC: 192.62
##
## Number of Fisher Scoring iterations: 5
Anova(mod_4)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_fung_synth 83.703 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_5 <- glm(
cbind(crith_pos, crith_neg) ~
total_insec,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_5)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_insec, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.799e-01 1.162e-01 -2.408 0.016 *
## total_insec 5.242e-06 8.761e-07 5.983 2.19e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 205.84 on 4 degrees of freedom
## AIC: 239.74
##
## Number of Fisher Scoring iterations: 4
Anova(mod_5)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_insec 36.584 1 1.462e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_6 <- glm(
cbind(crith_pos, crith_neg) ~
total_fung,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_6)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_fung, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -6.139e-01 1.316e-01 -4.664 3.10e-06 ***
## total_fung 2.596e-05 3.411e-06 7.612 2.69e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 171.46 on 4 degrees of freedom
## AIC: 205.36
##
## Number of Fisher Scoring iterations: 5
Anova(mod_6)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_fung 70.956 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_7 <- glm(
cbind(crith_pos, crith_neg) ~
total_bio,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_7)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_bio, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.593e-01 1.187e-01 -2.185 0.0289 *
## total_bio 5.150e-06 9.229e-07 5.580 2.4e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 210.69 on 4 degrees of freedom
## AIC: 244.59
##
## Number of Fisher Scoring iterations: 4
Anova(mod_7)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_bio 31.733 1 1.769e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_8 <- glm(
cbind(crith_pos, crith_neg) ~
total_synth,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_8)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_synth, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -8.729e-01 1.349e-01 -6.468 9.91e-11 ***
## total_synth 3.182e-05 3.378e-06 9.419 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 131.86 on 4 degrees of freedom
## AIC: 165.76
##
## Number of Fisher Scoring iterations: 5
Anova(mod_8)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_synth 110.56 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_9 <- glm(
cbind(crith_pos, crith_neg) ~
total_pesticide_applied_ml,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_9)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ total_pesticide_applied_ml,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.005e+00 1.607e-01 -6.254 4e-10 ***
## total_pesticide_applied_ml 8.920e-06 9.932e-07 8.982 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 155.38 on 4 degrees of freedom
## AIC: 189.28
##
## Number of Fisher Scoring iterations: 4
Anova(mod_9)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## total_pesticide_applied_ml 87.04 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mods <- list(
total_insec_bio = mod_1,
total_insec_synth = mod_2,
total_fung_bio = mod_3,
total_fung_synth = mod_4,
total_insec = mod_5,
total_fung = mod_6,
total_bio = mod_7,
total_synth = mod_8,
total_pesticide_applied_ml =mod_9
)
summary_table <- do.call(rbind, lapply(names(mods), function(name){
m <- mods[[name]]
s <- summary(m)
coef_row <- s$coefficients[2, ]
lr <- Anova(m)$`LR Chisq`[1]
LRT <- Anova(m)$'Pr(>Chisq)'[1]
data.frame(
Pesticide = name,
Estimate = coef_row["Estimate"],
SE = coef_row["Std. Error"],
z = coef_row["z value"],
p = coef_row["Pr(>|z|)"],
LR_ChiSq = lr,
LRT = LRT,
AIC = AIC(m),
Residual_Deviance = m$deviance
)
}))
summary_table$SE <- signif(summary_table$SE, 3)
summary_table$z <- round(summary_table$z, 2)
summary_table$p <- signif(summary_table$p, 3)
summary_table$LR_ChiSq <- round(summary_table$LR_ChiSq, 2)
summary_table$AIC <- round(summary_table$AIC, 2)
summary_table$Residual_Deviance <- round(summary_table$Residual_Deviance, 2)
summary_table$LRT <- signif(summary_table$LRT, 3)
summary_table
## Pesticide Estimate SE z p
## Estimate total_insec_bio 4.884611e-06 8.85e-07 5.52 3.42e-08
## Estimate1 total_insec_synth 1.925799e-04 2.06e-05 9.34 9.97e-21
## Estimate2 total_fung_bio -5.048614e-05 1.66e-05 -3.03 2.41e-03
## Estimate3 total_fung_synth 2.895352e-05 3.52e-06 8.23 1.86e-16
## Estimate4 total_insec 5.241708e-06 8.76e-07 5.98 2.19e-09
## Estimate5 total_fung 2.596364e-05 3.41e-06 7.61 2.69e-14
## Estimate6 total_bio 5.150110e-06 9.23e-07 5.58 2.40e-08
## Estimate7 total_synth 3.181950e-05 3.38e-06 9.42 4.57e-21
## Estimate8 total_pesticide_applied_ml 8.920285e-06 9.93e-07 8.98 2.67e-19
## LR_ChiSq LRT AIC Residual_Deviance
## Estimate 31.00 2.58e-08 245.32 211.42
## Estimate1 113.06 2.09e-26 163.26 129.36
## Estimate2 9.28 2.31e-03 267.04 233.14
## Estimate3 83.70 5.75e-20 192.62 158.72
## Estimate4 36.58 1.46e-09 239.74 205.84
## Estimate5 70.96 3.65e-17 205.36 171.46
## Estimate6 31.73 1.77e-08 244.59 210.69
## Estimate7 110.56 7.40e-26 165.76 131.86
## Estimate8 87.04 1.06e-20 189.28 155.38
dfs <- as.data.frame(summary_table)
dfs
## Pesticide Estimate SE z p
## Estimate total_insec_bio 4.884611e-06 8.85e-07 5.52 3.42e-08
## Estimate1 total_insec_synth 1.925799e-04 2.06e-05 9.34 9.97e-21
## Estimate2 total_fung_bio -5.048614e-05 1.66e-05 -3.03 2.41e-03
## Estimate3 total_fung_synth 2.895352e-05 3.52e-06 8.23 1.86e-16
## Estimate4 total_insec 5.241708e-06 8.76e-07 5.98 2.19e-09
## Estimate5 total_fung 2.596364e-05 3.41e-06 7.61 2.69e-14
## Estimate6 total_bio 5.150110e-06 9.23e-07 5.58 2.40e-08
## Estimate7 total_synth 3.181950e-05 3.38e-06 9.42 4.57e-21
## Estimate8 total_pesticide_applied_ml 8.920285e-06 9.93e-07 8.98 2.67e-19
## LR_ChiSq LRT AIC Residual_Deviance
## Estimate 31.00 2.58e-08 245.32 211.42
## Estimate1 113.06 2.09e-26 163.26 129.36
## Estimate2 9.28 2.31e-03 267.04 233.14
## Estimate3 83.70 5.75e-20 192.62 158.72
## Estimate4 36.58 1.46e-09 239.74 205.84
## Estimate5 70.96 3.65e-17 205.36 171.46
## Estimate6 31.73 1.77e-08 244.59 210.69
## Estimate7 110.56 7.40e-26 165.76 131.86
## Estimate8 87.04 1.06e-20 189.28 155.38
predictors <- c(
"total_insec_bio",
"total_insec_synth",
"total_fung_bio",
"total_fung_synth",
"total_insec",
"total_fung",
"total_bio",
"total_synth",
"total_pesticide_applied_ml"
)
labels <- c(
"Biological Insecticide (ml)",
"Synthetic Insecticide (ml)",
"Biological Fungicide (ml)",
"Synthetic Fungicide (ml)",
"Total Insecticides (ml)",
"Total Fungicides (ml)",
"Total Biological Pesticides (ml)",
"Total Synthetic Pesticides (ml)",
"Total Pesticides Applied (ml)"
)
greenhouse_df$crith_se <- sqrt(
(greenhouse_df$crith_prop * (1 - greenhouse_df$crith_prop)) /
(greenhouse_df$crith_pos + greenhouse_df$crith_neg)
)
plots <- lapply(seq_along(predictors), function(i){
var <- predictors[i]
label <- labels[i]
stats_row <- summary_table[summary_table$Pesticide == var, ]
annot_text <- paste0(
"χ² = ", (stats_row$LR_ChiSq),
", P = ", (stats_row$LRT))
ggplot(greenhouse_df, aes_string(x = var, y = "crith_prop")) +
geom_point(size = 3, alpha = 0.8) +
geom_smooth(method = "glm",
method.args = list(family = "binomial"),
se = TRUE,
color = "black") +
geom_errorbar(aes(ymin = crith_prop - crith_se,
ymax = crith_prop + crith_se),
width = 0) +
labs(
x = label,
y = "Crithidia infection proportion"
) +
theme_classic(base_size = 14) +
annotate(
"text",
x = min(greenhouse_df[[var]]) + 500,
y = 1,
label = annot_text,
hjust = 0, vjust = 1, size = 4
)
})
## Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
## ℹ Please use tidy evaluation idioms with `aes()`.
## ℹ See also `vignette("ggplot2-in-packages")` for more information.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
wrap_plots(plots, ncol = 2)
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
mod_azaguard <- glm(
cbind(crith_pos, crith_neg) ~ azaguard_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_azaguard)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ azaguard_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.2955 0.1167 -2.531 0.0114 *
## azaguard_LTRUE 0.8890 0.1449 6.137 8.4e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 204.05 on 4 degrees of freedom
## AIC: 237.95
##
## Number of Fisher Scoring iterations: 4
Anova(mod_azaguard)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## azaguard_L 38.371 1 5.849e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_botanigard_22wp <- glm(
cbind(crith_pos, crith_neg) ~ botanigard_22wp_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_botanigard_22wp)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ botanigard_22wp_L,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.2955 0.1167 -2.531 0.0114 *
## botanigard_22wp_LTRUE 0.8890 0.1449 6.137 8.4e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 204.05 on 4 degrees of freedom
## AIC: 237.95
##
## Number of Fisher Scoring iterations: 4
Anova(mod_botanigard_22wp)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## botanigard_22wp_L 38.371 1 5.849e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_botanigard_es <- glm(
cbind(crith_pos, crith_neg) ~ botanigard_es_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_botanigard_es)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ botanigard_es_L,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.50013 0.09244 5.410 6.29e-08 ***
## botanigard_es_LTRUE -0.47481 0.13665 -3.475 0.000511 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 230.29 on 4 degrees of freedom
## AIC: 264.19
##
## Number of Fisher Scoring iterations: 3
Anova(mod_botanigard_es)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## botanigard_es_L 12.134 1 0.000495 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_captiva_prime <- glm(
cbind(crith_pos, crith_neg) ~ captiva_prime_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_captiva_prime)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ captiva_prime_L,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.2955 0.1167 -2.531 0.0114 *
## captiva_prime_LTRUE 0.8890 0.1449 6.137 8.4e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 204.05 on 4 degrees of freedom
## AIC: 237.95
##
## Number of Fisher Scoring iterations: 4
Anova(mod_captiva_prime)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## captiva_prime_L 38.371 1 5.849e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_nofly <- glm(
cbind(crith_pos, crith_neg) ~ nofly_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_nofly)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ nofly_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.2955 0.1167 -2.531 0.0114 *
## nofly_LTRUE 0.8890 0.1449 6.137 8.4e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 204.05 on 4 degrees of freedom
## AIC: 237.95
##
## Number of Fisher Scoring iterations: 4
Anova(mod_nofly)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## nofly_L 38.371 1 5.849e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_venerate_cg <- glm(
cbind(crith_pos, crith_neg) ~ venerate_cg_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_venerate_cg)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ venerate_cg_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.14425 0.08968 -1.609 0.108
## venerate_cg_LTRUE 1.02694 0.14260 7.202 5.95e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 188.26 on 4 degrees of freedom
## AIC: 222.16
##
## Number of Fisher Scoring iterations: 4
Anova(mod_venerate_cg)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## venerate_cg_L 54.162 1 1.846e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_m_pede <- glm(
cbind(crith_pos, crith_neg) ~ m_pede_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_m_pede)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ m_pede_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.2955 0.1167 -2.531 0.0114 *
## m_pede_LTRUE 0.8890 0.1449 6.137 8.4e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 204.05 on 4 degrees of freedom
## AIC: 237.95
##
## Number of Fisher Scoring iterations: 4
Anova(mod_m_pede)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## m_pede_L 38.371 1 5.849e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_rootshield_plus <- glm(
cbind(crith_pos, crith_neg) ~ rootshield_plus_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_rootshield_plus)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ rootshield_plus_L,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.25497 0.07654 3.331 0.000864 ***
## rootshield_plus_LTRUE 0.14212 0.16359 0.869 0.384969
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 241.66 on 4 degrees of freedom
## AIC: 275.56
##
## Number of Fisher Scoring iterations: 4
Anova(mod_rootshield_plus)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## rootshield_plus_L 0.75854 1 0.3838
mod_lalstop_k61 <- glm(
cbind(crith_pos, crith_neg) ~ lalstop_k61_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_lalstop_k61)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ lalstop_k61_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.63304 0.07987 7.926 2.26e-15 ***
## lalstop_k61_LTRUE -1.53544 0.17497 -8.776 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 157.44 on 4 degrees of freedom
## AIC: 191.34
##
## Number of Fisher Scoring iterations: 4
Anova(mod_lalstop_k61)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## lalstop_k61_L 84.983 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_beleaf_50sg <- glm(
cbind(crith_pos, crith_neg) ~ beleaf_50sg_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_beleaf_50sg)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ beleaf_50sg_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.11235 0.07598 -1.479 0.139
## beleaf_50sg_LTRUE 2.54377 0.27160 9.366 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.420 on 5 degrees of freedom
## Residual deviance: 95.039 on 4 degrees of freedom
## AIC: 128.94
##
## Number of Fisher Scoring iterations: 4
Anova(mod_beleaf_50sg)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## beleaf_50sg_L 147.38 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_coragen <- glm(
cbind(crith_pos, crith_neg) ~ coragen_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_coragen)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ coragen_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.08004 0.14153 0.566 0.5717
## coragen_LTRUE 0.26683 0.16118 1.655 0.0978 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 239.69 on 4 degrees of freedom
## AIC: 273.59
##
## Number of Fisher Scoring iterations: 4
Anova(mod_coragen)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## coragen_L 2.7331 1 0.09829 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_entrust_sc <- glm(
cbind(crith_pos, crith_neg) ~ entrust_sc_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_entrust_sc)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ entrust_sc_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.11235 0.07598 -1.479 0.139
## entrust_sc_LTRUE 2.54377 0.27160 9.366 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.420 on 5 degrees of freedom
## Residual deviance: 95.039 on 4 degrees of freedom
## AIC: 128.94
##
## Number of Fisher Scoring iterations: 4
Anova(mod_entrust_sc)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## entrust_sc_L 147.38 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_pylon <- glm(
cbind(crith_pos, crith_neg) ~ pylon_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_pylon)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ pylon_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.59356 0.08577 6.920 4.51e-12 ***
## pylon_LTRUE -0.88903 0.14486 -6.137 8.40e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 204.05 on 4 degrees of freedom
## AIC: 237.95
##
## Number of Fisher Scoring iterations: 4
Anova(mod_pylon)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## pylon_L 38.371 1 5.849e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_grotto <- glm(
cbind(crith_pos, crith_neg) ~ grotto_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_grotto)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ grotto_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.11235 0.07598 -1.479 0.139
## grotto_LTRUE 2.54377 0.27160 9.366 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.420 on 5 degrees of freedom
## Residual deviance: 95.039 on 4 degrees of freedom
## AIC: 128.94
##
## Number of Fisher Scoring iterations: 4
Anova(mod_grotto)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## grotto_L 147.38 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_luna_tranquility <- glm(
cbind(crith_pos, crith_neg) ~ luna_tranquility_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_luna_tranquility)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ luna_tranquility_L,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.26415 0.08278 3.191 0.00142 **
## luna_tranquility_LTRUE 0.06659 0.14352 0.464 0.64267
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 242.20 on 4 degrees of freedom
## AIC: 276.11
##
## Number of Fisher Scoring iterations: 4
Anova(mod_luna_tranquility)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## luna_tranquility_L 0.21553 1 0.6425
mod_previcur_flex <- glm(
cbind(crith_pos, crith_neg) ~ previcur_flex_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_previcur_flex)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ previcur_flex_L,
## family = binomial("logit"), data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.4314 0.2608 9.324 <2e-16 ***
## previcur_flex_LTRUE -2.5438 0.2716 -9.366 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.420 on 5 degrees of freedom
## Residual deviance: 95.039 on 4 degrees of freedom
## AIC: 128.94
##
## Number of Fisher Scoring iterations: 4
Anova(mod_previcur_flex)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## previcur_flex_L 147.38 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_fontelis <- glm(
cbind(crith_pos, crith_neg) ~ fontelis_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_fontelis)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ fontelis_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.34687 0.07712 4.498 6.86e-06 ***
## fontelis_LTRUE -0.26683 0.16118 -1.655 0.0978 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 239.69 on 4 degrees of freedom
## AIC: 273.59
##
## Number of Fisher Scoring iterations: 4
Anova(mod_fontelis)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## fontelis_L 2.7331 1 0.09829 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_quadristop <- glm(
cbind(crith_pos, crith_neg) ~ quadristop_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_quadristop)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ quadristop_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.2175 0.0714 3.046 0.00232 **
## quadristop_LTRUE 0.6637 0.2321 2.860 0.00424 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 233.71 on 4 degrees of freedom
## AIC: 267.61
##
## Number of Fisher Scoring iterations: 4
Anova(mod_quadristop)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## quadristop_L 8.7121 1 0.003161 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod_milstop <- glm(
cbind(crith_pos, crith_neg) ~ milstop_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod_milstop)
##
## Call:
## glm(formula = cbind(crith_pos, crith_neg) ~ milstop_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.2175 0.0714 3.046 0.00232 **
## milstop_LTRUE 0.6637 0.2321 2.860 0.00424 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 242.42 on 5 degrees of freedom
## Residual deviance: 233.71 on 4 degrees of freedom
## AIC: 267.61
##
## Number of Fisher Scoring iterations: 4
Anova(mod_milstop)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(crith_pos, crith_neg)
## LR Chisq Df Pr(>Chisq)
## milstop_L 8.7121 1 0.003161 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.crith <- list(
azaguard = mod_azaguard,
botanigard_22wp = mod_botanigard_22wp,
botanigard_es = mod_botanigard_es,
captiva_prime = mod_captiva_prime,
nofly = mod_nofly,
venerate_cg = mod_venerate_cg,
m_pede = mod_m_pede,
rootshield_plus = mod_rootshield_plus,
lalstop_k61 = mod_lalstop_k61,
beleaf_50sg = mod_beleaf_50sg,
coragen = mod_coragen,
entrust_sc = mod_entrust_sc,
pylon = mod_pylon,
grotto = mod_grotto,
luna_tranquility = mod_luna_tranquility,
previcur_flex = mod_previcur_flex,
fontelis = mod_fontelis,
quadristop = mod_quadristop,
milstop = mod_milstop
)
summary_table.crith <- do.call(rbind, lapply(names(mod.crith), function(name){
m <- mod.crith[[name]]
s <- summary(m)
coef_row <- s$coefficients[2, ]
lr <- Anova(m)$`LR Chisq`[1]
LRT <- Anova(m)$'Pr(>Chisq)'[1]
data.frame(
Pesticide = name,
Estimate = coef_row["Estimate"],
SE = coef_row["Std. Error"],
z = coef_row["z value"],
p = coef_row["Pr(>|z|)"],
LR_ChiSq = lr,
LRT = LRT,
AIC = AIC(m),
Residual_Deviance = m$deviance
)
}))
summary_table.crith$Estimate <- signif(summary_table.crith$Estimate,3)
summary_table.crith$SE <- signif(summary_table.crith$SE,3)
summary_table.crith$z <- round(summary_table.crith$z,2)
summary_table.crith$p <- signif(summary_table.crith$p,3)
summary_table.crith$LR_ChiSq <- round(summary_table.crith$LR_ChiSq,2)
summary_table.crith$AIC <- round(summary_table.crith$AIC,2)
summary_table.crith$Residual_Deviance <- round(summary_table.crith$Residual_Deviance,2)
summary_table.crith$LRT <- signif(summary_table.crith$LRT,2)
summary_table.crith
## Pesticide Estimate SE z p LR_ChiSq LRT
## Estimate azaguard 0.8890 0.145 6.14 8.40e-10 38.37 5.8e-10
## Estimate1 botanigard_22wp 0.8890 0.145 6.14 8.40e-10 38.37 5.8e-10
## Estimate2 botanigard_es -0.4750 0.137 -3.47 5.11e-04 12.13 5.0e-04
## Estimate3 captiva_prime 0.8890 0.145 6.14 8.40e-10 38.37 5.8e-10
## Estimate4 nofly 0.8890 0.145 6.14 8.40e-10 38.37 5.8e-10
## Estimate5 venerate_cg 1.0300 0.143 7.20 5.95e-13 54.16 1.8e-13
## Estimate6 m_pede 0.8890 0.145 6.14 8.40e-10 38.37 5.8e-10
## Estimate7 rootshield_plus 0.1420 0.164 0.87 3.85e-01 0.76 3.8e-01
## Estimate8 lalstop_k61 -1.5400 0.175 -8.78 1.70e-18 84.98 3.0e-20
## Estimate9 beleaf_50sg 2.5400 0.272 9.37 7.55e-21 147.38 6.5e-34
## Estimate10 coragen 0.2670 0.161 1.66 9.78e-02 2.73 9.8e-02
## Estimate11 entrust_sc 2.5400 0.272 9.37 7.55e-21 147.38 6.5e-34
## Estimate12 pylon -0.8890 0.145 -6.14 8.40e-10 38.37 5.8e-10
## Estimate13 grotto 2.5400 0.272 9.37 7.55e-21 147.38 6.5e-34
## Estimate14 luna_tranquility 0.0666 0.144 0.46 6.43e-01 0.22 6.4e-01
## Estimate15 previcur_flex -2.5400 0.272 -9.37 7.55e-21 147.38 6.5e-34
## Estimate16 fontelis -0.2670 0.161 -1.66 9.78e-02 2.73 9.8e-02
## Estimate17 quadristop 0.6640 0.232 2.86 4.24e-03 8.71 3.2e-03
## Estimate18 milstop 0.6640 0.232 2.86 4.24e-03 8.71 3.2e-03
## AIC Residual_Deviance
## Estimate 237.95 204.05
## Estimate1 237.95 204.05
## Estimate2 264.19 230.29
## Estimate3 237.95 204.05
## Estimate4 237.95 204.05
## Estimate5 222.16 188.26
## Estimate6 237.95 204.05
## Estimate7 275.56 241.66
## Estimate8 191.34 157.44
## Estimate9 128.94 95.04
## Estimate10 273.59 239.69
## Estimate11 128.94 95.04
## Estimate12 237.95 204.05
## Estimate13 128.94 95.04
## Estimate14 276.11 242.20
## Estimate15 128.94 95.04
## Estimate16 273.59 239.69
## Estimate17 267.61 233.71
## Estimate18 267.61 233.71
csdf <- as.data.frame(summary_table.crith)
predictors <- c(
"azaguard_L",
"botanigard_22wp_L",
"botanigard_es_L",
"captiva_prime_L",
"nofly_L",
"venerate_cg_L",
"m_pede_L",
"rootshield_plus_L",
"lalstop_k61_L",
"beleaf_50sg_L",
"coragen_L",
"entrust_sc_L",
"pylon_L",
"grotto_L",
"luna_tranquility_L",
"previcur_flex_L",
"fontelis_L",
"quadristop_L",
"milstop_L"
)
greenhouse_df$crith_prop <- greenhouse_df$crith_pos /
(greenhouse_df$crith_pos + greenhouse_df$crith_neg)
greenhouse_df$crith_se <- sqrt(
(greenhouse_df$crith_prop * (1 - greenhouse_df$crith_prop)) /
(greenhouse_df$crith_pos + greenhouse_df$crith_neg)
)
plots <- lapply(predictors, function(var){
ggplot(greenhouse_df, aes_string(x = var, y = "crith_prop")) +
geom_boxplot(width = 0.5, alpha = 0.6, outlier.shape = NA) +
geom_jitter(width = 0.1, size = 3, alpha = 0.8) +
labs(
x = var,
y = "Crithidia infection proportion"
) +
theme_classic(base_size = 14) +
scale_x_discrete(labels = c("FALSE" = "Not applied", "TRUE" = "Applied"))
})
wrap_plots(plots, ncol = 4)
plots <- lapply(1:nrow(chem_info), function(i){
chem_type <- chem_info$type[i]
chem_mode <- chem_info$mode[i]
var <- chem_info$pesticide[i]
chem_class <- chem_info$class[i]
var2 <- gsub("_L$", "", chem_info$pesticide[i]) # remove _L at end
stats_row <- summary_table.crith[summary_table.crith$Pesticide == var2, ]
annot_text <- paste0(
"LRT χ² = ", round(stats_row$LR_ChiSq, 2),
", p = ", signif(stats_row$LRT, 3))
ggplot(greenhouse_df, aes_string(x = var, y = "crith_prop")) +
geom_boxplot(fill = chem_colors[chem_class],
alpha = 0.6,
width = 0.5,
outlier.shape = NA) +
geom_jitter(width = 0.1, size = 3, alpha = 0.8) +
labs(
title = gsub("_L","",var),
subtitle = paste(chem_type, "-", chem_mode),
x = "",
y = "Probability of Crithidia Detection"
) +
scale_x_discrete(labels = c("FALSE"="Not applied","TRUE"="Applied")) +
theme_classic(base_size = 16) +
annotate(
"text",
x = 2, y = 1.05, # top-right
label = annot_text,
hjust = 1, vjust = 1, size = 4
) +
coord_cartesian(ylim = c(0, 1))
})
wrap_plots(plots, ncol = 4)
mod.a_1 <- glm(
cbind(api_pos, api_neg) ~
total_insec_bio,
data = greenhouse_df,
family = binomial("logit"))
Anova(mod.a_1)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_insec_bio 10.598 1 0.001132 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(mod.a_1)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_insec_bio, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.432e+00 1.443e-01 -9.926 < 2e-16 ***
## total_insec_bio -3.970e-06 1.216e-06 -3.266 0.00109 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 203.18 on 4 degrees of freedom
## AIC: 225.57
##
## Number of Fisher Scoring iterations: 6
mod.a_2 <- glm(
cbind(api_pos, api_neg) ~
total_insec_synth,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_2)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_insec_synth, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -4.114e-01 1.431e-01 -2.876 0.00403 **
## total_insec_synth -5.638e-04 6.166e-05 -9.144 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.783 on 5 degrees of freedom
## Residual deviance: 64.045 on 4 degrees of freedom
## AIC: 86.427
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_2)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_insec_synth 149.74 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_3 <- glm(
cbind(api_pos, api_neg) ~
total_fung_bio,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_3)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_fung_bio, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.882e+00 1.129e-01 -16.663 <2e-16 ***
## total_fung_bio 2.683e-05 2.225e-05 1.206 0.228
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 212.39 on 4 degrees of freedom
## AIC: 234.77
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_3)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_fung_bio 1.3956 1 0.2375
mod.a_4 <- glm(
cbind(api_pos, api_neg) ~
total_fung_synth,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_4)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_fung_synth, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.670e+00 1.655e-01 -10.092 <2e-16 ***
## total_fung_synth -4.377e-06 4.158e-06 -1.053 0.292
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 212.64 on 4 degrees of freedom
## AIC: 235.02
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_4)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_fung_synth 1.1437 1 0.2849
mod.a_5 <- glm(
cbind(api_pos, api_neg) ~
total_insec,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_5)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_insec, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.370e+00 1.451e-01 -9.440 < 2e-16 ***
## total_insec -4.467e-06 1.202e-06 -3.718 0.000201 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 199.99 on 4 degrees of freedom
## AIC: 222.37
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_5)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_insec 13.797 1 0.0002037 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_6 <- glm(
cbind(api_pos, api_neg) ~
total_fung,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_6)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_fung, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.695e+00 1.712e-01 -9.899 <2e-16 ***
## total_fung -3.373e-06 4.043e-06 -0.834 0.404
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.07 on 4 degrees of freedom
## AIC: 235.45
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_6)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_fung 0.71414 1 0.3981
mod.a_7 <- glm(
cbind(api_pos, api_neg) ~
total_bio,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_7)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_bio, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.397e+00 1.503e-01 -9.295 < 2e-16 ***
## total_bio -4.229e-06 1.268e-06 -3.335 0.000854 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 202.72 on 4 degrees of freedom
## AIC: 225.1
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_7)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_bio 11.066 1 0.0008791 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_8 <- glm(
cbind(api_pos, api_neg) ~
total_synth,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_8)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_synth, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.422e+00 1.731e-01 -8.218 <2e-16 ***
## total_synth -1.084e-05 4.225e-06 -2.565 0.0103 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 206.65 on 4 degrees of freedom
## AIC: 229.03
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_8)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_synth 7.1304 1 0.007579 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_9 <- glm(
cbind(api_pos, api_neg) ~
total_pesticide_applied_ml,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_8)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ total_synth, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.422e+00 1.731e-01 -8.218 <2e-16 ***
## total_synth -1.084e-05 4.225e-06 -2.565 0.0103 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 206.65 on 4 degrees of freedom
## AIC: 229.03
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_8)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## total_synth 7.1304 1 0.007579 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.as <- list(
total_insec_bio = mod.a_1,
total_insec_synth = mod.a_2,
total_fung_bio = mod.a_3,
total_fung_synth = mod.a_4,
total_insec = mod.a_5,
total_fung = mod.a_6,
total_bio = mod.a_7,
total_synth = mod.a_8,
total_pesticide_applied_ml = mod.a_9
)
library(car)
summary_table.a <- do.call(rbind, lapply(names(mod.as), function(name){
m <- mod.as[[name]]
s <- summary(m)
coef_row <- s$coefficients[2, ] # predictor row
lr <- Anova(m)$`LR Chisq`[1]
LRT <- Anova(m)$'Pr(>Chisq)'[1]
data.frame(
Predictor = name,
Estimate = coef_row["Estimate"],
SE = coef_row["Std. Error"],
z = coef_row["z value"],
p = coef_row["Pr(>|z|)"],
LR_ChiSq = lr,
AIC = AIC(m),
LRT = LRT,
Residual_Deviance = m$deviance
)
}))
summary_table.a$SE <- signif(summary_table.a$SE, 3)
summary_table.a$z <- round(summary_table.a$z, 2)
summary_table.a$p <- signif(summary_table.a$p, 3)
summary_table.a$LR_ChiSq <- round(summary_table.a$LR_ChiSq, 2)
summary_table.a$AIC <- round(summary_table.a$AIC, 2)
summary_table.a$Residual_Deviance <- round(summary_table.a$Residual_Deviance, 2)
summary_table.a$LRT <- signif(summary_table.a$LRT, 3)
stadf <- as.data.frame(summary_table.a)
stadf
## Predictor Estimate SE z p
## Estimate total_insec_bio -3.969935e-06 1.22e-06 -3.27 1.09e-03
## Estimate1 total_insec_synth -5.638185e-04 6.17e-05 -9.14 6.01e-20
## Estimate2 total_fung_bio 2.683130e-05 2.23e-05 1.21 2.28e-01
## Estimate3 total_fung_synth -4.377410e-06 4.16e-06 -1.05 2.92e-01
## Estimate4 total_insec -4.467409e-06 1.20e-06 -3.72 2.01e-04
## Estimate5 total_fung -3.373247e-06 4.04e-06 -0.83 4.04e-01
## Estimate6 total_bio -4.228517e-06 1.27e-06 -3.33 8.54e-04
## Estimate7 total_synth -1.083672e-05 4.22e-06 -2.56 1.03e-02
## Estimate8 total_pesticide_applied_ml -5.370165e-06 1.25e-06 -4.28 1.86e-05
## LR_ChiSq AIC LRT Residual_Deviance
## Estimate 10.60 225.57 1.13e-03 203.18
## Estimate1 149.74 86.43 1.98e-34 64.05
## Estimate2 1.40 234.77 2.37e-01 212.39
## Estimate3 1.14 235.02 2.85e-01 212.64
## Estimate4 13.80 222.37 2.04e-04 199.99
## Estimate5 0.71 235.45 3.98e-01 213.07
## Estimate6 11.07 225.10 8.79e-04 202.72
## Estimate7 7.13 229.03 7.58e-03 206.65
## Estimate8 17.95 218.22 2.27e-05 195.83
predictors <- c(
"total_insec_bio",
"total_insec_synth",
"total_fung_bio",
"total_fung_synth",
"total_insec",
"total_fung",
"total_bio",
"total_synth",
"total_pesticide_applied_ml"
)
greenhouse_df$api_se <- sqrt(
(greenhouse_df$api_prop * (1 - greenhouse_df$api_prop)) /
(greenhouse_df$api_pos + greenhouse_df$api_neg)
)
plots <- lapply(seq_along(predictors), function(i){
var <- predictors[i]
label <- labels[i]
stats_row <- summary_table.a[summary_table.a$Predictor == var, ]
annot_text <- paste0(
"χ² = ", (stats_row$LR_ChiSq),
", P = ", (stats_row$LRT))
ggplot(greenhouse_df, aes_string(x = var, y = "api_prop")) +
geom_point(size = 3, alpha = 0.8) +
geom_smooth(method = "glm",
method.args = list(family = "binomial"),
se = TRUE,
color = "black") +
geom_errorbar(aes(ymin = api_prop - api_se,
ymax = api_prop + api_se),
width = 0) +
labs(
x = var,
y = "Probability of Apicystis Detection"
) +
theme_classic(base_size = 14) +
annotate(
"text",
x = min(greenhouse_df[[var]]) + 500,
y = 1,
label = annot_text,
hjust = 0, vjust = 1, size = 4
)
})
wrap_plots(plots, ncol = 2)
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## `geom_smooth()` using formula = 'y ~ x'
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
mod.a_azaguard <- glm(
cbind(api_pos, api_neg) ~ azaguard_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_azaguard)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ azaguard_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7346 0.1617 -10.728 <2e-16 ***
## azaguard_LTRUE -0.1236 0.2015 -0.614 0.539
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.41 on 4 degrees of freedom
## AIC: 235.79
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_azaguard)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## azaguard_L 0.37344 1 0.5411
mod.a_botanigard_22wp <- glm(
cbind(api_pos, api_neg) ~ botanigard_22wp_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_botanigard_22wp)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ botanigard_22wp_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7346 0.1617 -10.728 <2e-16 ***
## botanigard_22wp_LTRUE -0.1236 0.2015 -0.614 0.539
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.41 on 4 degrees of freedom
## AIC: 235.79
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_botanigard_22wp)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## botanigard_22wp_L 0.37344 1 0.5411
mod.a_botanigard_es <- glm(
cbind(api_pos, api_neg) ~ botanigard_es_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_botanigard_es)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ botanigard_es_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.3092 0.1563 -14.774 < 2e-16 ***
## botanigard_es_LTRUE 0.9387 0.2003 4.687 2.77e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 190.83 on 4 degrees of freedom
## AIC: 213.21
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_botanigard_es)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## botanigard_es_L 22.958 1 1.656e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_captiva_prime <- glm(
cbind(api_pos, api_neg) ~ captiva_prime_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_captiva_prime)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ captiva_prime_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7346 0.1617 -10.728 <2e-16 ***
## captiva_prime_LTRUE -0.1236 0.2015 -0.614 0.539
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.41 on 4 degrees of freedom
## AIC: 235.79
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_captiva_prime)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## captiva_prime_L 0.37344 1 0.5411
mod.a_nofly <- glm(
cbind(api_pos, api_neg) ~ nofly_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_nofly)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ nofly_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7346 0.1617 -10.728 <2e-16 ***
## nofly_LTRUE -0.1236 0.2015 -0.614 0.539
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.41 on 4 degrees of freedom
## AIC: 235.79
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_nofly)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## nofly_L 0.37344 1 0.5411
mod.a_venerate_cg <- glm(
cbind(api_pos, api_neg) ~ venerate_cg_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_venerate_cg)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ venerate_cg_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.0986 0.1033 -10.637 <2e-16 ***
## venerate_cg_LTRUE -20.8817 1813.9497 -0.012 0.991
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.783 on 5 degrees of freedom
## Residual deviance: 52.926 on 4 degrees of freedom
## AIC: 75.307
##
## Number of Fisher Scoring iterations: 16
Anova(mod.a_venerate_cg)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## venerate_cg_L 160.86 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_m_pede <- glm(
cbind(api_pos, api_neg) ~ m_pede_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_m_pede)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ m_pede_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7346 0.1617 -10.728 <2e-16 ***
## m_pede_LTRUE -0.1236 0.2015 -0.614 0.539
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.41 on 4 degrees of freedom
## AIC: 235.79
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_m_pede)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## m_pede_L 0.37344 1 0.5411
mod.a_rootshield_plus <- glm(
cbind(api_pos, api_neg) ~ rootshield_plus_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_rootshield_plus)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ rootshield_plus_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7817 0.1081 -16.484 <2e-16 ***
## rootshield_plus_LTRUE -0.1585 0.2396 -0.661 0.508
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.34 on 4 degrees of freedom
## AIC: 235.72
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_rootshield_plus)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## rootshield_plus_L 0.44747 1 0.5035
mod.a_lalstop_k61 <- glm(
cbind(api_pos, api_neg) ~ lalstop_k61_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_lalstop_k61)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ lalstop_k61_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.9659 0.1158 -16.975 < 2e-16 ***
## lalstop_k61_LTRUE 0.5734 0.2112 2.714 0.00664 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 206.78 on 4 degrees of freedom
## AIC: 229.16
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_lalstop_k61)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## lalstop_k61_L 7.0039 1 0.008133 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_beleaf_50sg <- glm(
cbind(api_pos, api_neg) ~ beleaf_50sg_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_beleaf_50sg)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ beleaf_50sg_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.51732 0.09876 -15.36 <2e-16 ***
## beleaf_50sg_LTRUE -18.47059 943.71566 -0.02 0.984
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 145.52 on 4 degrees of freedom
## AIC: 167.91
##
## Number of Fisher Scoring iterations: 14
Anova(mod.a_beleaf_50sg)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## beleaf_50sg_L 68.259 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_coragen <- glm(
cbind(api_pos, api_neg) ~ coragen_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_coragen)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ coragen_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.4055 0.1443 -2.809 0.00497 **
## coragen_LTRUE -2.2618 0.2112 -10.710 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.783 on 5 degrees of freedom
## Residual deviance: 92.901 on 4 degrees of freedom
## AIC: 115.28
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_coragen)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## coragen_L 120.88 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_entrust_sc <- glm(
cbind(api_pos, api_neg) ~ entrust_sc_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_entrust_sc)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ entrust_sc_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.51732 0.09876 -15.36 <2e-16 ***
## entrust_sc_LTRUE -18.47059 943.71566 -0.02 0.984
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 145.52 on 4 degrees of freedom
## AIC: 167.91
##
## Number of Fisher Scoring iterations: 14
Anova(mod.a_entrust_sc)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## entrust_sc_L 68.259 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_pylon <- glm(
cbind(api_pos, api_neg) ~ pylon_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_pylon)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ pylon_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.8582 0.1202 -15.459 <2e-16 ***
## pylon_LTRUE 0.1236 0.2015 0.614 0.539
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 213.41 on 4 degrees of freedom
## AIC: 235.79
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_pylon)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## pylon_L 0.37344 1 0.5411
mod.a_grotto <- glm(
cbind(api_pos, api_neg) ~ grotto_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_grotto)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ grotto_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.51732 0.09876 -15.36 <2e-16 ***
## grotto_LTRUE -18.47059 943.71566 -0.02 0.984
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 145.52 on 4 degrees of freedom
## AIC: 167.91
##
## Number of Fisher Scoring iterations: 14
Anova(mod.a_grotto)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## grotto_L 68.259 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_luna_tranquility <- glm(
cbind(api_pos, api_neg) ~ luna_tranquility_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_luna_tranquility)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ luna_tranquility_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.6283 0.1637 -16.053 < 2e-16 ***
## luna_tranquility_LTRUE 1.7050 0.2079 8.199 2.42e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 140.65 on 4 degrees of freedom
## AIC: 163.03
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_luna_tranquility)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## luna_tranquility_L 73.132 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_previcur_flex <- glm(
cbind(api_pos, api_neg) ~ previcur_flex_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_previcur_flex)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ previcur_flex_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -19.99 943.72 -0.021 0.983
## previcur_flex_LTRUE 18.47 943.72 0.020 0.984
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 145.52 on 4 degrees of freedom
## AIC: 167.91
##
## Number of Fisher Scoring iterations: 14
Anova(mod.a_previcur_flex)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## previcur_flex_L 68.259 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_fontelis <- glm(
cbind(api_pos, api_neg) ~ fontelis_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_fontelis)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ fontelis_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.6672 0.1542 -17.30 <2e-16 ***
## fontelis_LTRUE 2.2618 0.2112 10.71 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.783 on 5 degrees of freedom
## Residual deviance: 92.901 on 4 degrees of freedom
## AIC: 115.28
##
## Number of Fisher Scoring iterations: 6
Anova(mod.a_fontelis)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## fontelis_L 120.88 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_quadristop <- glm(
cbind(api_pos, api_neg) ~ quadristop_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_quadristop)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ quadristop_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.72574 0.09908 -17.418 <2e-16 ***
## quadristop_LTRUE -1.20812 0.46953 -2.573 0.0101 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 204.57 on 4 degrees of freedom
## AIC: 226.95
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_quadristop)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## quadristop_L 9.2159 1 0.002399 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a_milstop <- glm(
cbind(api_pos, api_neg) ~ milstop_L,
data = greenhouse_df,
family = binomial("logit"))
summary(mod.a_milstop)
##
## Call:
## glm(formula = cbind(api_pos, api_neg) ~ milstop_L, family = binomial("logit"),
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.72574 0.09908 -17.418 <2e-16 ***
## milstop_LTRUE -1.20812 0.46953 -2.573 0.0101 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 213.78 on 5 degrees of freedom
## Residual deviance: 204.57 on 4 degrees of freedom
## AIC: 226.95
##
## Number of Fisher Scoring iterations: 5
Anova(mod.a_milstop)
## Analysis of Deviance Table (Type II tests)
##
## Response: cbind(api_pos, api_neg)
## LR Chisq Df Pr(>Chisq)
## milstop_L 9.2159 1 0.002399 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod.a.api <- list(
azaguard = mod.a_azaguard,
botanigard_22wp = mod.a_botanigard_22wp,
botanigard_es = mod.a_botanigard_es,
captiva_prime = mod.a_captiva_prime,
nofly = mod.a_nofly,
venerate_cg = mod.a_venerate_cg,
m_pede = mod.a_m_pede,
rootshield_plus = mod.a_rootshield_plus,
lalstop_k61 = mod.a_lalstop_k61,
beleaf_50sg = mod.a_beleaf_50sg,
coragen = mod.a_coragen,
entrust_sc = mod.a_entrust_sc,
pylon = mod.a_pylon,
grotto = mod.a_grotto,
luna_tranquility = mod.a_luna_tranquility,
previcur_flex = mod.a_previcur_flex,
fontelis = mod.a_fontelis,
quadristop = mod.a_quadristop,
milstop = mod.a_milstop
)
summary_table.api <- do.call(rbind, lapply(names(mod.a.api), function(name){
m <- mod.a.api[[name]]
s <- summary(m)
coef_row <- s$coefficients[2, ]
lr <- Anova(m)$`LR Chisq`[1]
LRT <- Anova(m)$'Pr(>Chisq)'[1]
data.frame(
Pesticide = name,
Estimate = coef_row["Estimate"],
SE = coef_row["Std. Error"],
z = coef_row["z value"],
p = coef_row["Pr(>|z|)"],
LR_ChiSq = lr,
LRT = LRT,
AIC = AIC(m),
Residual_Deviance = m$deviance
)
}))
summary_table.api$Estimate <- signif(summary_table.api$Estimate,3)
summary_table.api$SE <- signif(summary_table.api$SE,3)
summary_table.api$z <- round(summary_table.api$z,2)
summary_table.api$p <- signif(summary_table.api$p,3)
summary_table.api$LR_ChiSq <- round(summary_table.api$LR_ChiSq,2)
summary_table.api$AIC <- round(summary_table.api$AIC,2)
summary_table.api$Residual_Deviance <- round(summary_table.api$Residual_Deviance,2)
summary_table.api$LRT <- signif(summary_table.api$LRT,2)
summary_table.api
## Pesticide Estimate SE z p LR_ChiSq LRT
## Estimate azaguard -0.124 0.201 -0.61 5.39e-01 0.37 5.4e-01
## Estimate1 botanigard_22wp -0.124 0.201 -0.61 5.39e-01 0.37 5.4e-01
## Estimate2 botanigard_es 0.939 0.200 4.69 2.77e-06 22.96 1.7e-06
## Estimate3 captiva_prime -0.124 0.201 -0.61 5.39e-01 0.37 5.4e-01
## Estimate4 nofly -0.124 0.201 -0.61 5.39e-01 0.37 5.4e-01
## Estimate5 venerate_cg -20.900 1810.000 -0.01 9.91e-01 160.86 7.4e-37
## Estimate6 m_pede -0.124 0.201 -0.61 5.39e-01 0.37 5.4e-01
## Estimate7 rootshield_plus -0.158 0.240 -0.66 5.08e-01 0.45 5.0e-01
## Estimate8 lalstop_k61 0.573 0.211 2.71 6.64e-03 7.00 8.1e-03
## Estimate9 beleaf_50sg -18.500 944.000 -0.02 9.84e-01 68.26 1.4e-16
## Estimate10 coragen -2.260 0.211 -10.71 9.15e-27 120.88 4.1e-28
## Estimate11 entrust_sc -18.500 944.000 -0.02 9.84e-01 68.26 1.4e-16
## Estimate12 pylon 0.124 0.201 0.61 5.39e-01 0.37 5.4e-01
## Estimate13 grotto -18.500 944.000 -0.02 9.84e-01 68.26 1.4e-16
## Estimate14 luna_tranquility 1.700 0.208 8.20 2.42e-16 73.13 1.2e-17
## Estimate15 previcur_flex 18.500 944.000 0.02 9.84e-01 68.26 1.4e-16
## Estimate16 fontelis 2.260 0.211 10.71 9.15e-27 120.88 4.1e-28
## Estimate17 quadristop -1.210 0.470 -2.57 1.01e-02 9.22 2.4e-03
## Estimate18 milstop -1.210 0.470 -2.57 1.01e-02 9.22 2.4e-03
## AIC Residual_Deviance
## Estimate 235.79 213.41
## Estimate1 235.79 213.41
## Estimate2 213.21 190.83
## Estimate3 235.79 213.41
## Estimate4 235.79 213.41
## Estimate5 75.31 52.93
## Estimate6 235.79 213.41
## Estimate7 235.72 213.34
## Estimate8 229.16 206.78
## Estimate9 167.91 145.52
## Estimate10 115.28 92.90
## Estimate11 167.91 145.52
## Estimate12 235.79 213.41
## Estimate13 167.91 145.52
## Estimate14 163.03 140.65
## Estimate15 167.91 145.52
## Estimate16 115.28 92.90
## Estimate17 226.95 204.57
## Estimate18 226.95 204.57
asdf <- as.data.frame(summary_table.api)
plots <- lapply(1:nrow(chem_info), function(i){
chem_type <- chem_info$type[i]
chem_mode <- chem_info$mode[i]
chem_class <- chem_info$class[i]
var <- chem_info$pesticide[i]
var2 <- gsub("_L$", "", chem_info$pesticide[i]) # remove _L at end
stats_row <- summary_table.api[summary_table.api$Pesticide == var2, ]
annot_text <- paste0(
"LRT χ² = ", round(stats_row$LR_ChiSq, 2),
", p = ", signif(stats_row$LRT, 3))
ggplot(greenhouse_df, aes_string(x = var, y = "api_prop")) +
geom_boxplot(fill = chem_colors[chem_class],
alpha = 0.6,
width = 0.5,
outlier.shape = NA) +
geom_jitter(width = 0.1, size = 3, alpha = 0.8) +
labs(
title = gsub("_L","",var),
subtitle = paste(chem_type, "-", chem_mode),
x = "",
y = "Probability of Apicystis Detection"
) +
scale_x_discrete(labels = c("FALSE"="Not applied","TRUE"="Applied")) +
theme_classic(base_size = 16) +
annotate(
"text",
x = 2, y = 1.05, # top-right
label = annot_text,
hjust = 1, vjust = 1, size = 4
) +
coord_cartesian(ylim = c(0, 1))
})
wrap_plots(plots, ncol = 4)
hist(greenhouse_df$average_bruise)
greenhouse_df$logbruise <- log(greenhouse_df$average_bruise)
hist(greenhouse_df$logbruise)
shapiro.test(greenhouse_df$logbruise)
##
## Shapiro-Wilk normality test
##
## data: greenhouse_df$logbruise
## W = 0.96175, p-value = 0.8331
anth_m1 <- glm(logbruise ~ total_pesticide_applied_ml + avg_hives_in_phase, data = greenhouse_df)
Anova(anth_m1)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_pesticide_applied_ml 42.697 1 6.389e-11 ***
## avg_hives_in_phase 4.721 1 0.0298 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m1)
##
## Call:
## glm(formula = logbruise ~ total_pesticide_applied_ml + avg_hives_in_phase,
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.903e-01 3.873e-02 20.403 0.000257 ***
## total_pesticide_applied_ml -6.701e-07 1.026e-07 -6.534 0.007285 **
## avg_hives_in_phase 5.166e-04 2.378e-04 2.173 0.118151
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0003119446)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00093583 on 3 degrees of freedom
## AIC: -27.568
##
## Number of Fisher Scoring iterations: 2
anth_m2 <- glm(logbruise ~ total_pesticide_applied_ml + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m2)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_pesticide_applied_ml 442.99 1 < 2.2e-16 ***
## avg_hives_in_phase 160.60 1 < 2.2e-16 ***
## crith_prop 18.30 1 1.882e-05 ***
## api_prop 95.24 1 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m2)
##
## Call:
## glm(formula = logbruise ~ total_pesticide_applied_ml + avg_hives_in_phase +
## crith_prop + api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.958e-01 1.420e-02 48.997 0.0130 *
## total_pesticide_applied_ml -9.511e-07 4.519e-08 -21.047 0.0302 *
## avg_hives_in_phase 1.549e-03 1.223e-04 12.673 0.0501 .
## crith_prop -2.689e-02 6.284e-03 -4.278 0.1462
## api_prop -2.597e-01 2.661e-02 -9.759 0.0650 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 6.739332e-06)
##
## Null deviance: 1.4359e-02 on 5 degrees of freedom
## Residual deviance: 6.7393e-06 on 1 degrees of freedom
## AIC: -53.169
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m2, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_pesticide_applied_ml + avg_hives_in_phase +
## crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.00000674 -53.169
## total_pesticide_applied_ml 1 0.00299222 -18.594 36.575 1.469e-09 ***
## avg_hives_in_phase 1 0.00108908 -24.658 30.511 3.320e-08 ***
## crith_prop 1 0.00013010 -37.407 17.762 2.503e-05 ***
## api_prop 1 0.00064858 -27.768 27.401 1.654e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m3 <- glm(logbruise ~ total_insec_bio + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m3)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_insec_bio 10.1197 1 0.001467 **
## avg_hives_in_phase 1.4800 1 0.223770
## crith_prop 10.4985 1 0.001195 **
## api_prop 0.4078 1 0.523104
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m3)
##
## Call:
## glm(formula = logbruise ~ total_insec_bio + avg_hives_in_phase +
## crith_prop + api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.896e-01 6.822e-02 11.574 0.0549 .
## total_insec_bio -5.139e-07 1.615e-07 -3.181 0.1939
## avg_hives_in_phase 6.847e-04 5.628e-04 1.217 0.4380
## crith_prop -1.095e-01 3.381e-02 -3.240 0.1906
## api_prop -8.140e-02 1.275e-01 -0.639 0.6382
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0002690925)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00026909 on 1 degrees of freedom
## AIC: -31.046
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m3, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_insec_bio + avg_hives_in_phase + crith_prop +
## api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.00026909 -31.046
## total_insec_bio 1 0.00299222 -18.594 14.4523 0.0001438 ***
## avg_hives_in_phase 1 0.00066736 -27.596 5.4496 0.0195725 *
## crith_prop 1 0.00309416 -18.393 14.6533 0.0001292 ***
## api_prop 1 0.00037882 -30.994 2.0520 0.1520026
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m3.1 <- update(anth_m3, .~. -api_prop)
drop1(anth_m3.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_insec_bio + avg_hives_in_phase + crith_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0003788 -30.994
## total_insec_bio 1 0.0051174 -17.374 15.6200 7.743e-05 ***
## avg_hives_in_phase 1 0.0010170 -27.069 5.9255 0.0149231 *
## crith_prop 1 0.0033770 -19.868 13.1261 0.0002912 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m3.1)
##
## Call:
## glm(formula = logbruise ~ total_insec_bio + avg_hives_in_phase +
## crith_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.235e-01 3.605e-02 22.843 0.00191 **
## total_insec_bio -4.347e-07 8.691e-08 -5.002 0.03772 *
## avg_hives_in_phase 3.573e-04 1.946e-04 1.836 0.20784
## crith_prop -9.928e-02 2.495e-02 -3.979 0.05776 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0001894101)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00037882 on 2 degrees of freedom
## AIC: -30.994
##
## Number of Fisher Scoring iterations: 2
anth_m4 <- glm(logbruise ~ total_insec_synth + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m4)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_insec_synth 13.6308 1 0.0002225 ***
## avg_hives_in_phase 19.0840 1 1.251e-05 ***
## crith_prop 0.1005 1 0.7512747
## api_prop 9.2920 1 0.0023016 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m4)
##
## Call:
## glm(formula = logbruise ~ total_insec_synth + avg_hives_in_phase +
## crith_prop + api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.054e+00 4.575e-02 23.046 0.0276 *
## total_insec_synth -9.842e-06 2.666e-06 -3.692 0.1684
## avg_hives_in_phase -1.367e-03 3.130e-04 -4.369 0.1433
## crith_prop -1.184e-02 3.735e-02 -0.317 0.8046
## api_prop 2.175e-01 7.135e-02 3.048 0.2018
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0002045146)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00020451 on 1 degrees of freedom
## AIC: -32.693
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m4, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_insec_synth + avg_hives_in_phase + crith_prop +
## api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0002045 -32.693
## total_insec_synth 1 0.0029922 -18.594 16.0988 6.012e-05 ***
## avg_hives_in_phase 1 0.0041075 -16.693 17.9995 2.210e-05 ***
## crith_prop 1 0.0002251 -34.118 0.5744 0.448521
## api_prop 1 0.0021049 -20.704 13.9882 0.000184 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m4.1 <- update(anth_m4, .~. -crith_prop)
drop1(anth_m4.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_insec_synth + avg_hives_in_phase + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0002251 -34.118
## total_insec_synth 1 0.0052555 -17.214 18.904 1.375e-05 ***
## avg_hives_in_phase 1 0.0071863 -15.337 20.781 5.148e-06 ***
## api_prop 1 0.0028335 -20.921 15.197 9.684e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(anth_m4.1)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_insec_synth 44.703 1 2.293e-11 ***
## avg_hives_in_phase 61.861 1 3.686e-15 ***
## api_prop 23.180 1 1.475e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m4_2 <- glm(logbruise ~ total_insec_synth, data = greenhouse_df)
AIC(anth_m4.1, anth_m4_2)
## df AIC
## anth_m4.1 5 -34.11814
## anth_m4_2 3 -17.27395
anth_m5 <- glm(logbruise ~ total_fung_bio + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m5)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_fung_bio 0.54647 1 0.4598
## avg_hives_in_phase 0.00584 1 0.9391
## crith_prop 1.61494 1 0.2038
## api_prop 0.07083 1 0.7901
summary(anth_m5)
##
## Call:
## glm(formula = logbruise ~ total_fung_bio + avg_hives_in_phase +
## crith_prop + api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.538e-01 1.821e-01 4.688 0.134
## total_fung_bio 4.483e-06 6.064e-06 0.739 0.595
## avg_hives_in_phase -9.719e-05 1.271e-03 -0.076 0.951
## crith_prop -1.220e-01 9.604e-02 -1.271 0.424
## api_prop 7.954e-02 2.989e-01 0.266 0.834
##
## (Dispersion parameter for gaussian family taken to be 0.001934871)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0019349 on 1 degrees of freedom
## AIC: -19.21
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m5, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_fung_bio + avg_hives_in_phase + crith_prop +
## api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0019349 -19.210
## total_fung_bio 1 0.0029922 -18.594 2.6158 0.10580
## avg_hives_in_phase 1 0.0019462 -21.175 0.0350 0.85169
## crith_prop 1 0.0050596 -15.442 5.7675 0.01633 *
## api_prop 1 0.0020719 -20.799 0.4106 0.52168
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m5.1 <- update(anth_m5, .~. -avg_hives_in_phase)
drop1(anth_m5.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_fung_bio + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0019462 -21.175
## total_fung_bio 1 0.0047596 -17.809 5.3658 0.020535 *
## crith_prop 1 0.0067243 -15.736 7.4391 0.006382 **
## api_prop 1 0.0022897 -22.199 0.9752 0.323382
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m5.2 <- update(anth_m5.1, .~. -api_prop)
drop1(anth_m5.2, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_fung_bio + crith_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0022897 -22.199
## total_fung_bio 1 0.0052262 -19.248 4.9517 0.02606 *
## crith_prop 1 0.0096275 -15.582 8.6173 0.00333 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(anth_m5, anth_m5.1, anth_m5.2)
## Analysis of Deviance Table
##
## Model 1: logbruise ~ total_fung_bio + avg_hives_in_phase + crith_prop +
## api_prop
## Model 2: logbruise ~ total_fung_bio + crith_prop + api_prop
## Model 3: logbruise ~ total_fung_bio + crith_prop
## Resid. Df Resid. Dev Df Deviance F Pr(>F)
## 1 1 0.0019349
## 2 2 0.0019462 -1 -0.00001131 0.0058 0.9514
## 3 3 0.0022897 -1 -0.00034348 0.1775 0.7461
AIC(anth_m5, anth_m5.1, anth_m5.2)
## df AIC
## anth_m5 6 -19.20958
## anth_m5.1 5 -21.17463
## anth_m5.2 4 -22.19941
Anova(anth_m5.2)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_fung_bio 3.8476 1 0.049817 *
## crith_prop 9.6143 1 0.001931 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m5.2)
##
## Call:
## glm(formula = logbruise ~ total_fung_bio + crith_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.566e-01 2.935e-02 29.186 8.83e-05 ***
## total_fung_bio 4.927e-06 2.512e-06 1.962 0.1446
## crith_prop -1.408e-01 4.540e-02 -3.101 0.0533 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0007632196)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0022897 on 3 degrees of freedom
## AIC: -22.199
##
## Number of Fisher Scoring iterations: 2
anth_m6 <- glm(logbruise ~ total_insec + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m6)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_insec 12.3409 1 0.0004431 ***
## avg_hives_in_phase 1.5067 1 0.2196413
## crith_prop 11.6235 1 0.0006512 ***
## api_prop 0.3917 1 0.5314263
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m6)
##
## Call:
## glm(formula = logbruise ~ total_insec + avg_hives_in_phase +
## crith_prop + api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.004e-01 5.965e-02 13.420 0.0474 *
## total_insec -4.958e-07 1.411e-07 -3.513 0.1766
## avg_hives_in_phase 6.041e-04 4.921e-04 1.227 0.4352
## crith_prop -1.048e-01 3.074e-02 -3.409 0.1816
## api_prop -7.109e-02 1.136e-01 -0.626 0.6440
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0002242896)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00022429 on 1 degrees of freedom
## AIC: -32.139
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m6, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_insec + avg_hives_in_phase + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.00022429 -32.139
## total_insec 1 0.00299222 -18.594 15.5450 8.056e-05 ***
## avg_hives_in_phase 1 0.00056223 -28.625 5.5138 0.01887 *
## crith_prop 1 0.00283132 -18.925 15.2134 9.602e-05 ***
## api_prop 1 0.00031214 -32.156 1.9830 0.15907
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m6.1 <- update(anth_m6, .~. -api_prop)
drop1(anth_m6.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_insec + avg_hives_in_phase + crith_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0003121 -32.156
## total_insec 1 0.0051174 -17.374 16.7818 4.193e-05 ***
## avg_hives_in_phase 1 0.0008593 -28.080 6.0759 0.0137037 *
## crith_prop 1 0.0030667 -20.446 13.7096 0.0002134 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(anth_m6.1)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_insec 30.7896 1 2.876e-08 ***
## avg_hives_in_phase 3.5058 1 0.06115 .
## crith_prop 17.6501 1 2.655e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m6.1)
##
## Call:
## glm(formula = logbruise ~ total_insec + avg_hives_in_phase +
## crith_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.288e-01 3.227e-02 25.688 0.00151 **
## total_insec -4.292e-07 7.735e-08 -5.549 0.03098 *
## avg_hives_in_phase 3.250e-04 1.736e-04 1.872 0.20204
## crith_prop -9.612e-02 2.288e-02 -4.201 0.05226 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0001560679)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00031214 on 2 degrees of freedom
## AIC: -32.156
##
## Number of Fisher Scoring iterations: 2
anth_m7 <- glm(logbruise ~ total_fung + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m7)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_fung 2.8800 1 0.08969 .
## avg_hives_in_phase 0.6962 1 0.40407
## crith_prop 5.7750 1 0.01626 *
## api_prop 0.9869 1 0.32051
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m7)
##
## Call:
## glm(formula = logbruise ~ total_fung + avg_hives_in_phase + crith_prop +
## api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.197e-01 7.634e-02 12.048 0.0527 .
## total_fung 9.089e-07 5.355e-07 1.697 0.3390
## avg_hives_in_phase -4.715e-04 5.651e-04 -0.834 0.5573
## crith_prop -1.784e-01 7.422e-02 -2.403 0.2510
## api_prop 1.460e-01 1.469e-01 0.993 0.5021
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0007711904)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00077119 on 1 degrees of freedom
## AIC: -24.729
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m7, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_fung + avg_hives_in_phase + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0007712 -24.729
## total_fung 1 0.0029922 -18.594 8.1350 0.0043419 **
## avg_hives_in_phase 1 0.0013081 -23.558 3.1702 0.0749918 .
## crith_prop 1 0.0052248 -15.249 11.4794 0.0007037 ***
## api_prop 1 0.0015323 -22.609 4.1194 0.0423950 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m7.1 <- update(anth_m7, .~. -avg_hives_in_phase)
drop1(anth_m7.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_fung + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0013081 -23.558
## total_fung 1 0.0047596 -17.809 7.7497 0.0053721 **
## crith_prop 1 0.0105167 -13.052 12.5065 0.0004055 ***
## api_prop 1 0.0015366 -24.592 0.9663 0.3256061
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m7.2 <- update(anth_m7.1, .~. -api_prop)
drop1(anth_m7.2, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_fung + crith_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0015366 -24.592
## total_fung 1 0.0052262 -19.248 7.3445 0.0067267 **
## crith_prop 1 0.0143044 -13.206 13.3858 0.0002535 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(anth_m7.2)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_fung 7.2032 1 0.007277 **
## crith_prop 24.9266 1 5.956e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m7.2)
##
## Call:
## glm(formula = logbruise ~ total_fung + crith_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.770e-01 2.180e-02 40.223 3.38e-05 ***
## total_fung 1.093e-06 4.072e-07 2.684 0.0748 .
## crith_prop -2.271e-01 4.548e-02 -4.993 0.0155 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0005122147)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0015366 on 3 degrees of freedom
## AIC: -24.592
##
## Number of Fisher Scoring iterations: 2
anth_m8 <- glm(logbruise ~ total_bio + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m8)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_bio 6.5072 1 0.01074 *
## avg_hives_in_phase 0.8028 1 0.37026
## crith_prop 6.7566 1 0.00934 **
## api_prop 0.1732 1 0.67725
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m8)
##
## Call:
## glm(formula = logbruise ~ total_bio + avg_hives_in_phase + crith_prop +
## api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.021e-01 8.051e-02 9.962 0.0637 .
## total_bio -5.122e-07 2.008e-07 -2.551 0.2378
## avg_hives_in_phase 5.994e-04 6.689e-04 0.896 0.5349
## crith_prop -1.067e-01 4.104e-02 -2.599 0.2338
## api_prop -6.325e-02 1.520e-01 -0.416 0.7489
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.00039858)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00039858 on 1 degrees of freedom
## AIC: -28.689
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m8, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_bio + avg_hives_in_phase + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.00039858 -28.689
## total_bio 1 0.00299222 -18.594 12.0952 0.0005055 ***
## avg_hives_in_phase 1 0.00071856 -27.153 3.5360 0.0600493 .
## crith_prop 1 0.00309164 -18.398 12.2913 0.0004551 ***
## api_prop 1 0.00046763 -29.730 0.9586 0.3275367
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m8.1 <-update(anth_m8, .~. -api_prop)
drop1(anth_m8.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_bio + avg_hives_in_phase + crith_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0004676 -29.730
## total_bio 1 0.0051174 -17.374 14.3563 0.0001513 ***
## avg_hives_in_phase 1 0.0010726 -26.749 4.9811 0.0256258 *
## crith_prop 1 0.0034110 -19.808 11.9226 0.0005546 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(anth_m8.1)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_bio 19.8865 1 8.218e-06 ***
## avg_hives_in_phase 2.5875 1 0.1077122
## crith_prop 12.5886 1 0.0003881 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m8.1)
##
## Call:
## glm(formula = logbruise ~ total_bio + avg_hives_in_phase + crith_prop,
## data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.277e-01 3.971e-02 20.842 0.00229 **
## total_bio -4.491e-07 1.007e-07 -4.459 0.04678 *
## avg_hives_in_phase 3.468e-04 2.156e-04 1.609 0.24898
## crith_prop -9.875e-02 2.783e-02 -3.548 0.07107 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0002338149)
##
## Null deviance: 0.01435922 on 5 degrees of freedom
## Residual deviance: 0.00046763 on 2 degrees of freedom
## AIC: -29.73
##
## Number of Fisher Scoring iterations: 2
anth_m9 <- glm(logbruise ~ total_synth + avg_hives_in_phase + crith_prop + api_prop, data = greenhouse_df)
Anova(anth_m9)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_synth 1.09911 1 0.2945
## avg_hives_in_phase 0.61423 1 0.4332
## crith_prop 2.67924 1 0.1017
## api_prop 0.89561 1 0.3440
summary(anth_m9)
##
## Call:
## glm(formula = logbruise ~ total_synth + avg_hives_in_phase +
## crith_prop + api_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.346e-01 1.016e-01 9.196 0.069 .
## total_synth 8.140e-07 7.765e-07 1.048 0.485
## avg_hives_in_phase -5.875e-04 7.496e-04 -0.784 0.577
## crith_prop -1.725e-01 1.054e-01 -1.637 0.349
## api_prop 1.830e-01 1.934e-01 0.946 0.518
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001425468)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0014255 on 1 degrees of freedom
## AIC: -21.043
##
## Number of Fisher Scoring iterations: 2
drop1(anth_m9, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_synth + avg_hives_in_phase + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0014255 -21.043
## total_synth 1 0.0029922 -18.594 4.4491 0.034920 *
## avg_hives_in_phase 1 0.0023010 -20.170 2.8731 0.090069 .
## crith_prop 1 0.0052446 -15.227 7.8162 0.005178 **
## api_prop 1 0.0027021 -19.206 3.8373 0.050125 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m9.1 <- update(anth_m9, .~. -avg_hives_in_phase)
drop1(anth_m9.1, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_synth + crith_prop + api_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0023010 -20.170
## total_synth 1 0.0047596 -17.809 4.3609 0.036773 *
## crith_prop 1 0.0103868 -13.127 9.0431 0.002637 **
## api_prop 1 0.0027095 -21.189 0.9805 0.322083
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anth_m9.2 <- update(anth_m9.1, .~. -api_prop)
drop1(anth_m9.2, test = "Chisq")
## Single term deletions
##
## Model:
## logbruise ~ total_synth + crith_prop
## Df Deviance AIC scaled dev. Pr(>Chi)
## <none> 0.0027095 -21.189
## total_synth 1 0.0052262 -19.248 3.9415 0.047108 *
## crith_prop 1 0.0134942 -13.556 9.6329 0.001911 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Anova(anth_m9.2)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## total_synth 2.7865 1 0.0950605 .
## crith_prop 11.9409 1 0.0005492 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_m9.2)
##
## Call:
## glm(formula = logbruise ~ total_synth + crith_prop, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.829e-01 2.890e-02 30.555 7.7e-05 ***
## total_synth 9.919e-07 5.942e-07 1.669 0.1937
## crith_prop -2.323e-01 6.721e-02 -3.456 0.0408 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0009031717)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0027095 on 3 degrees of freedom
## AIC: -21.189
##
## Number of Fisher Scoring iterations: 2
calc_se <- function(row) {
counts <- as.numeric(row[c("total_bruise_0", "total_bruise_1", "total_bruise_2", "total_bruise_3")])
avg <- as.numeric(row["average_bruise"])
N <- sum(counts)
scores <- 0:3
variance <- sum(counts * (scores - avg)^2) / N
SE <- sqrt(variance) / sqrt(N)
return(SE)
}
# Apply to every row
greenhouse_df$SE_bruise <- apply(greenhouse_df, 1, calc_se)
predictors <- c(
"total_insec_bio",
"total_insec_synth",
"total_fung_bio",
"total_fung_synth",
"total_insec",
"total_fung",
"total_bio",
"total_synth",
"total_pesticide_applied_ml",
"crith_prop",
"api_prop",
"avg_hives_in_phase"
)
labels <- c(
"Biological Insecticide (ml)",
"Synthetic Insecticide (ml)",
"Biological Fungicide (ml)",
"Synthetic Fungicide (ml)",
"Total Insecticides (ml)",
"Total Fungicides (ml)",
"Total Biological Pesticides (ml)",
"Total Synthetic Pesticides (ml)",
"Total Pesticides Applied (ml)",
"Proportion of bees with Crithidia detection",
"Proportion of bees with Apicystis detection",
"Average count of bumble bee colonies in greenhouse"
)
plots <- lapply(seq_along(predictors), function(i){
var <- predictors[i]
label <- labels[i]
ggplot(greenhouse_df, aes_string(x = var, y = "average_bruise")) +
geom_point(size = 3, alpha = 0.8) +
geom_smooth(method = "glm",
se = TRUE,
color = "black") +
geom_errorbar(aes(ymin = average_bruise - SE_bruise,
ymax = average_bruise + SE_bruise),
width = 0) +
labs(
x = label,
y = "Average Anther Bruise Score"
) +
theme_classic(base_size = 14)
})
wrap_plots(plots, ncol = 2)
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
anth_chem_m1 <- glm(logbruise ~ azaguard_L, data = greenhouse_df)
Anova(anth_chem_m1)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## azaguard_L 7.2748 1 0.006993 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m1)
##
## Call:
## glm(formula = logbruise ~ azaguard_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.83737 0.02060 40.641 2.19e-06 ***
## azaguard_LTRUE -0.07859 0.02914 -2.697 0.0543 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001273569)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0050943 on 4 degrees of freedom
## AIC: -19.401
##
## Number of Fisher Scoring iterations: 2
anth_chem_m2 <- glm(logbruise ~ botanigard_22wp_L, data = greenhouse_df)
Anova(anth_chem_m2)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## botanigard_22wp_L 7.2748 1 0.006993 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m2)
##
## Call:
## glm(formula = logbruise ~ botanigard_22wp_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.83737 0.02060 40.641 2.19e-06 ***
## botanigard_22wp_LTRUE -0.07859 0.02914 -2.697 0.0543 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001273569)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0050943 on 4 degrees of freedom
## AIC: -19.401
##
## Number of Fisher Scoring iterations: 2
anth_chem_m3 <- glm(logbruise ~ botanigard_es_L, data = greenhouse_df)
Anova(anth_chem_m3)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## botanigard_es_L 0.20062 1 0.6542
summary(anth_chem_m3)
##
## Call:
## glm(formula = logbruise ~ botanigard_es_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.80564 0.02923 27.559 1.03e-05 ***
## botanigard_es_LTRUE -0.02268 0.05063 -0.448 0.677
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.00341836)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.013673 on 4 degrees of freedom
## AIC: -13.477
##
## Number of Fisher Scoring iterations: 2
anth_chem_m4 <- glm(logbruise ~ captiva_prime_L, data = greenhouse_df)
Anova(anth_chem_m4)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## captiva_prime_L 7.2748 1 0.006993 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m4)
##
## Call:
## glm(formula = logbruise ~ captiva_prime_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.83737 0.02060 40.641 2.19e-06 ***
## captiva_prime_LTRUE -0.07859 0.02914 -2.697 0.0543 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001273569)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0050943 on 4 degrees of freedom
## AIC: -19.401
##
## Number of Fisher Scoring iterations: 2
anth_chem_m5 <- glm(logbruise ~ nofly_L, data = greenhouse_df)
Anova(anth_chem_m5)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## nofly_L 7.2748 1 0.006993 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m5)
##
## Call:
## glm(formula = logbruise ~ nofly_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.83737 0.02060 40.641 2.19e-06 ***
## nofly_LTRUE -0.07859 0.02914 -2.697 0.0543 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001273569)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0050943 on 4 degrees of freedom
## AIC: -19.401
##
## Number of Fisher Scoring iterations: 2
anth_chem_m6 <- glm(logbruise ~ venerate_cg_L, data = greenhouse_df)
Anova(anth_chem_m6)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## venerate_cg_L 11.679 1 0.0006321 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m6)
##
## Call:
## glm(formula = logbruise ~ venerate_cg_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.82793 0.01513 54.716 6.68e-07 ***
## venerate_cg_LTRUE -0.08957 0.02621 -3.417 0.0268 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0009158278)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0036633 on 4 degrees of freedom
## AIC: -21.38
##
## Number of Fisher Scoring iterations: 2
anth_chem_m7 <- glm(logbruise ~ m_pede_L, data = greenhouse_df)
Anova(anth_chem_m7)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## m_pede_L 7.2748 1 0.006993 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m7)
##
## Call:
## glm(formula = logbruise ~ m_pede_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.83737 0.02060 40.641 2.19e-06 ***
## m_pede_LTRUE -0.07859 0.02914 -2.697 0.0543 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001273569)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0050943 on 4 degrees of freedom
## AIC: -19.401
##
## Number of Fisher Scoring iterations: 2
anth_chem_m8 <- glm(logbruise ~ rootshield_plus_L, data = greenhouse_df)
Anova(anth_chem_m8)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## rootshield_plus_L 0.77772 1 0.3778
summary(anth_chem_m8)
##
## Call:
## glm(formula = logbruise ~ rootshield_plus_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.78412 0.02741 28.606 8.89e-06 ***
## rootshield_plus_LTRUE 0.04187 0.04748 0.882 0.428
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.003005456)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.012022 on 4 degrees of freedom
## AIC: -14.249
##
## Number of Fisher Scoring iterations: 2
anth_chem_m9 <- glm(logbruise ~ lalstop_k61_L, data = greenhouse_df)
Anova(anth_chem_m9)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## lalstop_k61_L 4.6147 1 0.0317 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m9)
##
## Call:
## glm(formula = logbruise ~ lalstop_k61_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.77276 0.02041 37.855 2.91e-06 ***
## lalstop_k61_LTRUE 0.07595 0.03536 2.148 0.0982 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001666819)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0066673 on 4 degrees of freedom
## AIC: -17.787
##
## Number of Fisher Scoring iterations: 2
anth_chem_m10 <- glm(logbruise ~ beleaf_50sg_L, data = greenhouse_df)
Anova(anth_chem_m10)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## beleaf_50sg_L 7.1735 1 0.007399 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m10)
##
## Call:
## glm(formula = logbruise ~ beleaf_50sg_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.81561 0.01603 50.874 8.93e-07 ***
## beleaf_50sg_LTRUE -0.10518 0.03927 -2.678 0.0553 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001285116)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0051405 on 4 degrees of freedom
## AIC: -19.347
##
## Number of Fisher Scoring iterations: 2
anth_chem_m11 <- glm(logbruise ~ coragen_L, data = greenhouse_df)
Anova(anth_chem_m11)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## coragen_L 0.00078575 1 0.9776
summary(anth_chem_m11)
##
## Call:
## glm(formula = logbruise ~ coragen_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.79961 0.05991 13.347 0.000182 ***
## coragen_LTRUE -0.00184 0.06563 -0.028 0.978980
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0035891)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.014356 on 4 degrees of freedom
## AIC: -13.185
##
## Number of Fisher Scoring iterations: 2
anth_chem_m12 <- glm(logbruise ~ entrust_sc_L, data = greenhouse_df)
Anova(anth_chem_m12)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## entrust_sc_L 7.1735 1 0.007399 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m12)
##
## Call:
## glm(formula = logbruise ~ entrust_sc_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.81561 0.01603 50.874 8.93e-07 ***
## entrust_sc_LTRUE -0.10518 0.03927 -2.678 0.0553 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001285116)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0051405 on 4 degrees of freedom
## AIC: -19.347
##
## Number of Fisher Scoring iterations: 2
anth_chem_m13 <- glm(logbruise ~ pylon_L, data = greenhouse_df)
Anova(anth_chem_m13)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## pylon_L 7.2748 1 0.006993 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m13)
##
## Call:
## glm(formula = logbruise ~ pylon_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.75878 0.02060 36.827 3.25e-06 ***
## pylon_LTRUE 0.07859 0.02914 2.697 0.0543 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001273569)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0050943 on 4 degrees of freedom
## AIC: -19.401
##
## Number of Fisher Scoring iterations: 2
anth_chem_m14 <- glm(logbruise ~ grotto_L, data = greenhouse_df)
Anova(anth_chem_m14)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## grotto_L 7.1735 1 0.007399 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m14)
##
## Call:
## glm(formula = logbruise ~ grotto_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.81561 0.01603 50.874 8.93e-07 ***
## grotto_LTRUE -0.10518 0.03927 -2.678 0.0553 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001285116)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0051405 on 4 degrees of freedom
## AIC: -19.347
##
## Number of Fisher Scoring iterations: 2
anth_chem_m15 <- glm(logbruise ~ luna_tranquility_L, data = greenhouse_df)
Anova(anth_chem_m15)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## luna_tranquility_L 0.07002 1 0.7913
summary(anth_chem_m15)
##
## Call:
## glm(formula = logbruise ~ luna_tranquility_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.79354 0.02970 26.720 1.17e-05 ***
## luna_tranquility_LTRUE 0.01361 0.05144 0.265 0.804
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.003528047)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.014112 on 4 degrees of freedom
## AIC: -13.288
##
## Number of Fisher Scoring iterations: 2
anth_chem_m16 <- glm(logbruise ~ previcur_flex_L, data = greenhouse_df)
Anova(anth_chem_m16)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## previcur_flex_L 7.1735 1 0.007399 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(anth_chem_m16)
##
## Call:
## glm(formula = logbruise ~ previcur_flex_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.71043 0.03585 19.817 3.82e-05 ***
## previcur_flex_LTRUE 0.10518 0.03927 2.678 0.0553 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.001285116)
##
## Null deviance: 0.0143592 on 5 degrees of freedom
## Residual deviance: 0.0051405 on 4 degrees of freedom
## AIC: -19.347
##
## Number of Fisher Scoring iterations: 2
anth_chem_m17 <- glm(logbruise ~ fontelis_L, data = greenhouse_df)
Anova(anth_chem_m17)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## fontelis_L 0.00078575 1 0.9776
summary(anth_chem_m17)
##
## Call:
## glm(formula = logbruise ~ fontelis_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.79777 0.02679 29.776 7.58e-06 ***
## fontelis_LTRUE 0.00184 0.06563 0.028 0.979
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.0035891)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.014356 on 4 degrees of freedom
## AIC: -13.185
##
## Number of Fisher Scoring iterations: 2
anth_chem_m18 <- glm(logbruise ~ quadristop_L, data = greenhouse_df)
Anova(anth_chem_m18)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## quadristop_L 0.094469 1 0.7586
summary(anth_chem_m18)
##
## Call:
## glm(formula = logbruise ~ quadristop_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.79475 0.02648 30.009 7.34e-06 ***
## quadristop_LTRUE 0.01994 0.06487 0.307 0.774
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.00350698)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.014028 on 4 degrees of freedom
## AIC: -13.324
##
## Number of Fisher Scoring iterations: 2
anth_chem_m19 <- glm(logbruise ~ milstop_L, data = greenhouse_df)
Anova(anth_chem_m19)
## Analysis of Deviance Table (Type II tests)
##
## Response: logbruise
## LR Chisq Df Pr(>Chisq)
## milstop_L 0.094469 1 0.7586
summary(anth_chem_m19)
##
## Call:
## glm(formula = logbruise ~ milstop_L, data = greenhouse_df)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.79475 0.02648 30.009 7.34e-06 ***
## milstop_LTRUE 0.01994 0.06487 0.307 0.774
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 0.00350698)
##
## Null deviance: 0.014359 on 5 degrees of freedom
## Residual deviance: 0.014028 on 4 degrees of freedom
## AIC: -13.324
##
## Number of Fisher Scoring iterations: 2
anth_models <- list(
azaguard_L = anth_chem_m1,
botanigard_22wp_L = anth_chem_m2,
botanigard_es_L = anth_chem_m3,
captiva_prime_L = anth_chem_m4,
nofly_L = anth_chem_m5,
venerate_cg_L = anth_chem_m6,
m_pede_L = anth_chem_m7,
rootshield_plus_L = anth_chem_m8,
lalstop_k61_L = anth_chem_m9,
beleaf_50sg_L = anth_chem_m10,
coragen_L = anth_chem_m11,
entrust_sc_L = anth_chem_m12,
pylon_L = anth_chem_m13,
grotto_L = anth_chem_m14,
luna_tranquility_L = anth_chem_m15,
previcur_flex_L = anth_chem_m16,
fontelis_L = anth_chem_m17,
quadristop_L = anth_chem_m18,
milstop_L = anth_chem_m19
)
summary_table.anth <- do.call(rbind, lapply(names(anth_models), function(name){
m <- anth_models[[name]]
s <- summary(m)
coef_row <- s$coefficients[2, ]
lr <- Anova(m)$`LR Chisq`[1]
LRT <- Anova(m)$`Pr(>Chisq)`[1]
data.frame(
Predictor = name,
Estimate = coef_row["Estimate"],
SE = coef_row["Std. Error"],
z = coef_row["t value"],
p = coef_row["Pr(>|t|)"],
LR_ChiSq = lr,
AIC = AIC(m),
LRT = LRT,
Residual_Deviance = m$deviance
)
}))
summary_table.anth$SE <- signif(summary_table.anth$SE, 3)
summary_table.anth$z <- round(summary_table.anth$z, 2)
summary_table.anth$p <- signif(summary_table.anth$p, 3)
summary_table.anth$LR_ChiSq <- round(summary_table.anth$LR_ChiSq, 2)
summary_table.anth$AIC <- round(summary_table.anth$AIC, 2)
summary_table.anth$Residual_Deviance <- round(summary_table.anth$Residual_Deviance, 2)
summary_table.anth$LRT <- signif(summary_table.anth$LRT, 3)
anth_table <- as.data.frame(summary_table.anth)
anth_table
## Predictor Estimate SE z p LR_ChiSq AIC
## Estimate azaguard_L -0.078591538 0.0291 -2.70 0.0543 7.27 -19.40
## Estimate1 botanigard_22wp_L -0.078591538 0.0291 -2.70 0.0543 7.27 -19.40
## Estimate2 botanigard_es_L -0.022678939 0.0506 -0.45 0.6770 0.20 -13.48
## Estimate3 captiva_prime_L -0.078591538 0.0291 -2.70 0.0543 7.27 -19.40
## Estimate4 nofly_L -0.078591538 0.0291 -2.70 0.0543 7.27 -19.40
## Estimate5 venerate_cg_L -0.089565240 0.0262 -3.42 0.0268 11.68 -21.38
## Estimate6 m_pede_L -0.078591538 0.0291 -2.70 0.0543 7.27 -19.40
## Estimate7 rootshield_plus_L 0.041869402 0.0475 0.88 0.4280 0.78 -14.25
## Estimate8 lalstop_k61_L 0.075953652 0.0354 2.15 0.0982 4.61 -17.79
## Estimate9 beleaf_50sg_L -0.105178466 0.0393 -2.68 0.0553 7.17 -19.35
## Estimate10 coragen_L -0.001839615 0.0656 -0.03 0.9790 0.00 -13.18
## Estimate11 entrust_sc_L -0.105178466 0.0393 -2.68 0.0553 7.17 -19.35
## Estimate12 pylon_L 0.078591538 0.0291 2.70 0.0543 7.27 -19.40
## Estimate13 grotto_L -0.105178466 0.0393 -2.68 0.0553 7.17 -19.35
## Estimate14 luna_tranquility_L 0.013611588 0.0514 0.26 0.8040 0.07 -13.29
## Estimate15 previcur_flex_L 0.105178466 0.0393 2.68 0.0553 7.17 -19.35
## Estimate16 fontelis_L 0.001839615 0.0656 0.03 0.9790 0.00 -13.18
## Estimate17 quadristop_L 0.019938926 0.0649 0.31 0.7740 0.09 -13.32
## Estimate18 milstop_L 0.019938926 0.0649 0.31 0.7740 0.09 -13.32
## LRT Residual_Deviance
## Estimate 0.006990 0.01
## Estimate1 0.006990 0.01
## Estimate2 0.654000 0.01
## Estimate3 0.006990 0.01
## Estimate4 0.006990 0.01
## Estimate5 0.000632 0.00
## Estimate6 0.006990 0.01
## Estimate7 0.378000 0.01
## Estimate8 0.031700 0.01
## Estimate9 0.007400 0.01
## Estimate10 0.978000 0.01
## Estimate11 0.007400 0.01
## Estimate12 0.006990 0.01
## Estimate13 0.007400 0.01
## Estimate14 0.791000 0.01
## Estimate15 0.007400 0.01
## Estimate16 0.978000 0.01
## Estimate17 0.759000 0.01
## Estimate18 0.759000 0.01
plots <- lapply(1:nrow(chem_info), function(i){
chem_type <- chem_info$type[i]
chem_mode <- chem_info$mode[i]
chem_class <- chem_info$class[i]
var <- chem_info$pesticide[i]
var2 <- gsub("_L$", "", chem_info$pesticide[i]) # remove _L at end
ggplot(greenhouse_df, aes_string(x = var, y = "average_bruise")) +
geom_boxplot(fill = chem_colors[chem_class],
alpha = 0.6,
width = 0.5,
outlier.shape = NA) +
geom_jitter(width = 0.1, size = 3, alpha = 0.8) +
labs(
title = gsub("_L","",var),
subtitle = paste(chem_type, "-", chem_mode),
x = "",
y = "Average Anther Score"
) +
scale_x_discrete(labels = c("FALSE"="Not applied","TRUE"="Applied")) +
theme_classic(base_size = 16)
})
wrap_plots(plots, ncol = 4)