@@ -13,29 +13,29 @@ source("script/function - diagnosticplots.R")
13
13
14
14
# ### Correlations ####
15
15
# check correlations between mean/sd and mean/hab
16
- ggplot(ani , aes(x = n.two , y = mean.two )) +
16
+ ggplot(ani , aes(x = n.nine , y = mean.nine )) +
17
17
geom_point() +
18
18
geom_smooth(method = " lm" , se = FALSE ) +
19
19
stat_cor()
20
20
# highly correlated
21
21
22
- ggplot(ani , aes(x = n.threeh , y = mean.threeh )) +
22
+ ggplot(ani , aes(x = n.three , y = mean.three )) +
23
23
geom_point() +
24
24
geom_smooth(method = " lm" , se = FALSE ) +
25
25
stat_cor()
26
- # correlation of 0.63 , fairly correlated
26
+ # correlation of 0.54 , fairly correlated
27
27
28
- ggplot(ani , aes(x = mean.two , y = sd.two )) +
28
+ ggplot(ani , aes(x = mean.nine , y = sd.nine )) +
29
29
geom_point() +
30
30
geom_smooth(method = " lm" , se = FALSE ) +
31
31
stat_cor()
32
- # correlation of 0.5 , OK
32
+ # correlation of -0.21 , OK
33
33
34
- ggplot(zyg , aes(x = mean.threeh , y = sd.threeh )) +
34
+ ggplot(zyg , aes(x = mean.three , y = sd.three )) +
35
35
geom_point() +
36
36
geom_smooth(method = " lm" , se = FALSE ) +
37
37
stat_cor()
38
- # correlation of 0.38, fairly correlated
38
+ # correlation of 0.23, OK
39
39
40
40
# number of surrounding habitats and mean conductance are
41
41
# highly correlated
@@ -46,27 +46,29 @@ ggplot(zyg, aes(x = mean.threeh, y = sd.threeh)) +
46
46
47
47
# # Anisoptera ##
48
48
# Abundance
49
- ani_abun <- lm(abundance ~ mean.two , data = ani )
49
+ ani_abun <- lm(abundance ~ mean.nine , data = ani )
50
50
summary(ani_abun )
51
51
# significant
52
52
53
- ani_abun_hab <- lm(abundance ~ n.two , data = ani )
53
+ ani_abun_hab <- lm(abundance ~ n.nine , data = ani )
54
54
summary(ani_abun_hab )
55
55
# significant
56
56
57
57
# Shannon Diversity
58
- ani_shann <- lm(shannon ~ mean.two , data = ani )
58
+ ani_shann <- lm(shannon ~ mean.nine , data = ani )
59
59
summary(ani_shann )
60
- # almost significant
61
- ani_shann_hab <- lm(shannon ~ n.two , data = ani )
60
+ # not significant
61
+
62
+ ani_shann_hab <- lm(shannon ~ n.nine , data = ani )
62
63
summary(ani_shann_hab )
63
64
# not significant
64
65
65
66
# Species Richness
66
- ani_sr <- lm(speciescount ~ mean.two , data = ani )
67
+ ani_sr <- lm(speciescount ~ mean.nine , data = ani )
67
68
summary(ani_sr )
68
69
# mean significant
69
- ani_sr_hab <- lm(speciescount ~ n.two , data = ani )
70
+
71
+ ani_sr_hab <- lm(speciescount ~ n.nine , data = ani )
70
72
summary(ani_sr_hab )
71
73
# significant
72
74
@@ -87,40 +89,40 @@ dev.off()
87
89
summ1 <- broom :: tidy(ani_abun )
88
90
write.csv(summ1 , " output/models/AnisopteraAbundanceCurrent_Summary.csv" )
89
91
90
- summ2 <- broom :: tidy(ani_sr )
91
- write.csv(summ2 , " output/models/AnisopteraRichnessCurrent_summary .csv" )
92
+ summ2 <- broom :: tidy(ani_abun_hab )
93
+ write.csv(summ2 , " output/models/AnisopteraAbundanceHabitat_summary .csv" )
92
94
93
- summ3 <- broom :: tidy(ani_abun_hab )
94
- write.csv(summ3 , " output/models/AnisopteraAbundanceHabitat_Summary .csv" )
95
+ summ3 <- broom :: tidy(ani_sr )
96
+ write.csv(summ3 , " output/models/AnisopteraSpeciesRichnessCurrent_Summary .csv" )
95
97
96
98
summ4 <- broom :: tidy(ani_sr_hab )
97
99
write.csv(summ4 , " output/models/AnisopteraSpeciesRichnessHabitat_Summary.csv" )
98
100
99
101
# # Zygoptera ##
100
102
# Abundance
101
- zyg_abun <- lm(abundance ~ mean.threeh , data = zyg )
103
+ zyg_abun <- lm(abundance ~ mean.three , data = zyg )
102
104
summary(zyg_abun )
103
105
# not significant
104
106
105
- zyg_abun_hab <- lm(abundance ~ n.threeh , data = zyg )
107
+ zyg_abun_hab <- lm(abundance ~ n.three , data = zyg )
106
108
summary(zyg_abun_hab )
107
109
# not significant
108
110
109
111
# Shannon Diversity
110
- zyg_shann <- lm(shannon ~ mean.threeh , data = zyg )
112
+ zyg_shann <- lm(shannon ~ mean.three , data = zyg )
111
113
summary(zyg_shann )
112
- # almost significant (0.08 )
114
+ # almost significant (0.07 )
113
115
114
- zyg_shann_hab <- lm(shannon ~ n.threeh , data = zyg )
116
+ zyg_shann_hab <- lm(shannon ~ n.three , data = zyg )
115
117
summary(zyg_shann_hab )
116
118
# not significant
117
119
118
120
# Species Richness
119
- zyg_sr <- lm(speciescount ~ mean.threeh , data = zyg )
121
+ zyg_sr <- lm(speciescount ~ mean.three , data = zyg )
120
122
summary(zyg_sr )
121
123
# mean significant
122
124
123
- zyg_sr_hab <- lm(speciescount ~ n.threeh , data = zyg )
125
+ zyg_sr_hab <- lm(speciescount ~ n.three , data = zyg )
124
126
summary(zyg_sr_hab )
125
127
# not significant
126
128
@@ -137,11 +139,11 @@ dev.off()
137
139
138
140
# model diagnostic plots look ok
139
141
140
- summ6 <- broom :: tidy(zyg_sr )
141
- write.csv(summ6 , " output/models/ZygopteraRichnessCurrent_Summary .csv" )
142
+ summ6 <- broom :: tidy(zyg_shann )
143
+ write.csv(summ6 , " output/models/ZygopteraShannonCurrent_Summary .csv" )
142
144
143
- summ7 <- broom :: tidy(zyg_shann )
144
- write.csv(summ7 , " output/models/ZygopteraShannonCurrent_Summary .csv" )
145
+ summ7 <- broom :: tidy(zyg_sr )
146
+ write.csv(summ7 , " output/models/ZygopteraSpeciesRichnessCurrent_Summary .csv" )
145
147
146
148
# IMPORTANT: sd seems to be a dummy variable - switches direction and magnitude
147
149
# of effect depending on what else is in the model, do not include in models. Can't
0 commit comments