preX = read_xlsx("dk data.xlsx")
names(preX)[1:2] = c("id", "alGov")
pre = preX %>% select(-alGov) %>%
pivot_longer(cols = market:architecture, names_to = "Governance") %>%
filter(value > 0)
pre$Phase = "Pre (trust)"
post = read_xlsx("dk data.xlsx", sheet = 2)
names(post)[c(1, 3)] = c("id", "applications")
post = post %>% pivot_longer(cols = architecture:government, names_to = "Governance") %>%
filter(value > 0) %>% mutate(value = ((6 - value) * 9 / 5) + 1)
post$Phase = "Post (priority)"
df = rbind(pre, post) %>%
mutate(Phase = factor(Phase, levels = c("Pre (trust)", "Post (priority)"))) %>%
left_join(., preX[, 1:2], by = "id") %>%
mutate(alGov = case_when(
alGov == 0 ~ "Opposes AlGov",
alGov == 1 ~ "Supports AlGov")) %>% filter(!is.na(alGov)) %>%
pivot_wider(id_cols = c("id", "Governance", "Phase", "alGov"),
names_from = c("Governance", "Phase"),
names_sep = "_",
values_from = value)
dfr = df[rowSums(is.na(df[, 9:14]))< 6, ] # DFR = data.frame reduced
df = df %>%
pivot_longer(cols = 3:14,
names_to = c("Governance", "Phase"),
names_sep = "_") %>%
mutate(Phase = factor(Phase, levels = c("Pre (trust)", "Post (priority)"))) %>%
filter(!is.na(value))
dfr = dfr %>%
pivot_longer(cols = 3:14,
names_to = c("Governance", "Phase"),
names_sep = "_") %>%
mutate(Phase = factor(Phase, levels = c("Pre (trust)", "Post (priority)"))) %>%
mutate(value = case_when(
is.na(value) & Phase == "Post (priority)" ~ 0,
TRUE ~ value
)) %>%
filter(!is.na(value))
Only repondents refusing to state their support/opposition to AlGov were filtered out:
df %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase)) +
facet_grid(rows = vars(alGov)) +
geom_boxplot(alpha = 0.15) +
geom_point(size = 2.5, alpha = 0.35,
position = position_jitterdodge(jitter.height = 0.25,
jitter.width = 0.5,)) +
labs (
title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
x = "",
y = "Trust/Priority (1 - min, 10 - max)"
) +
scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
scale_y_continuous(breaks = 1:10)+
theme_classic() +
theme(
legend.position = "bottom"
)
df %>% group_by(Governance, Phase, alGov) %>% summarise(value = mean(value, na.rm = T)) %>%
pivot_wider(id_cols = c("Governance", "Phase", "alGov"), names_from = Phase) %>%
mutate(Size = 1 + 2 * abs(`Pre (trust)` - `Post (priority)`)) %>%
pivot_longer(cols = 3:4, names_to = "Phase") %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase, group = Governance, size = Size)) +
facet_grid(rows = vars(alGov)) +
geom_point(alpha = 0.5, position = position_dodge2(width = .5)) +
geom_line(size = 1, color = "#808080", position = position_dodge2(width = .5)) +
labs(title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
y = " Average trust/priority (1 - min, 10 - max)",
caption = "Size of points reflects the difference between pre and post assessment") +
guides(size = "none") +
scale_y_continuous(breaks = 1:10, limits = c(1, 10))+
scale_size_identity() +
theme_classic() +
theme(
legend.position = "bottom"
)
Repondents refusing to state their support/opposition to AlGov were filtered out, but we also filtered out respondents refusing state their priorities regarding governance measures:
dfr %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase)) +
facet_grid(rows = vars(alGov)) +
geom_boxplot(alpha = 0.15) +
geom_point(size = 2.5, alpha = 0.35,
position = position_jitterdodge(jitter.height = 0.25,
jitter.width = 0.5,)) +
labs (
title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
subtitle = "Reduced sample",
x = "",
y = "Trust/Priority (1 - min, 10 - max)"
) +
scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
scale_y_continuous(breaks = 1:10)+
theme_classic() +
theme(
legend.position = "bottom"
)
dfr %>% group_by(Governance, Phase, alGov) %>% summarise(value = mean(value, na.rm = T)) %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase, group = Governance)) +
facet_grid(rows = vars(alGov)) +
geom_point(size = 5, alpha = 0.5, position = position_dodge2(width = .5)) +
geom_line(color = "#808080", position = position_dodge2(width = .5)) +
labs(title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
subtitle = "Reduced sample",
y = " Average trust/priority (1 - min, 10 - max)") +
scale_y_continuous(breaks = 1:10, limits = c(1, 10))+
theme_classic() +
theme(
legend.position = "bottom"
)
df %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase)) +
facet_grid(rows = vars(alGov)) +
geom_boxplot(alpha = 0.15) +
geom_point(size = 2.5, alpha = 0.35,
position = position_jitterdodge(jitter.height = 0.25,
jitter.width = 0.5,)) +
labs (
title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
subtitle = "Full sample",
x = "",
y = "Trust/Priority (1 - min, 10 - max)"
) +
scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
scale_y_continuous(breaks = 1:10)+
theme_classic() +
theme(
legend.position = "bottom"
)
dfr %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase)) +
facet_grid(rows = vars(alGov)) +
geom_boxplot(alpha = 0.15) +
geom_point(size = 2.5, alpha = 0.35,
position = position_jitterdodge(jitter.height = 0.25,
jitter.width = 0.5,)) +
labs (
title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
subtitle = "Reduced sample",
x = "",
y = "Trust/Priority (1 - min, 10 - max)"
) +
scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
scale_y_continuous(breaks = 1:10)+
theme_classic() +
theme(
legend.position = "bottom"
)
df %>% group_by(Governance, Phase, alGov) %>% summarise(value = mean(value, na.rm = T)) %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase, group = Governance)) +
facet_grid(rows = vars(alGov)) +
geom_point(size = 5, alpha = 0.5, position = position_dodge2(width = .5)) +
geom_line(color = "#808080", position = position_dodge2(width = .5)) +
labs(title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
subtitle = "Full sample",
y = " Average trust/priority (1 - min, 10 - max)") +
scale_y_continuous(breaks = 1:10, limits = c(1, 10))+
theme_classic() +
theme(
legend.position = "bottom"
)
dfr %>% group_by(Governance, Phase, alGov) %>% summarise(value = mean(value, na.rm = T)) %>%
ggplot(aes(x = Governance, y = value, fill = Phase, color = Phase, group = Governance)) +
facet_grid(rows = vars(alGov)) +
geom_point(size = 5, alpha = 0.5, position = position_dodge2(width = .5)) +
geom_line(color = "#808080", position = position_dodge2(width = .5)) +
labs(title = "Comparison of trust (pre-workshop) and priority (post-workshop) of\ngovernance measures according support of AlGov",
subtitle = "Reduced sample",
y = " Average trust/priority (1 - min, 10 - max)") +
scale_y_continuous(breaks = 1:10, limits = c(1, 10))+
theme_classic() +
theme(
legend.position = "bottom"
)