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,
      )
  )

1

Re-use your analysis from the previous set of exercises and run an interaction model between your IV and the other covariate. Plot the interaction as a coefficient plot.
For the coefficient plot, you can use the easystats packages we have used in the lecture.

2

Imagine that you want to use the plot in a publication. Color figures usually cost extra. So, to save some money, try to make let the plot “turn grey”.
Remember that the 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.

3

Plot the interaction effect as a prediction.
For this purpose, you need the plot_model() function from sjPlot.