-
Notifications
You must be signed in to change notification settings - Fork 0
/
7_extract_fixed_pars.R
86 lines (75 loc) · 2.67 KB
/
7_extract_fixed_pars.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
# 7_extract_fixed_pars ---------------------------------------------------------------------------
# functions to extract parameter estimates for the summary objects of the model results
f_intercept <- function(a){
if("(Intercept)" %in% rownames(a)){
a[which(rownames(a) == "(Intercept)"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_year_offset <- function(a){
if("year_offset" %in% rownames(a)){
a[which(rownames(a) == "year_offset"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_infoff <- function(a){
if("infoff" %in% rownames(a)){
a[which(rownames(a) == "infoff"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_NewObserver <- function(a){
if("NewObserverTRUE" %in% rownames(a)){
a[which(rownames(a) == "NewObserverTRUE"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_temp_min_scale <- function(a){
if("temp_min_scale" %in% rownames(a)){
a[which(rownames(a) == "temp_min_scale"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_year_offset_infoff <- function(a){
if("year_offset:infoff" %in% rownames(a)){
a[which(rownames(a) == "year_offset:infoff"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_year_offset_temp_min_scale <- function(a){
if("year_offset:temp_min_scale" %in% rownames(a)){
a[which(rownames(a) == "year_offset:temp_min_scale"), c(1,3,5)]
} else {
if("temp_min_scale:year_offset" %in% rownames(a)){
a[which(rownames(a) == "temp_min_scale:year_offset"), c(1,3,5)]
} else {
rep(NA,3)}
}
}
f_infoff_temp_min_scale <- function(a){
if("infoff:temp_min_scale" %in% rownames(a)){
a[which(rownames(a) == "infoff:temp_min_scale"), c(1,3,5)]} else {
rep(NA,3)
}
}
f_year_offset_infoff_temp_min_scale <- function(a){
if("year_offset:temp_min_scale:infoff" %in% rownames(a)){
a[which(rownames(a) == "year_offset:temp_min_scale:infoff"), c(1,3,5)]
} else {
if("temp_min_scale:year_offset:infoff" %in% rownames(a)){
a[which(rownames(a) == "temp_min_scale:year_offset:infoff"), c(1,3,5)]
} else {
if("temp_min_scale:infoff:year_offset" %in% rownames(a)){
a[which(rownames(a) == "temp_min_scale:infoff:year_offset"), c(1,3,5)]
} else {
if("year_offset:infoff:temp_min_scale" %in% rownames(a)){
a[which(rownames(a) == "year_offset:infoff:temp_min_scale"), c(1,3,5)]
} else {
if("infoff:temp_min_scale:year_offset" %in% rownames(a)){
a[which(rownames(a) == "infoff:temp_min_scale:year_offset"), c(1,3,5)]
} else {
if("infoff:year_offset:temp_min_scale" %in% rownames(a)){
a[which(rownames(a) == "infoff:year_offset:temp_min_scale"), c(1,3,5)]
} else {
rep(NA,3)}}}}}}
}