p1 <-ggplot(preds_movement, aes(x = .draw, y = .epred)) +geom_area(aes(fill = .category), position =position_stack()) +geom_label(data =calc_fuzzy_labs(preds_movement_details, filter_small =FALSE),aes(x = x, y = y, label = prob_ci_nice, hjust = hjust),fill = scales::alpha("white", 0.4), label.size =0,fontface ="bold", size =8, size.unit ="pt" ) +scale_x_continuous(breaks =NULL, expand =c(0, 0)) +scale_y_continuous(labels =label_percent(), expand =c(0, 0)) +scale_fill_manual(values = clrs[c(7, 4, 2)]) +labs(x =NULL, y ="Cumulative\nprobabilities",fill ="Internal movement measures", tag ="A" ) +facet_nested_wrap(vars(panbackdichot, derogation_ineffect),strip = nested_settings,nrow =1 ) +theme_pandem() + theme_fuzzy_barp2 <-ggplot(preds_pubtrans, aes(x = .draw, y = .epred)) +geom_area(aes(fill = .category), position =position_stack()) +geom_label(data =calc_fuzzy_labs(preds_pubtrans_details, filter_small =FALSE),aes(x = x, y = y, label = prob_ci_nice, hjust = hjust),fill = scales::alpha("white", 0.4), label.size =0,fontface ="bold", size =8, size.unit ="pt" ) +scale_x_continuous(breaks =NULL, expand =c(0, 0)) +scale_y_continuous(labels =label_percent(), expand =c(0, 0)) +scale_fill_manual(values = clrs[c(7, 4, 2)]) +labs(x =NULL, y ="Cumulative\nprobabilities",fill ="Public transportation measures", tag ="B" ) +facet_nested_wrap(vars(panbackdichot, derogation_ineffect),strip = nested_settings,nrow =1 ) +theme_pandem() + theme_fuzzy_barp3 <-ggplot(preds_stayhome, aes(x = .draw, y = .epred)) +geom_area(aes(fill = .category), position =position_stack()) +geom_label(data =calc_fuzzy_labs(preds_stayhome_details, filter_small =TRUE),aes(x = x, y = y, label = prob_ci_nice, hjust = hjust),fill = scales::alpha("white", 0.4), label.size =0,fontface ="bold", size =8, size.unit ="pt" ) +scale_x_continuous(breaks =NULL, expand =c(0, 0)) +scale_y_continuous(labels =label_percent(), expand =c(0, 0)) +scale_fill_manual(values = clrs[c(7, 4, 2, 1)], guide =guide_legend(nrow =2)) +labs(x =NULL, y ="Cumulative\nprobabilities",fill ="Stay at home measures", tag ="C" ) +facet_nested_wrap(vars(panbackdichot, derogation_ineffect),strip = nested_settings,nrow =1 ) +theme_pandem() + theme_fuzzy_bar(p1 / line_divider / p2 / line_divider / p3) +plot_layout(heights =c(0.31, 0.035, 0.31, 0.035, 0.31)) +plot_annotation(caption =str_wrap(glue("The vertical slices of the bars depict 500 posterior samples;","the fuzziness represents the uncertainty in category boundaries.","95% credible intervals are shown as ranges in each category",.sep =" " ),width =100 ),theme =theme(plot.caption =element_text(margin =margin(t =10), size =rel(0.7),family ="Noto Sans", face ="plain" ) ) )
Complete table of results
Code
notes <-paste("Note: Estimates are median posterior log odds from ordered logistic regression models;","95% credible intervals (highest density posterior interval, or HDPI) in brackets.")m_tbl_restrictions |>set_names(c("Restricted movement", "Close public transit", "Stay at home")) |>modelsummary(estimate ="{estimate}",statistic ="[{conf.low}, {conf.high}]",coef_map = coef_map,gof_map = gof_map,output ="tinytable",fmt =fmt_significant(2),notes = notes,width =c(0.3, rep(0.23, 3)) ) |>style_tt(i =seq(1, 23, 2), j =1, rowspan =2, alignv ="t") |>style_tt(bootstrap_class ="table table-sm" )
Complete results from models showing relationship between derogations
and COVID-19 restrictions
Restricted movement
Close public transit
Stay at home
Note: Estimates are median posterior log odds from ordered logistic regression models; 95% credible intervals (highest density posterior interval, or HDPI) in brackets.
Derogation in effect
1.09
1.1
1.9
[0.85, 1.30]
[0.9, 1.3]
[1.7, 2.1]
Pandemic backsliding (PanBack), dichotomous
0.61
0.75
1.11
[0.44, 0.78]
[0.61, 0.90]
[0.96, 1.27]
Derogation in effect × Pandemic backsliding
0.96
0.11
-0.44
[-0.13, 2.19]
[-0.50, 0.72]
[-1.00, 0.14]
New cases (standardized)
0.59
-0.092
0.015
[0.36, 0.81]
[-0.176, -0.017]
[-0.075, 0.107]
New deaths (standardized)
0.42
0.24
0.34
[0.23, 0.60]
[0.16, 0.32]
[0.25, 0.42]
Cumulative cases (standardized)
-0.70
-0.040
-0.063
[-0.92, -0.50]
[-0.141, 0.068]
[-0.176, 0.054]
Cumulative deaths (standardized)
0.81
0.148
0.070
[0.59, 1.03]
[0.041, 0.251]
[-0.044, 0.189]
Rule of law index
-0.55
-0.81
-0.37
[-0.68, -0.42]
[-0.94, -0.68]
[-0.49, -0.25]
Year-week number
-0.021
-0.0113
-0.00062
[-0.023, -0.019]
[-0.0132, -0.0092]
[-0.00252, 0.00140]
Cut 1
-1.6
-0.94
-1.2
[-1.8, -1.5]
[-1.05, -0.83]
[-1.3, -1.1]
Cut 2
-0.84
0.90
0.039
[-0.96, -0.73]
[0.78, 1.01]
[-0.077, 0.142]
Cut 3
2.8
[2.7, 3.0]
N
9591
9591
9591
\(R^2\)
0.11
0.07
0.09
Contrasts
Code
p1 <- diffs_movement |>ggplot(aes(x = .epred, y =fct_rev(.category), color = .category)) +geom_vline(xintercept =0, linewidth =0.25, linetype ="21") +stat_pointinterval() +facet_nested_wrap(vars(panbackdichot, derogation_ineffect), strip = nested_settings_diffs) +scale_x_continuous(labels = label_pp) +scale_color_manual(values = clrs[c(7, 4, 2)], guide ="none") +labs(x =NULL, y =NULL,title ="Internal movement measures", tag ="A" ) +theme_pandem() + theme_diffsp2 <- diffs_pubtrans |>ggplot(aes(x = .epred, y =fct_rev(.category), color = .category)) +geom_vline(xintercept =0, linewidth =0.25, linetype ="21") +stat_pointinterval() +facet_nested_wrap(vars(panbackdichot, derogation_ineffect), strip = nested_settings_diffs) +scale_x_continuous(labels = label_pp) +scale_color_manual(values = clrs[c(7, 4, 2)], guide ="none") +labs(x =NULL, y =NULL,title ="Public transportation measures", tag ="B" ) +theme_pandem() + theme_diffsp3 <- diffs_stayhome |>ggplot(aes(x = .epred, y =fct_rev(.category), color = .category)) +geom_vline(xintercept =0, linewidth =0.25, linetype ="21") +stat_pointinterval() +facet_nested_wrap(vars(panbackdichot, derogation_ineffect), strip = nested_settings_diffs) +scale_x_continuous(labels = label_pp) +scale_color_manual(values = clrs[c(7, 4, 2, 1)], guide ="none") +labs(x =NULL, y =NULL,title ="Stay at home measures", tag ="C" ) +theme_pandem() + theme_diffs(p1 / line_divider / p2 / line_divider / p3) +plot_layout(heights =c(0.295, 0.035, 0.295, 0.035, 0.34)) +plot_annotation(caption =str_wrap(glue("Point shows posterior median;", " thick lines show 80% credible interval;","thin black lines show 95% credible interval",.sep =" " ),width =150 ),theme =theme(plot.caption =element_text(margin =margin(t =10), size =rel(0.7),family ="Noto Sans", face ="plain" ) ) )