You can continue to work with the analyses you did in the previous set of exercises. For the examples we are going to use, we need to first load and wrangle the data. NB You do not need to run this code, if you want to continue with/from the analyses you did in the previous exercises (which is what we would recommend).
library(haven)
library(dplyr)
library(sjlabelled)
gp_covid <-
read_sav(
"./data/ZA5667_v1-1-0.sav"
) %>%
set_na(na = c(-1:-99, 97, 98)) %>%
rowwise() %>%
mutate(
mean_trust =
mean(
c_across(hzcy044a:hzcy052a),
na.rm = TRUE
)
) %>%
ungroup() %>%
remove_all_labels() %>%
mutate(
pol_leaning_cat =
case_when(
between(political_orientation, 0, 3) ~ "left",
between(political_orientation, 4, 7) ~ "center",
political_orientation > 7 ~ "right"
) %>%
as.factor()
) %>%
filter(pol_leaning_cat != "NA")
gp_covid <-
gp_covid %>%
mutate(
curfew_yes_no =
case_when(
hzcy026a == 2 ~ 0,
hzcy026a == 1 ~ 1,
)
)
easystats
packages we have used in the lecture.
easytats
plots are based on ggplot2
. You could choose from one of ggplot2
’s built-in themes from this list: https://ggplot2.tidyverse.org/reference/ggtheme.html. In another step, you could adjust the color of the scale, e.g., with scale_colour_grey()
. Be creative.
plot_model()
function from sjPlot
.