1

Let’s re-estimate our model from the previous exercise, just with another dependent variable. Again, consult the GESIS Panel codebook and choose another variable that may make sense to be inserted into a regression.

If you’re having a hard time finding suitable variables, what about one of the dependent variables from the first set of exercises for this session:

  1. hzcy005a (risk of infecting others)
  2. hzcy026a (obeying curfew)
  3. hzcy072a (staying home for childcare)
Be aware that you may have to conduct some recoding.

2

Re-run your analysis just by switching the dependent variables.

3

Now extract the prediction data for your main independent variable for this model.
You can use the function get_model_data() from the sjPlot package. You should set the option type = "pred" and provide the name of your independent variable in the terms option.

4

Repeat the previous step for your original model and combine both datasets. The resulting data should be a data.frame or a tibble.
  • For combining the data, you simply have append both data sets rowwise. You can either use the bind_rows() function from the dplyr package or rbind() from base R.
  • Make sure that you add an indicator variable for the model for each of the data sets before during the combination.
  • You can convert any (well, a lot of…) data objects to a tibble using as_tibble() from the tibble package.

5

Create a faceted ggplot with the regression predictions (without further customizing anything).
You can use facet_wrap() here.