Skip to content

Commit 8d62689

Browse files
author
icrichmond
committed
Updated models with new current map and 900 m buffer for dragons
1 parent 0a1d896 commit 8d62689

12 files changed

+46
-44
lines changed
175 Bytes
Binary file not shown.
430 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"","term","estimate","std.error","statistic","p.value"
2-
"1","(Intercept)",254.813134260157,24.2945317864074,10.4884974322791,6.71767318802026e-14
3-
"2","mean.two",305.795863175109,38.2007397348525,8.0049722936678,2.50409228190112e-10
2+
"1","(Intercept)",209.396674141217,18.7479245067347,11.1690589572193,8.01830235334951e-15
3+
"2","mean.nine",231.65739955979,28.6637279895412,8.08190056939965,1.92283726013335e-10

output/models/AnisopteraAbundanceHabitat_Summary.csv

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"","term","estimate","std.error","statistic","p.value"
2+
"1","(Intercept)",25.8139141096835,7.03684717622861,3.66839203171645,0.000621188993085252
3+
"2","n.nine",1.71804649183252,0.16396643720788,10.4780375855477,6.94395375602082e-14

output/models/AnisopteraRichnessCurrent_summary.csv

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"","term","estimate","std.error","statistic","p.value"
2+
"1","(Intercept)",10.7839702541991,0.902384490165893,11.9505270444271,7.51648937810001e-16
3+
"2","mean.nine",4.96952227772855,1.37965690862497,3.60199861767183,0.000759191347658556
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"","term","estimate","std.error","statistic","p.value"
2-
"1","(Intercept)",6.80586700241236,0.429057934791738,15.8623496981029,1.69174211432341e-20
3-
"2","n.two",0.0084216036360301,0.00243140044355351,3.46368433811826,0.00114682359453729
2+
"1","(Intercept)",7.0016182967857,0.409637476166867,17.0922308239532,8.41049614106333e-22
3+
"2","n.nine",0.0305382162593058,0.00954501296273808,3.19938971047197,0.00246772297558032

output/models/ZygopteraRichnessCurrent_Summary.csv

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"","term","estimate","std.error","statistic","p.value"
2-
"1","(Intercept)",0.934561788127682,0.129489014029536,7.2173056157066,3.82998910661173e-09
3-
"2","mean.threeh",-0.335944241204735,0.196841852783562,-1.7066707941127,0.0944831730440966
2+
"1","(Intercept)",0.94025559670646,0.118235263648641,7.95241256872919,3.00011515273737e-10
3+
"2","mean.three",-0.320401643063373,0.173671726998356,-1.84486933251033,0.0713630793374195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"","term","estimate","std.error","statistic","p.value"
2+
"1","(Intercept)",5.01701073330726,0.660974023197496,7.59032966081967,1.04755527700569e-09
3+
"2","mean.three",-2.39609904160638,0.970882091918778,-2.46796090024785,0.0172842405291333

script/4 - Models.R

+31-29
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ source("script/function - diagnosticplots.R")
1313

1414
#### Correlations ####
1515
# 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)) +
1717
geom_point() +
1818
geom_smooth(method = "lm", se = FALSE) +
1919
stat_cor()
2020
# highly correlated
2121

22-
ggplot(ani, aes(x = n.threeh, y = mean.threeh)) +
22+
ggplot(ani, aes(x = n.three, y = mean.three)) +
2323
geom_point() +
2424
geom_smooth(method = "lm", se = FALSE) +
2525
stat_cor()
26-
# correlation of 0.63, fairly correlated
26+
# correlation of 0.54, fairly correlated
2727

28-
ggplot(ani, aes(x = mean.two, y = sd.two)) +
28+
ggplot(ani, aes(x = mean.nine, y = sd.nine)) +
2929
geom_point() +
3030
geom_smooth(method = "lm", se = FALSE) +
3131
stat_cor()
32-
# correlation of 0.5, OK
32+
# correlation of -0.21, OK
3333

34-
ggplot(zyg, aes(x = mean.threeh, y = sd.threeh)) +
34+
ggplot(zyg, aes(x = mean.three, y = sd.three)) +
3535
geom_point() +
3636
geom_smooth(method = "lm", se = FALSE) +
3737
stat_cor()
38-
# correlation of 0.38, fairly correlated
38+
# correlation of 0.23, OK
3939

4040
# number of surrounding habitats and mean conductance are
4141
# highly correlated
@@ -46,27 +46,29 @@ ggplot(zyg, aes(x = mean.threeh, y = sd.threeh)) +
4646

4747
## Anisoptera ##
4848
# Abundance
49-
ani_abun <- lm(abundance ~ mean.two, data = ani)
49+
ani_abun <- lm(abundance ~ mean.nine, data = ani)
5050
summary(ani_abun)
5151
# significant
5252

53-
ani_abun_hab <- lm(abundance ~ n.two, data = ani)
53+
ani_abun_hab <- lm(abundance ~ n.nine, data = ani)
5454
summary(ani_abun_hab)
5555
# significant
5656

5757
# Shannon Diversity
58-
ani_shann <- lm(shannon ~ mean.two, data = ani)
58+
ani_shann <- lm(shannon ~ mean.nine, data = ani)
5959
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)
6263
summary(ani_shann_hab)
6364
# not significant
6465

6566
# Species Richness
66-
ani_sr <- lm(speciescount ~ mean.two, data = ani)
67+
ani_sr <- lm(speciescount ~ mean.nine, data = ani)
6768
summary(ani_sr)
6869
# mean significant
69-
ani_sr_hab <- lm(speciescount ~ n.two, data = ani)
70+
71+
ani_sr_hab <- lm(speciescount ~ n.nine, data = ani)
7072
summary(ani_sr_hab)
7173
# significant
7274

@@ -87,40 +89,40 @@ dev.off()
8789
summ1 <- broom::tidy(ani_abun)
8890
write.csv(summ1, "output/models/AnisopteraAbundanceCurrent_Summary.csv")
8991

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")
9294

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")
9597

9698
summ4 <- broom::tidy(ani_sr_hab)
9799
write.csv(summ4, "output/models/AnisopteraSpeciesRichnessHabitat_Summary.csv")
98100

99101
## Zygoptera ##
100102
# Abundance
101-
zyg_abun <- lm(abundance ~ mean.threeh, data = zyg)
103+
zyg_abun <- lm(abundance ~ mean.three, data = zyg)
102104
summary(zyg_abun)
103105
# not significant
104106

105-
zyg_abun_hab <- lm(abundance ~ n.threeh, data = zyg)
107+
zyg_abun_hab <- lm(abundance ~ n.three, data = zyg)
106108
summary(zyg_abun_hab)
107109
# not significant
108110

109111
# Shannon Diversity
110-
zyg_shann <- lm(shannon ~ mean.threeh, data = zyg)
112+
zyg_shann <- lm(shannon ~ mean.three, data = zyg)
111113
summary(zyg_shann)
112-
# almost significant (0.08)
114+
# almost significant (0.07)
113115

114-
zyg_shann_hab <- lm(shannon ~ n.threeh, data = zyg)
116+
zyg_shann_hab <- lm(shannon ~ n.three, data = zyg)
115117
summary(zyg_shann_hab)
116118
# not significant
117119

118120
# Species Richness
119-
zyg_sr <- lm(speciescount ~ mean.threeh, data = zyg)
121+
zyg_sr <- lm(speciescount ~ mean.three, data = zyg)
120122
summary(zyg_sr)
121123
# mean significant
122124

123-
zyg_sr_hab <- lm(speciescount ~ n.threeh, data = zyg)
125+
zyg_sr_hab <- lm(speciescount ~ n.three, data = zyg)
124126
summary(zyg_sr_hab)
125127
# not significant
126128

@@ -137,11 +139,11 @@ dev.off()
137139

138140
# model diagnostic plots look ok
139141

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")
142144

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")
145147

146148
# IMPORTANT: sd seems to be a dummy variable - switches direction and magnitude
147149
# of effect depending on what else is in the model, do not include in models. Can't

0 commit comments

Comments
 (0)