Noah Levysohn, Leon Spillmann, Ilan Frei, Lawin Ideli, Alexander Pollakis
Published
January 19, 2026
ESS8 Datenmanipulation
alexandria()
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 4.0.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.2.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Version: 1.39.4
Date: 2024-07-23
Author: Philip Leifeld (University of Manchester)
Consider submitting praise using the praise or praise_interactive functions.
Please cite the JSS article in your publications -- see citation("texreg").
Attache Paket: 'texreg'
Das folgende Objekt ist maskiert 'package:tidyr':
extract
Please cite as:
Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
Attache Paket: 'MASS'
Das folgende Objekt ist maskiert 'package:dplyr':
select
Lade nötiges Paket: stats4
Lade nötiges Paket: splines
Please cite as:
Schlegel, Benjamin E. (2024). glm.predict: Predicted Values and Discrete Changes for Regression Models.
R package version 4.3-0. https://cran.r-project.org/package=glm.predict
Classes and Methods for R originally developed in the
Political Science Computational Laboratory
Department of Political Science
Stanford University (2002-2015),
by and under the direction of Simon Jackman.
hurdle and zeroinfl functions by Achim Zeileis.
Learn more about sjPlot with 'browseVignettes("sjPlot")'.
Attache Paket: 'sjPlot'
Das folgende Objekt ist maskiert 'package:ggplot2':
set_theme
Lade nötiges Paket: Matrix
Attache Paket: 'Matrix'
Die folgenden Objekte sind maskiert von 'package:tidyr':
expand, pack, unpack
Registered S3 method overwritten by 'clubSandwich':
method from
bread.mlm sandwich
df_ess8 <-read_csv("ESS8e02_3.csv")
Rows: 44387 Columns: 535
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): name, proddate, cntry, ctzshipc, cntbrthc, lnghom1, lnghom2, fbrn...
dbl (525): essround, edition, idno, dweight, pspwght, pweight, anweight, nws...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Rows: 59685 Columns: 47
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): name, proddate, cntry
dbl (44): essround, edition, idno, dweight, pspwght, pweight, anweight, prob...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Rows: 150234 Columns: 45
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): name, proddate, cntry
dbl (42): essround, edition, idno, dweight, pspwght, pweight, anweight, prob...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df_ess11 <-read_csv("ESS11e04_1.csv")
Warning: One or more parsing issues, call `problems()` on your data frame for details,
e.g.:
dat <- vroom(...)
problems(dat)
Rows: 50116 Columns: 691
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (9): name, proddate, cntry, cntbrthd, lnghom1, lnghom2, fbrncntc, mbr...
dbl (666): essround, edition, idno, dweight, pspwght, pweight, anweight, nw...
lgl (1): rshipa15
dttm (15): inwds, ainws, ainwe, binwe, cinwe, dinwe, einwe, finwe, hinwe, i...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Vermerk: Die Funktion alexandria() ist eine eigens kreierte Funktion zum Laden mehrerer Packete.
Vermerk: Antwort-Items aus dem Datensatz, welche nicht Teil der Skala sind (beispielsweise Don’t know) werden hier zu NAs umcodiert. Abhängige Varaible wird zu einer binären Variable umcodiert.
lavaan 0.6-20 ended normally after 31 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 8
Used Total
Number of observations 1462 1525
Model Test User Model:
Test statistic 9.139
Degrees of freedom 2
P-value (Chi-square) 0.010
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Latent Variables:
Estimate Std.Err z-value P(>|z|)
F1 =~
cultlif_ndrmnd 1.000
appl_refugee 0.498 0.060 8.349 0.000
increastx_fssl 0.252 0.030 8.444 0.000
attach_cntry 0.138 0.042 3.292 0.001
Variances:
Estimate Std.Err z-value P(>|z|)
.cultlif_ndrmnd 2.832 0.284 9.989 0.000
.appl_refugee 0.621 0.069 8.956 0.000
.increastx_fssl 1.238 0.049 25.275 0.000
.attach_cntry 3.537 0.132 26.857 0.000
F1 2.252 0.306 7.354 0.000
cfa <-"F1 =~ cultlife_undermined + appl_refugee + increasetax_fossil + attach_cntry"cfa_fit_de <- lavaan::cfa(cfa_1, data = df_de_a)summary(cfa_fit_de)
lavaan 0.6-20 ended normally after 32 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 8
Used Total
Number of observations 2788 2852
Model Test User Model:
Test statistic 16.331
Degrees of freedom 2
P-value (Chi-square) 0.000
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Latent Variables:
Estimate Std.Err z-value P(>|z|)
F1 =~
cultlif_ndrmnd 1.000
appl_refugee 0.434 0.034 12.932 0.000
increastx_fssl 0.270 0.021 13.178 0.000
attach_cntry 0.126 0.032 3.991 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
.cultlif_ndrmnd 3.511 0.229 15.334 0.000
.appl_refugee 0.730 0.044 16.610 0.000
.increastx_fssl 1.126 0.034 33.176 0.000
.attach_cntry 4.649 0.125 37.128 0.000
F1 2.776 0.251 11.052 0.000
lavaan 0.6-20 ended normally after 32 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 6
Used Total
Number of observations 1352 1525
Model Test User Model:
Test statistic 0.000
Degrees of freedom 0
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Latent Variables:
Estimate Std.Err z-value P(>|z|)
F2 =~
scbnfts_strncn 1.000
diffinliving 0.119 0.075 1.580 0.114
benfts_ntnttld 0.795 0.529 1.503 0.133
Variances:
Estimate Std.Err z-value P(>|z|)
.scbnfts_strncn 0.530 0.252 2.104 0.035
.diffinliving 0.773 0.030 25.814 0.000
.benfts_ntnttld 0.650 0.161 4.045 0.000
F2 0.378 0.253 1.494 0.135
lavaan 0.6-20 ended normally after 26 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 6
Used Total
Number of observations 2694 2852
Model Test User Model:
Test statistic 0.000
Degrees of freedom 0
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Latent Variables:
Estimate Std.Err z-value P(>|z|)
F2 =~
scbnfts_strncn 1.000
diffinliving 0.132 0.070 1.900 0.057
benfts_ntnttld 0.352 0.181 1.946 0.052
Variances:
Estimate Std.Err z-value P(>|z|)
.scbnfts_strncn 0.282 0.342 0.825 0.409
.diffinliving 0.807 0.023 35.414 0.000
.benfts_ntnttld 0.805 0.048 16.893 0.000
F2 0.668 0.343 1.949 0.051
Welch Two Sample t-test
data: df_ch_a$index_galtan[df_ch_a$vote == 1] and df_de_a$index_galtan[df_de_a$vote == 1]
t = 0.45383, df = 78.298, p-value = 0.6512
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.1357355 0.2158987
sample estimates:
mean of x mean of y
3.076196 3.036114
Welch Two Sample t-test
data: df_ch_a$index_econ[df_ch_a$vote == 1] and df_de_a$index_econ[df_de_a$vote == 1]
t = 1.1842, df = 83.204, p-value = 0.2397
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.08167486 0.32204951
sample estimates:
mean of x mean of y
2.841299 2.721112
performance::r2_mcfadden(logit_svp_econ)
Warning in eval(family$initialize): Nicht-ganzzahlige #Erfolge in einem
binomial-GLM
# R2 for Generalized Linear Regression
R2: 0.191
adj. R2: 0.183
performance::r2_mcfadden(logit_afd_econ)
Warning in eval(family$initialize): Nicht-ganzzahlige #Erfolge in einem
binomial-GLM
# R2 for Generalized Linear Regression
R2: 0.058
adj. R2: 0.056
set.seed(123)pred_out_ch_econ <-predict(logit_svp_econ, type ="response")pred_out_de_econ <-predict(logit_afd_econ, type ="response")pROC::auc(logit_svp_econ$model$vote, pred_out_ch_econ)
Welch Two Sample t-test
data: df_ess11_ch$index_galtan[df_ess11_ch$vote == 1] and df_ess11_de$index_galtan[df_ess11_de$vote == 1]
t = -1.5864, df = 139.23, p-value = 0.1149
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.21096271 0.02313203
sample estimates:
mean of x mean of y
2.434670 2.528585
set.seed(123)pred_out_ch_11 <-predict(logit_svp_11, type ="response")pred_out_de_11 <-predict(logit_afd_11, type ="response")library(pROC)pROC::auc(logit_svp_11$model$vote, pred_out_ch_11)
Ein allgemeines Problem ist die enorme Unterrepräsentation der SVP-/AfD- Wähler:innen, welche gegebenenfalls die Analyse verzerrt: So haben von 2420 deutschen Proband:innen nur 88 im Datensatz (ESS11) angegeben die AfD gewählt zu haben, was nicht dem realen Wahlanteil entspricht. Dies könnte möglicherweise die tiefe proportionale Fehlerreduktion erklären: Das naive Modell hat bereits eine sehr hohe Trefferquote. Die geringe Fallzahl erschwert zudem die Schätzung der Koeffizienten und die vorhergesagten Wahrscheinlichkeiten werden unterschätzt.
Die Faktorladungen der Variablen innerhalb eines Index wurden überprüft. Das Ziel der Aggregation war nicht die Identifizierung eines einzelnen latenten Faktors, sondern die Erfassung der verschiedenen Facetten der jeweiligen Dimension. Die Faktoren sind alle in die jeweils selbe Richtung - auch wenn teilweise schwach - korreliert.
Die Störvariable “Bildung” wurde für Deutschland in der Analyse des ESS8 Datensatzes nicht kontrolliert, da diese Variable innerhalb des Datensatzes in mehrere Variablen aufgefächert ist und die Aggregation dieser in eine einzelne, den Rahmen dieses Projektes überschritten hätte.
KI-Statement
Die Autor:innen deklarieren, dass generative KI (z. B. ChatGPT) unterstützend genutzt wurde. Der Output der KI wurde beispielsweise verwendet, um sich einen Überblick über das Thema zu verschaffen oder, um bei der Formatierung respektive Visualisierung zu unterstützen. GitHub CoPilot wurde nicht genutzt. Alle Inhalte sind allein durch die Autor:innen erstellt; sie tragen die Verantwortung bezüglich Korrektheit des Inhalts.