@@ -43,16 +43,12 @@ table_confint <- function(scores, group_var = NULL) {
43
43
n_models = n_distinct(Model ),
44
44
p_models = round(n_models / total_models * 100 , 1 ),
45
45
mean = mean(wis , na.rm = TRUE ),
46
- ci = calc_ci (wis , na.rm = TRUE , R = 1000 )
46
+ sd = sd (wis , na.rm = TRUE )
47
47
) | >
48
- unnest(ci ) | >
49
48
mutate(
50
49
Models = paste0(n_models , " (" , p_models , " %)" ),
51
50
Forecasts = paste0(n_forecasts , " (" , p_forecasts , " %)" ),
52
- " Mean WIS (95% CI)" = paste0(
53
- round(mean , 2 ), " (" ,
54
- round(lboot , 2 ), " -" , round(uboot , 2 ), " )"
55
- )
51
+ " Mean WIS (SD)" = paste0(round(mean , 2 ), " (" , round(sd , 2 ), " )" )
56
52
)
57
53
58
54
if (! is.null(group_var )) {
@@ -68,12 +64,8 @@ create_raw_table1 <- function(scores, targets) {
68
64
mutate(Variable = " Overall" , group = " " )
69
65
method <- table_confint(scores , " Method" )
70
66
targets <- table_confint(scores , " CountryTargets" )
71
- horizon <- table_confint(scores , " Horizon" ) | >
72
- filter(! is.na(Variable ))
73
- trend <- table_confint(scores , " Trend" )
74
67
bind_rows(
75
- overall , method , targets ,
76
- horizon , trend
68
+ overall , method , targets
77
69
)
78
70
}
79
71
@@ -108,7 +100,7 @@ print_table1 <- function(scores) {
108
100
Variable ,
109
101
starts_with(" Models_" ),
110
102
starts_with(" Forecasts_" ),
111
- starts_with(" Mean WIS (95% CI )_" )
103
+ starts_with(" Mean WIS (SD )_" )
112
104
)
113
105
# # reorder
114
106
for (outcome in rev(outcome_targets )) {
@@ -127,20 +119,18 @@ print_table1 <- function(scores) {
127
119
kable(
128
120
caption = paste0(
129
121
" Characteristics of forecasts sampled from " ,
130
- " the European COVID-19 Forecast Hub, March 2021-2023." ,
131
- " Each forecast was scored for accuracy using the weighted " ,
132
- " interval score (WIS), summarised by the mean " ,
133
- " with bootstrapped 95% confidence interval ."
122
+ " the European COVID-19 Forecast Hub, March 2021-2023. " ,
123
+ " Forecast performance was measured using the weighted " ,
124
+ " interval score (WIS), with a lower score indicating a more " ,
125
+ " accurate forecast ."
134
126
),
135
127
col.names = str_remove(colnames(table1 ), " _.*$" ),
136
128
align = c(" l" , rep(" r" , ncol(table1 ) - 1 ))
137
129
) | >
138
130
pack_rows(index = c(
139
131
" " = 1 ,
140
132
" Method" = 5 ,
141
- " Number of country targets" = 2 ,
142
- " Week ahead horizon" = 4 ,
143
- " 3-week trend in incidence" = 3
133
+ " Number of country targets" = 2
144
134
)) | >
145
135
add_header_above(headers_to_add )
146
136
}
0 commit comments