As per usual, we first need to load our data. This time, we also wrangle some variables at the beginning. So please execute the following R commands.

library(dplyr)
library(haven)

allbus_2021_cda_2 <- 
  read_spss("./data/allbus_2021/ZA5280_v1-0-0.sav") %>% 
  mutate(
    trust_parliament = as.numeric(pt03),
    party = pv01,
    political_orientation = as.numeric(pa01),
    satisfaction_democracy = ifelse(as.numeric(ps03) <= 2, 1, 0)
  )
## Converting atomic to factors. Please wait...

In case you have not done so yet, please also install the performance package for this set of exercises.

if (!require(performance)) install.packages("performance")

In the following exercise, we will cover/repeat some of the basics of regression analysis in R.

1

To begin with, run a simple linear regression model with trust in the German federal parliament (trust_parliament) as the outcome variable and choice of party (party) and political orientation (political_orientation) as predictors.
To get some (more) informative output, you can use summary() again.

2

As the next step in our analyses, we want assess whether these whole previous findings have something to do with satisfaction in democracy. For this purpose, we switch the dependent variable to satisfaction with democracy and move the the trust in parliament variable to the independent ones. Attention: We now have to run a logistic regression.
This time, you need the glm() function in which you need to specify a link function. The name of the outcome variable is satisfaction_democracy.

3

Reviewer 2 is at it again… As Cauchit links are all the rage in her/his field, she/he wants us to run the same model with the sole difference of using a cauchit link…. sigh!
Have a look at the help page ?family to see how you can include a cauchit link.

4

Compare both regression models using an ANOVA. Use the argument test = "LRT" in the function we need for this to perform a likelihood ratio test. What’s your interpretation?
A p-value considered as statistically significant would indicate a difference between the models.

5

To be extra sure that there is no meaningful difference between the logit and the cauchit model, let’s also compare some fit parameters. We want the following model fit metrics: AIC, BIC, R², and RMSE
The performance package provides a function for comparing the performance of different models in terms of their fit.