Installations, libraries and reading the data.
install.packages("haven")
Error in install.packages : Updating loaded packages
library(haven)
path = file.path("C:/",
"PATH/PATH",
"FILENAME.sav")
data = read_sav(path)
Factoring and renaming
data$legitimation <- relevel(factor(data$legitimation), ref = "banal_pres")
data$legitimation <- fct_recode(data$legitimation,
"Banal Presence" = "banal_pres",
"Denying Special Status" = "denying_spec_status",
"Equality" = "equality",
"Protecting Special Status" = "prot_spec_status",
"Public Utility" = "publ_utility",
"Threat & Governance" = "threat&govern",
"Values & Culture" = "values&culture"
)
Checking multicollinearity:
cor(data[, c("Zp_age", "Zlrgen_y", "Zlrecon_y", "Zgaltan_y", "Zseat_y")])
Zp_age Zlrgen_y Zlrecon_y Zgaltan_y Zseat_y
Zp_age 1.0000000 0.2953458 0.42002112 0.2196454 0.31369046
Zlrgen_y 0.2953458 1.0000000 0.89988631 0.7664157 -0.06701460
Zlrecon_y 0.4200211 0.8998863 1.00000000 0.5511589 0.09369789
Zgaltan_y 0.2196454 0.7664157 0.55115892 1.0000000 -0.11756740
Zseat_y 0.3136905 -0.0670146 0.09369789 -0.1175674 1.00000000
Zlrgen & Zlrecon = 0.89988631; strong correlation.
New variable:
data$Zlr_combined <- (data$Zlrgen_y + data$Zlrecon_y) / 2