-
Notifications
You must be signed in to change notification settings - Fork 0
/
5_formulasModels.R
130 lines (119 loc) · 4.32 KB
/
5_formulasModels.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 5_formulasModels ---------------------------------------------------------------------------
# script with all 11 models created to look at relationship of birds and
# temperature and infestation, considering space, changes in intercept and
# slope, and delay after infestation.
#
# MODELS WITH TEMPERATURE: --------------------------------------------------------
## model 1 (full model) ------------------------------------------------------------
formula1 <- SpeciesTotal ~ 1 +
year_offset +
infoff +
year_offset : infoff +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
temp_min_scale : infoff +
temp_min_scale : infoff : year_offset +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 2: immediate effect -------------------------------------------------------
formula2 <- SpeciesTotal ~ 1 +
year_offset +
infoff +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
temp_min_scale : infoff +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 3: long-term effect --------------------------------------------------------
formula3 <- SpeciesTotal ~ 1 +
year_offset +
year_offset : infoff +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
temp_min_scale : infoff : year_offset +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
# NO EFFECT OF TEMPERATURE ON INFESTATION -------------------------------------------
## model 4 --------------------------------------------------------------------------
formula4 <- SpeciesTotal ~ 1 +
year_offset +
infoff +
year_offset : infoff +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 5 --------------------------------------------------------------------------
formula5 <- SpeciesTotal ~ 1 +
year_offset +
infoff +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 6 --------------------------------------------------------------------------
formula6 <- SpeciesTotal ~ 1 +
year_offset +
year_offset : infoff +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
# MODELS WITH NO TEMPERATURE: ------------------------------------------------------
## model 7---------------------------------------------------------------------------
formula7 <- SpeciesTotal ~ 1 +
year_offset +
infoff +
year_offset : infoff +
NewObserver +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 8 --------------------------------------------------------------------------
formula8 <- SpeciesTotal ~ 1 +
year_offset +
infoff +
NewObserver +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 9 --------------------------------------------------------------------------
formula9 <- SpeciesTotal ~ 1 +
year_offset +
year_offset : infoff +
NewObserver +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
# NO INFESTATION EFFECTS ------------------------------------------------------------
## model 10 -------------------------------------------------------------------------
formula10 <- SpeciesTotal ~ 1 +
year_offset +
NewObserver +
temp_min_scale +
temp_min_scale : year_offset +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
## model 11 (null model) ------------------------------------------------------------
formula11 <- SpeciesTotal ~ 1 +
year_offset +
NewObserver +
f(ObserverRoute, model="iid") +
f(Year, model="iid") +
f(hexID, model="bym", graph=hex.adj, constr=TRUE)
formulas <- list(formula1,formula2,formula3,formula4,
formula6,formula6,formula7,formula8,
formula9,formula10, formula11)