#Einlesen vom ESS-Datensatz
ess <- read.spss("/Users/krispinkruger/Krüger/Bachelorarbeit/Data/ESS9e03_1/ESS9e03_1.sav"
,use.value.labels = FALSE,
to.data.frame = TRUE,
reencode = TRUE)
attr(ess$cntry, "value.labels")
## Kosovo Ukraine Turkey Slovakia
## "XK " "UA " "TR " "SK "
## Slovenia Sweden Russian Federation Serbia
## "SI " "SE " "RU " "RS "
## Romania Portugal Poland Norway
## "RO " "PT " "PL " "NO "
## Netherlands North Macedonia Montenegro Latvia
## "NL " "MK " "ME " "LV "
## Luxembourg Lithuania Italy Iceland
## "LU " "LT " "IT " "IS "
## Israel Ireland Hungary Croatia
## "IL " "IE " "HU " "HR "
## Greece Georgia United Kingdom France
## "GR " "GE " "GB " "FR "
## Finland Spain Estonia Denmark
## "FI " "ES " "EE " "DK "
## Germany Czechia Cyprus Switzerland
## "DE " "CZ " "CY " "CH "
## Bulgaria Belgium Austria Albania
## "BG " "BE " "AT " "AL "
ess10 <- read.spss("/Users/krispinkruger/Krüger/Bachelorarbeit/Data/ESS10 2/ESS10.sav",
use.value.labels = F,
to.data.frame = T,
reencode = T)
CorruptionIndex <- read.spss("./GCB_Edition10_EU_2021.sav",
use.value.labels = F,
to.data.frame = T,
reencode = T)
nrow(CorruptionIndex)#40663 Befragte
## [1] 40663
ncol(CorruptionIndex)#75 Variablen
## [1] 75
# Überprüfen, ob Werte vorhanden sind
any_values <- any(!is.na(ess$trstprl[ess$cntry == "LU"]))
# Ausgabe des Ergebnisses
if (any_values) {
print("Werte vorhanden")
} else {
print("Keine Werte vorhanden")
}
## [1] "Keine Werte vorhanden"
#Variablen anzeigen
#View(ess)
#names(ess)
nrow(ess) #--> 49519 Befragte
## [1] 49519
ncol(ess) #--> 572 Variablen
## [1] 572
#Subset der relevanten Länder
# Definiere die gewünschten Ländercodes
countries <- c("BE", "BG", "DK", "DE", "EE", "FR", "IE", "IT", "HR", "LV", "LT", "NL", "AT", "PL", "PT", "SE", "SK", "SI", "ES", "CZ", "HU", "CY")
countries_post2004 <- c("HR", "BG", "CZ", "EE", "LT", "LV", "PL", "CY", "SI", "SK", "HU")
countries_pre2004 <- c("AT", "BE", "FR", "DE", "IE", "IT", "NL", "PT", "ES")
countries_scandi <- c("SE", "DK")
# Subset des Datensatzes "ess" basierend auf den Ländercodes
ess_subset <- subset(ess, cntry %in% countries)
ess_pre2004 <- subset(ess, cntry %in% countries_pre2004)
ess_post2004 <- subset(ess, cntry %in% countries_post2004)
ess_scandi <- subset(ess, cntry %in% countries_scandi)
#Malta, Griechenland und Rumänien fehlen im Datensatz
Daten von Transparency International werden eingelesen
Experteneinschätzung aufgrund von mehreren Makrovariablen (= es wird keine individuelle Wahrnehmung geschätzt)
Länder sind: Belgien, Bulgarien, Dänemark, Deutschland, Estland, Finnland, Frankreich, (Griechenland), Irland, Italien, Kroatien, Lettland, Litauen, Luxemburg, (Malta), Niederlande, Österreich, Polen, Portugal, (Rumänien), Schweden, Slowakei, Slowenien, Spanien, Tschechien, Ungarn, Zypern
Frage: Soll ich nur zu den EU27-Staaten die Beobachtung durchführen (sind ja nur vom EU-Parlament betroffen, oder auch Staaten, die Beitrittskandidaten sind und Freihandelsabkommen haben und damit indirekt betroffen sind?)
Für eine einfachere Interpretation der Ergebnisse wird die Skala von einer 100 auf eine 10 reduziert, damit die UV und AV die gleiche Skala haben
#Zuweisung der Werte zu den Ländern
ess_subset$corruption[ess_subset$cntry == "BE"] <- 7.5
ess_subset$corruption[ess_subset$cntry == "BG"] <- 4.3
ess_subset$corruption[ess_subset$cntry == "DK"] <- 8.7
ess_subset$corruption[ess_subset$cntry == "DE"] <- 8.0
ess_subset$corruption[ess_subset$cntry == "EE"] <- 7.4
ess_subset$corruption[ess_subset$cntry == "FI"] <- 8.6
ess_subset$corruption[ess_subset$cntry == "FR"] <- 6.9
ess_subset$corruption[ess_subset$cntry == "GR"] <- 4.8
ess_subset$corruption[ess_subset$cntry == "IE"] <- 7.4
ess_subset$corruption[ess_subset$cntry == "IT"] <- 5.3
ess_subset$corruption[ess_subset$cntry == "HR"] <- 4.7
ess_subset$corruption[ess_subset$cntry == "LV"] <- 5.6
ess_subset$corruption[ess_subset$cntry == "LT"] <- 6.0
ess_subset$corruption[ess_subset$cntry == "LU"] <- 8.0
ess_subset$corruption[ess_subset$cntry == "NL"] <- 8.2
ess_subset$corruption[ess_subset$cntry == "AT"] <- 7.7
ess_subset$corruption[ess_subset$cntry == "PL"] <- 5.8
ess_subset$corruption[ess_subset$cntry == "PT"] <- 6.2
ess_subset$corruption[ess_subset$cntry == "RO"] <- 4.4
ess_subset$corruption[ess_subset$cntry == "SE"] <- 8.5
ess_subset$corruption[ess_subset$cntry == "SK"] <- 5.0
ess_subset$corruption[ess_subset$cntry == "SI"] <- 6.0
ess_subset$corruption[ess_subset$cntry == "ES"] <- 6.2
ess_subset$corruption[ess_subset$cntry == "CZ"] <- 5.6
ess_subset$corruption[ess_subset$cntry == "HU"] <- 4.4
ess_subset$corruption[ess_subset$cntry == "CY"] <- 5.8
Desc(ess_subset$corruption)
## ------------------------------------------------------------------------------
## ess_subset$corruption (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 17 0 6.47 6.45
## 100.0% 0.0% 0.0% 6.48
##
## .05 .10 .25 median .75 .90 .95
## 4.30 4.40 5.60 6.20 7.70 8.20 8.50
##
## range sd vcoef mad IQR skew kurt
## 4.40 1.33 0.21 1.78 2.10 -0.00 -1.22
##
## lowest : 4.3 (2'198), 4.4 (1'661), 4.7 (1'810), 5.0 (1'083), 5.3 (2'745)
## highest: 7.7 (2'499), 8.0 (2'358), 8.2 (1'673), 8.5 (1'539), 8.7 (1'572)
##
## heap(?): remarkable frequency (10.7%) for the mode(s) (= 7.4)
##
## ' 95%-CI (classic)
#hohe und niedrige wahrgenomme Korruption alles was unter dem EU Average von 64 liegt hat eine hohe wahrgenommene Korurption, alles was darüber ist hat eine niedrige wahrgenommene Korruption
#hohe wahrgenommene Korruption
ess_subset$corruption_high[ess_subset$cntry == "BG"] <- 4.3
ess_subset$corruption_high[ess_subset$cntry == "GR"] <- 4.8
ess_subset$corruption_high[ess_subset$cntry == "IT"] <- 5.3
ess_subset$corruption_high[ess_subset$cntry == "HR"] <- 4.7
ess_subset$corruption_high[ess_subset$cntry == "LV"] <- 5.6
ess_subset$corruption_high[ess_subset$cntry == "LT"] <- 6.0
ess_subset$corruption_high[ess_subset$cntry == "PL"] <- 5.8
ess_subset$corruption_high[ess_subset$cntry == "PT"] <- 6.2
ess_subset$corruption_high[ess_subset$cntry == "RO"] <- 4.4
ess_subset$corruption_high[ess_subset$cntry == "SK"] <- 5.0
ess_subset$corruption_high[ess_subset$cntry == "SI"] <- 6.0
ess_subset$corruption_high[ess_subset$cntry == "ES"] <- 6.2
ess_subset$corruption_high[ess_subset$cntry == "CZ"] <- 5.6
ess_subset$corruption_high[ess_subset$cntry == "HU"] <- 4.4
ess_subset$corruption_high[ess_subset$cntry == "CY"] <- 5.8
#niedrige wahrgenommene Korruption
ess_subset$corruption_low[ess_subset$cntry == "BE"] <- 7.5
ess_subset$corruption_low[ess_subset$cntry == "DK"] <- 8.7
ess_subset$corruption_low[ess_subset$cntry == "DE"] <- 8.0
ess_subset$corruption_low[ess_subset$cntry == "EE"] <- 7.4
ess_subset$corruption_low[ess_subset$cntry == "FI"] <- 8.6
ess_subset$corruption_low[ess_subset$cntry == "FR"] <- 6.9
ess_subset$corruption_low[ess_subset$cntry == "IE"] <- 7.4
ess_subset$corruption_low[ess_subset$cntry == "LU"] <- 8.0
ess_subset$corruption_low[ess_subset$cntry == "NL"] <- 8.2
ess_subset$corruption_low[ess_subset$cntry == "AT"] <- 7.7
ess_subset$corruption_low[ess_subset$cntry == "SE"] <- 8.5
df <- data.frame(
col1 = c("BE", "BG", "DE", "EE", "FI", "FR", "IE", "IT", "HR", "LV", "LT", "NL", "AT", "PL", "PT", "SE", "SK", "SI", "ES", "CZ", "HU", "CY"),
col2 = c(75, 43, 80, 74, 86, 69, 74, 53, 47, 56, 60, 82, 77, 58, 62, 85, 50, 60, 62, 56, 44, 58))
names(df)[names(df) == "col1"] <- "geo"
names(df)[names(df) == "col2"] <- "means"
names(df)
## [1] "geo" "means"
tableHTML::tableHTML(df)
| geo | means | |
|---|---|---|
| 1 | BE | 75 |
| 2 | BG | 43 |
| 3 | DE | 80 |
| 4 | EE | 74 |
| 5 | FI | 86 |
| 6 | FR | 69 |
| 7 | IE | 74 |
| 8 | IT | 53 |
| 9 | HR | 47 |
| 10 | LV | 56 |
| 11 | LT | 60 |
| 12 | NL | 82 |
| 13 | AT | 77 |
| 14 | PL | 58 |
| 15 | PT | 62 |
| 16 | SE | 85 |
| 17 | SK | 50 |
| 18 | SI | 60 |
| 19 | ES | 62 |
| 20 | CZ | 56 |
| 21 | HU | 44 |
| 22 | CY | 58 |
#Grafik
# Get the world map
get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
## Simple feature collection with 37 features and 11 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -63.08825 ymin: -21.38917 xmax: 55.83616 ymax: 71.15304
## Geodetic CRS: WGS 84
## First 10 features:
## id LEVL_CODE NUTS_ID CNTR_CODE NAME_LATN NUTS_NAME MOUNT_TYPE
## 1 AL 0 AL AL SHQIPËRIA SHQIPËRIA 0
## 2 AT 0 AT AT ÖSTERREICH ÖSTERREICH 0
## 3 BE 0 BE BE BELGIQUE-BELGIË BELGIQUE-BELGIË 0
## 4 NL 0 NL NL NEDERLAND NEDERLAND 0
## 5 PL 0 PL PL POLSKA POLSKA 0
## 6 PT 0 PT PT PORTUGAL PORTUGAL 0
## 7 DK 0 DK DK DANMARK DANMARK 0
## 8 DE 0 DE DE DEUTSCHLAND DEUTSCHLAND 0
## 9 EL 0 EL EL ELLADA ΕΛΛΑΔΑ 0
## 10 ES 0 ES ES ESPAÑA ESPAÑA 0
## URBN_TYPE COAST_TYPE FID geometry geo
## 1 0 0 AL MULTIPOLYGON (((19.82698 42... AL
## 2 0 0 AT MULTIPOLYGON (((15.54245 48... AT
## 3 0 0 BE MULTIPOLYGON (((5.10218 51.... BE
## 4 0 0 NL MULTIPOLYGON (((6.87491 53.... NL
## 5 0 0 PL MULTIPOLYGON (((18.95003 54... PL
## 6 0 0 PT MULTIPOLYGON (((-8.16508 41... PT
## 7 0 0 DK MULTIPOLYGON (((14.8254 55.... DK
## 8 0 0 DE MULTIPOLYGON (((8.63593 54.... DE
## 9 0 0 EL MULTIPOLYGON (((29.60853 36... EL
## 10 0 0 ES MULTIPOLYGON (((4.28746 39.... ES
SHP_0 <- get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
SHP_0 %>%
ggplot() +
geom_sf()
#27 EU Länder auswählen
SHP_27 <- SHP_0 %>%
select(geo) %>%
inner_join(df, by = "geo") %>%
arrange(geo) %>%
st_as_sf()
SHP_27 %>%
ggplot() +
geom_sf() +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void()
df_shp <- df %>%
select(geo, means) %>%
inner_join(SHP_27, by = "geo") %>%
st_as_sf()
gg_theme <- list(
theme_void(),
scale_x_continuous(limits = c(-10, 35)),
scale_y_continuous(limits = c(36, 70)),
aes(fill = means.x),
geom_sf(size = 0.5,
color = "#F3F3F3"
),
scale_fill_gradient2_tableau(palette = "Red-Blue-White Diverging",
breaks = seq(from = 0, to = 100, by = 4)),
labs(subtitle = "Skala von 0-100 (Je höher desto besser)",
caption = "Data: Transparency International 2019"
)
)
gg_theme2 <- list(
theme_void(),
scale_x_continuous(limits = c(-10, 35)),
scale_y_continuous(limits = c(36, 70)),
aes(fill = means.x),
geom_sf(size = 0.5,
color = "#F3F3F3"
),
scale_fill_gradient2_tableau(palette = "Red-Blue-White Diverging",
breaks = seq(from = 0, to = 10, by = 0.3)),
labs(subtitle = "Skala von 0-10 (Je höher desto besser)",
caption = "Data: ESS9 (2019)"
)
)
gg_theme3 <- list(
theme_void(),
scale_x_continuous(limits = c(-10, 35)),
scale_y_continuous(limits = c(36, 70)),
aes(fill = means.x),
geom_sf(size = 0.5,
color = "#F3F3F3"
),
scale_fill_gradient2_tableau(palette = "Red-Blue-White Diverging",
breaks = seq(from = 0, to = 100000, by = 7500)),
labs(subtitle = "GNP per capita in $",
caption = "Data: WorlBank (2019)"
)
)
gg_theme4 <- list(
theme_void(),
scale_x_continuous(limits = c(-10, 35)),
scale_y_continuous(limits = c(36, 70)),
aes(fill = means.x),
geom_sf(size = 0.5, color = "#F3F3F3"),
scale_fill_gradient2_tableau(palette = "Red-Blue-White Diverging",
breaks = rev(seq(from = 0, to = 100, by = 1.5))),
labs(subtitle = "Gini-Index (je niedriger = rot desto besser)",
caption = "Data: WorlBank (2019)")
)
#Heatmap wahrgenomme Korruption
g1 <- df_shp %>%
ggplot() +
labs(title = "Wahrgenommene Korruption in Europa") +
gg_theme
g1
ggplotly()
ggsave(filename = "Heatmap_Korruption.png", plot = g1, width = 8, height = 7, dpi = 1000)
Es werden Daten des GCB genutzt (ebenfalls Transparency International)
Es wird auf einer Likertskala abgefragt, wie die individuelle Wahrnehmung zur Korruption ist, gegenüber verschiedenen repräsentativen und regulativen Institutionen
Da nicht selbe Individuen (= Index wird gebildet, und den Individuen des gesamten Datensatzes zugewiesen) ==> Keine Individualdaten mehr, aber Index wurde aufgrund von Individualdaten gebildet
Es werden die Daten des ESS9 genutzt
Skala von 0-10 (je höher desto besser)
repräsentative Institutionen: Landesparlament, - Politiker, Parteien, EU-Parlament –> trstprl, trstplt, trstprt, trstep
regulative Institutionen: Justiz, Polizei –> trstlgl, trstplc,
#Kontrolle der NA's
var <- c("trstprl", "trstplt", "trstprt", "trstep", "trstlgl", "trstplc")
ess_subset$missings <- rowSums(is.na(ess_subset[, var]))
table(ess_subset$missings) #kleinste gemeinsame Fallzahl ist 36767
##
## 0 1 2 3 4 5 6
## 35097 2243 506 243 163 105 151
sum(is.na(ess_subset[, var])) #6211 Missings
## [1] 6067
#Anteil an Missings
(6211/40263) * 100
## [1] 15.42607
Wir haben über die 6 Variablen insgesamt 6211 Missings, was 15,4% der Fälle entspricht, welche deshalb imputiert werden sollten mit dem Misc–Verfahren. Zunächst wird aber noch überprüft ob es einen inhaltlich sinnvollen Grund und Korrelation gibt der NA’s mit der abhängigen Variable. Falls dies zutrifft, kann es sich um eine systematische Verzerrung handeln.
ess.NA <- subset(ess_subset[,var])
#Funktion für Grafik
propmiss <- function(dataframe) {
m <- sapply(dataframe, function(x) {
data.frame(
nmiss=sum(is.na(x)),
n=length(x),
propmiss=sum(is.na(x))/length(x)
)
})
d <- data.frame(t(m))
d <- sapply(d, unlist)
d <- as.data.frame(d)
d$variable <- row.names(d)
row.names(d) <- NULL
d <- cbind(d[ncol(d)],d[-ncol(d)])
return(d[order(d$propmiss), ])
}
miss_vars<-propmiss(ess.NA)
miss_vars_mean<-mean(miss_vars$propmiss)
miss_vars_ges<- miss_vars %>% arrange(desc(propmiss))
plot <-ggplot(miss_vars_ges,aes(x=reorder(variable,propmiss),y=propmiss*100)) +
geom_point(size=3) +
coord_flip() +
theme_bw() + xlab("") +ylab("NAs pro Variable in %") +
theme(panel.grid.major.x=element_blank(),
panel.grid.minor.x=element_blank(),
panel.grid.major.y=element_line(colour="grey",linetype="dashed")) +
ggtitle("Prozent an NAs")
plot
ggsave(filename = "NA_proptable.png", plot = plot, width = 8, height = 7, dpi = 1000)
aggr(ess.NA, numbers=TRUE, prop=TRUE, combined=TRUE, sortVars=F, vscale = 1)
#Bartlett Test ob Korrelation (!=0) gibt
cortest.bartlett(ess.NA)
## $chisq
## [1] 157065
##
## $p.value
## [1] 0
##
## $df
## [1] 15
#Kaiser-Meyer-Olkin-Kriterium zur Beurteilung der Eignung der Daten zur Durchführung einer Faktoranalyse
kmo <- KMO(ess.NA)
kmo
## Kaiser-Meyer-Olkin factor adequacy
## Call: KMO(r = ess.NA)
## Overall MSA = 0.85
## MSA for each item =
## trstprl trstplt trstprt trstep trstlgl trstplc
## 0.91 0.80 0.80 0.96 0.85 0.85
#geordnete MSAi
kmo$MSAi[order(kmo$MSAi)]
## trstprt trstplt trstplc trstlgl trstprl trstep
## 0.7999033 0.8001309 0.8493127 0.8497133 0.9138089 0.9572451
Bei einem KMO von 0.84 sehen wir eine gute bis sehr hohe Eignung für die Faktoranalyse. Die Variablen weisen starke linerare Abhängigkeiten auf. Es müssen keine Items ausgeschlossen werden, da alle über 0.5 liegen, was bei einem Wert unter 0.5 empfohlen ist.
#Anzahl der Komponenten
library(mice)
imputed_data <- mice(ess.NA, m = 50, method = "pmm")
##
## iter imp variable
## 1 1 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 2 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 3 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 4 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 5 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 6 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 7 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 8 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 9 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 10 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 11 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 12 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 13 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 14 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 15 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 16 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 17 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 18 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 19 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 20 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 21 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 22 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 23 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 24 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 25 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 26 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 27 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 28 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 29 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 30 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 31 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 32 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 33 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 34 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 35 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 36 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 37 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 38 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 39 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 40 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 41 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 42 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 43 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 44 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 45 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 46 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 47 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 48 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 49 trstprl trstplt trstprt trstep trstlgl trstplc
## 1 50 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 1 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 2 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 3 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 4 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 5 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 6 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 7 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 8 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 9 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 10 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 11 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 12 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 13 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 14 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 15 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 16 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 17 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 18 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 19 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 20 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 21 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 22 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 23 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 24 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 25 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 26 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 27 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 28 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 29 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 30 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 31 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 32 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 33 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 34 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 35 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 36 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 37 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 38 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 39 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 40 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 41 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 42 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 43 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 44 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 45 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 46 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 47 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 48 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 49 trstprl trstplt trstprt trstep trstlgl trstplc
## 2 50 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 1 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 2 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 3 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 4 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 5 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 6 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 7 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 8 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 9 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 10 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 11 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 12 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 13 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 14 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 15 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 16 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 17 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 18 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 19 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 20 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 21 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 22 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 23 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 24 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 25 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 26 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 27 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 28 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 29 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 30 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 31 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 32 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 33 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 34 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 35 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 36 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 37 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 38 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 39 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 40 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 41 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 42 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 43 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 44 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 45 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 46 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 47 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 48 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 49 trstprl trstplt trstprt trstep trstlgl trstplc
## 3 50 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 1 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 2 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 3 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 4 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 5 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 6 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 7 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 8 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 9 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 10 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 11 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 12 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 13 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 14 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 15 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 16 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 17 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 18 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 19 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 20 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 21 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 22 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 23 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 24 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 25 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 26 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 27 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 28 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 29 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 30 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 31 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 32 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 33 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 34 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 35 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 36 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 37 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 38 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 39 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 40 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 41 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 42 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 43 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 44 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 45 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 46 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 47 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 48 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 49 trstprl trstplt trstprt trstep trstlgl trstplc
## 4 50 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 1 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 2 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 3 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 4 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 5 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 6 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 7 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 8 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 9 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 10 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 11 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 12 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 13 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 14 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 15 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 16 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 17 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 18 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 19 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 20 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 21 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 22 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 23 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 24 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 25 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 26 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 27 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 28 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 29 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 30 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 31 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 32 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 33 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 34 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 35 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 36 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 37 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 38 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 39 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 40 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 41 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 42 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 43 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 44 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 45 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 46 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 47 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 48 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 49 trstprl trstplt trstprt trstep trstlgl trstplc
## 5 50 trstprl trstplt trstprt trstep trstlgl trstplc
completed_data <- complete(imputed_data)
fa.parallel(completed_data, fa = "pc")
## Parallel analysis suggests that the number of factors = NA and the number of components = 1
# Installiere das psych-Paket, wenn es noch nicht installiert ist
# install.packages("psych")
# Lade das psych-Paket
library(psych)
# Durchführung der explorativen Faktoranalyse (EFA)
efa_result <- fa(completed_data, nfactors = 2, rotate = "varimax")
# Zeige die Ergebnisse der EFA an
print(efa_result)
## Factor Analysis using method = minres
## Call: fa(r = completed_data, nfactors = 2, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
## MR1 MR2 h2 u2 com
## trstprl 0.64 0.52 0.68 0.32 1.9
## trstplt 0.87 0.34 0.87 0.13 1.3
## trstprt 0.89 0.30 0.88 0.12 1.2
## trstep 0.54 0.39 0.44 0.56 1.8
## trstlgl 0.36 0.84 0.83 0.17 1.4
## trstplc 0.27 0.66 0.51 0.49 1.3
##
## MR1 MR2
## SS loadings 2.45 1.76
## Proportion Var 0.41 0.29
## Cumulative Var 0.41 0.70
## Proportion Explained 0.58 0.42
## Cumulative Proportion 0.58 1.00
##
## Mean item complexity = 1.5
## Test of the hypothesis that 2 factors are sufficient.
##
## df null model = 15 with the objective function = 4.04 with Chi Square = 155473
## df of the model are 4 and the objective function was 0.01
##
## The root mean square of the residuals (RMSR) is 0.01
## The df corrected root mean square of the residuals is 0.02
##
## The harmonic n.obs is 38508 with the empirical chi square 89.23 with prob < 1.9e-18
## The total n.obs was 38508 with Likelihood Chi Square = 522.15 with prob < 1.1e-111
##
## Tucker Lewis Index of factoring reliability = 0.988
## RMSEA index = 0.058 and the 90 % confidence intervals are 0.054 0.062
## BIC = 479.92
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy
## MR1 MR2
## Correlation of (regression) scores with factors 0.94 0.89
## Multiple R square of scores with factors 0.88 0.79
## Minimum correlation of possible factor scores 0.76 0.57
fa.diagram(efa_result, simple = T)
library(ggplot2)
# Daten für die Faktorladungen
faktorladungen <- data.frame(
Variable = c("trstprl", "trstplt", "trstprt","trstep", "trstlgl", "trstplc"),
Faktor1 = c(0.64, 0.86, 0.88, 0.55 , 0.35, 0.27),
Faktor2 = c(0.52, 0.35, 0.31, 0.38, 0.85, 0.66)
)
# Balkendiagramm für Faktorladungen erstellen
plot4 <- ggplot(faktorladungen, aes(x = Variable, y = Faktor1, fill = "Faktor 1")) +
geom_bar(stat = "identity", position = "dodge") +
geom_bar(aes(y = Faktor2, fill = "Faktor 2"), stat = "identity", position = "dodge") +
labs(x = "Variable", y = "Faktorladung") +
scale_fill_manual(values = c("Faktor 1" = "darkblue", "Faktor 2" = "brown")) +
theme_minimal()
plot4
ggsave(filename = "Faktorladungen.png", plot = plot4, width = 8, height = 7, dpi = 1000)
ess_subset$rep_institution <- rowSums(completed_data[, c("trstplt", "trstprt", "trstprl", "trstep")], na.rm = T) /4
Desc(ess_subset$rep_institution)
## ------------------------------------------------------------------------------
## ess_subset$rep_institution (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 41 1'836 3.97 3.94
## 100.0% 0.0% 4.8% 3.99
##
## .05 .10 .25 median .75 .90 .95
## 0.25 1.00 2.25 4.00 5.50 6.75 7.50
##
## range sd vcoef mad IQR skew kurt
## 10.00 2.18 0.55 2.22 3.25 0.00 -0.68
##
## lowest : 0.0 (1'836), 0.25 (545), 0.5 (668), 0.75 (751), 1.0 (926)
## highest: 9.0 (90), 9.25 (50), 9.5 (56), 9.75 (22), 10.0 (95)
##
## heap(?): remarkable frequency (5.6%) for the mode(s) (= 5)
##
## ' 95%-CI (classic)
ess_subset$reg_institution <- rowSums(completed_data[,c("trstlgl", "trstplc")], na.rm = T) /2
Desc(ess_subset$reg_institution)
## ------------------------------------------------------------------------------
## ess_subset$reg_institution (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 21 1'019 5.76 5.74
## 100.0% 0.0% 2.6% 5.78
##
## .05 .10 .25 median .75 .90 .95
## 1.00 2.50 4.00 6.00 7.50 8.50 9.00
##
## range sd vcoef mad IQR skew kurt
## 10.00 2.37 0.41 2.22 3.50 -0.48 -0.35
##
## lowest : 0.0 (1'019), 0.5 (257), 1.0 (710), 1.5 (638), 2.0 (883)
## highest: 8.0 (3'252), 8.5 (1'908), 9.0 (1'774), 9.5 (660), 10.0 (977)
##
## heap(?): remarkable frequency (9.0%) for the mode(s) (= 7)
##
## ' 95%-CI (classic)
ess_pre2004$rep_institution_pre_2004 <- rowMeans(ess_pre2004[, c("trstplt", "trstprt", "trstprl", "trstep")], na.rm = T)
#Grafik
plot2 <- ggplot(ess_subset, aes( rep_institution)) +
geom_bar(aes(y = ( ..count.. )/sum( ..count.. )),
fill = "darkblue", color = "lightblue")+
scale_y_continuous(labels = scales::percent) +
scale_x_continuous(breaks = seq(0,10),
labels = c("garkein Vertrauen",
"1", "2", "3", "4", "5", "6", "7", "8", "9",
"volles Vertrauen"))+
labs(title = "Vertrauen in repräsentative Instiutionen",
caption = "Data: ESS9 (2019)",
y = "Häufigkeit in Prozent",
x ="Vertauen in repräsentative Institutionen")+
theme_bw()
plot2
ggsave(filename = "Verteilung_rep.png", plot = plot2, width = 8, height = 7, dpi = 1000)
ks.test(ess_subset$rep_institution, "pnorm", mean = mean(ess_subset$rep_institution), sd = sd(ess_subset$rep_institution))
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: ess_subset$rep_institution
## D = 0.054948, p-value < 2.2e-16
## alternative hypothesis: two-sided
plot3 <- ggplot(ess_subset, aes( reg_institution))+
geom_bar(aes(y = ( ..count..)/sum( ..count..)),
fill = "darkblue", color = "lightblue")+
scale_y_continuous(labels = scales::percent)+
scale_x_continuous(breaks = seq(0,10),
labels = c("garkein Vertrauen",
"1", "2", "3", "4", "5", "6", "7", "8", "9",
"volles Vertrauen "))+
labs(title = "Vertrauen in regulative Instiutionen",
caption = "Data: ESS9 (2019)",
y = "Häufigkeit in Prozent",
x ="Vertauen in regulative Institutionen")+
theme_bw()
plot3
ggsave(filename = "Verteilung_reg.png", plot = plot3, width = 8, height = 7, dpi = 1000)
ks.test(ess_subset$reg_institution, "pnorm", mean = mean(ess_subset$reg_institution), sd = sd(ess_subset$reg_institution))
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: ess_subset$reg_institution
## D = 0.089273, p-value < 2.2e-16
## alternative hypothesis: two-sided
rel <- subset(ess_subset, select = c("cntry", "rep_institution", "reg_institution"))
unique(ess_subset$cntry)
## [1] "AT" "BE" "BG" "CY" "CZ" "DE" "DK" "EE" "ES" "FR" "HR" "HU" "IE" "IT" "LT"
## [16] "LV" "NL" "PL" "PT" "SE" "SI" "SK"
#repräsentative Institutionen
mean_df <- as.data.frame(base::tapply(rel$rep_institution, rel$cntry, FUN = mean, na.rm = T))
tableHTML::tableHTML(mean_df)
| base::tapply(rel$rep_institution, rel$cntry, FUN = mean, na.rm = T) | |
|---|---|
| AT | 4.54871948779512 |
| BE | 4.54541595925297 |
| BG | 2.55743858052775 |
| CY | 3.48751600512164 |
| CZ | 3.85362802335279 |
| DE | 4.40701865988126 |
| DK | 5.47598600508906 |
| EE | 4.28466386554622 |
| ES | 3.39733213429257 |
| FR | 3.67935323383084 |
| HR | 2.40662983425414 |
| HU | 4.32314870559904 |
| IE | 4.32569945848375 |
| IT | 3.64918032786885 |
| LT | 3.53841961852861 |
| LV | 3.27832244008715 |
| NL | 5.48132098027495 |
| PL | 3.67983333333333 |
| PT | 3.55118483412322 |
| SE | 5.29824561403509 |
| SI | 3.19802731411229 |
| SK | 3.78047091412742 |
mean_df_sorted <- as.data.frame(sort(base::tapply(rel$rep_institution, rel$cntry, FUN = mean, na.rm = T)))
tableHTML::tableHTML(mean_df_sorted)
| sort(base::tapply(rel$rep_institution, rel$cntry, FUN = mean, | |
|---|---|
| HR | 2.40662983425414 |
| BG | 2.55743858052775 |
| SI | 3.19802731411229 |
| LV | 3.27832244008715 |
| ES | 3.39733213429257 |
| CY | 3.48751600512164 |
| LT | 3.53841961852861 |
| PT | 3.55118483412322 |
| IT | 3.64918032786885 |
| FR | 3.67935323383084 |
| PL | 3.67983333333333 |
| SK | 3.78047091412742 |
| CZ | 3.85362802335279 |
| EE | 4.28466386554622 |
| HU | 4.32314870559904 |
| IE | 4.32569945848375 |
| DE | 4.40701865988126 |
| BE | 4.54541595925297 |
| AT | 4.54871948779512 |
| SE | 5.29824561403509 |
| DK | 5.47598600508906 |
| NL | 5.48132098027495 |
df1 <- data.frame(
col1 = c("HR", "BG", "SI", "LV", "ES", "CY","LT", "PT", "IT", "FR", "PL", "SK", "CZ", "EE", "IE", "HU", "DE", "BE", "AT", "SE", "FI", "DK", "NL"),
col2 = c(2.40704, 2.57393,3.19954,3.28268,3.38519,3.51184,3.53188,3.53412,3.66202,3.67662,3.68767,3.76847,3.84967,4.28453,4.31634,4.32661,4.40575,4.54966,4.56132,5.29191,5.29957,5.46406,5.48984))
names(df1)[names(df1) == "col1"] <- "geo"
names(df1)[names(df1) == "col2"] <- "means"
names(df1)
## [1] "geo" "means"
tableHTML::tableHTML(df1)
| geo | means | |
|---|---|---|
| 1 | HR | 2.40704 |
| 2 | BG | 2.57393 |
| 3 | SI | 3.19954 |
| 4 | LV | 3.28268 |
| 5 | ES | 3.38519 |
| 6 | CY | 3.51184 |
| 7 | LT | 3.53188 |
| 8 | PT | 3.53412 |
| 9 | IT | 3.66202 |
| 10 | FR | 3.67662 |
| 11 | PL | 3.68767 |
| 12 | SK | 3.76847 |
| 13 | CZ | 3.84967 |
| 14 | EE | 4.28453 |
| 15 | IE | 4.31634 |
| 16 | HU | 4.32661 |
| 17 | DE | 4.40575 |
| 18 | BE | 4.54966 |
| 19 | AT | 4.56132 |
| 20 | SE | 5.29191 |
| 21 | FI | 5.29957 |
| 22 | DK | 5.46406 |
| 23 | NL | 5.48984 |
#Heatmap
get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
## Simple feature collection with 37 features and 11 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -63.08825 ymin: -21.38917 xmax: 55.83616 ymax: 71.15304
## Geodetic CRS: WGS 84
## First 10 features:
## id LEVL_CODE NUTS_ID CNTR_CODE NAME_LATN NUTS_NAME MOUNT_TYPE
## 1 AL 0 AL AL SHQIPËRIA SHQIPËRIA 0
## 2 AT 0 AT AT ÖSTERREICH ÖSTERREICH 0
## 3 BE 0 BE BE BELGIQUE-BELGIË BELGIQUE-BELGIË 0
## 4 NL 0 NL NL NEDERLAND NEDERLAND 0
## 5 PL 0 PL PL POLSKA POLSKA 0
## 6 PT 0 PT PT PORTUGAL PORTUGAL 0
## 7 DK 0 DK DK DANMARK DANMARK 0
## 8 DE 0 DE DE DEUTSCHLAND DEUTSCHLAND 0
## 9 EL 0 EL EL ELLADA ΕΛΛΑΔΑ 0
## 10 ES 0 ES ES ESPAÑA ESPAÑA 0
## URBN_TYPE COAST_TYPE FID geometry geo
## 1 0 0 AL MULTIPOLYGON (((19.82698 42... AL
## 2 0 0 AT MULTIPOLYGON (((15.54245 48... AT
## 3 0 0 BE MULTIPOLYGON (((5.10218 51.... BE
## 4 0 0 NL MULTIPOLYGON (((6.87491 53.... NL
## 5 0 0 PL MULTIPOLYGON (((18.95003 54... PL
## 6 0 0 PT MULTIPOLYGON (((-8.16508 41... PT
## 7 0 0 DK MULTIPOLYGON (((14.8254 55.... DK
## 8 0 0 DE MULTIPOLYGON (((8.63593 54.... DE
## 9 0 0 EL MULTIPOLYGON (((29.60853 36... EL
## 10 0 0 ES MULTIPOLYGON (((4.28746 39.... ES
SHP_1 <- get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
SHP_27_1 <- SHP_1 %>%
select(geo) %>%
inner_join(df1, by = "geo") %>%
arrange(geo) %>%
st_as_sf()
SHP_27_1 %>%
ggplot() +
geom_sf() +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void()
df_shp_1 <- df1 %>%
select(geo, means) %>%
inner_join(SHP_27_1, by = "geo") %>%
st_as_sf()
g2 <- df_shp_1 %>%
ggplot() +
labs(title = "Durchschnittliches Vertrauen in repräsentative Institutionen") +
gg_theme2
g2
ggsave(filename = "Heatmap_PV_rep.png", plot = g2, width = 8, height = 7, dpi = 1000)
#regulative Institutionen
mean_df <- as.data.frame(base::tapply(rel$reg_institution, rel$cntry, FUN = mean, na.rm = T))
tableHTML::tableHTML(mean_df)
| base::tapply(rel$reg_institution, rel$cntry, FUN = mean, na.rm = T) | |
|---|---|
| AT | 7.02801120448179 |
| BE | 5.94255800792303 |
| BG | 3.46223839854413 |
| CY | 4.88156209987196 |
| CZ | 5.5325271059216 |
| DE | 6.61217133163698 |
| DK | 7.83142493638677 |
| EE | 6.46691176470588 |
| ES | 5.76858513189449 |
| FR | 5.86517412935323 |
| HR | 3.88093922651934 |
| HU | 5.95484647802529 |
| IE | 5.77030685920578 |
| IT | 6.00765027322404 |
| LT | 5.47792915531335 |
| LV | 4.96514161220044 |
| NL | 6.82635983263598 |
| PL | 5.04933333333333 |
| PT | 5.2218009478673 |
| SE | 6.75373619233268 |
| SI | 5.05121396054628 |
| SK | 4.68836565096953 |
mean_df_sorted <- as.data.frame(sort(base::tapply(rel$reg_institution, rel$cntry, FUN = mean, na.rm = T)))
tableHTML::tableHTML(mean_df_sorted)
| sort(base::tapply(rel$reg_institution, rel$cntry, FUN = mean, | |
|---|---|
| BG | 3.46223839854413 |
| HR | 3.88093922651934 |
| SK | 4.68836565096953 |
| CY | 4.88156209987196 |
| LV | 4.96514161220044 |
| PL | 5.04933333333333 |
| SI | 5.05121396054628 |
| PT | 5.2218009478673 |
| LT | 5.47792915531335 |
| CZ | 5.5325271059216 |
| ES | 5.76858513189449 |
| IE | 5.77030685920578 |
| FR | 5.86517412935323 |
| BE | 5.94255800792303 |
| HU | 5.95484647802529 |
| IT | 6.00765027322404 |
| EE | 6.46691176470588 |
| DE | 6.61217133163698 |
| SE | 6.75373619233268 |
| NL | 6.82635983263598 |
| AT | 7.02801120448179 |
| DK | 7.83142493638677 |
df2 <- data.frame(
col1 = c("BG", "HR", "SK", "CY", "LV", "PL", "SI", "PT", "LT", "CZ", "IE", "ES", "FR", "BE", "HU", "IT", "EE", "DE", "SE", "NL", "AT", "FI", "DK"),
col2 = c(3.46656, 3.8837,4.68375,4.88092,4.97004,5.03733,5.04628,5.21611,5.48719,5.52585,5.77347,5.77698,5.86294,5.94709,5.95846,6.00291,6.47164,6.60984,6.74789,6.82068,7.02821,7.63789,7.83906))
names(df2)[names(df2) == "col1"] <- "geo"
names(df2)[names(df2) == "col2"] <- "means"
names(df2)
## [1] "geo" "means"
tableHTML::tableHTML(df2)
| geo | means | |
|---|---|---|
| 1 | BG | 3.46656 |
| 2 | HR | 3.8837 |
| 3 | SK | 4.68375 |
| 4 | CY | 4.88092 |
| 5 | LV | 4.97004 |
| 6 | PL | 5.03733 |
| 7 | SI | 5.04628 |
| 8 | PT | 5.21611 |
| 9 | LT | 5.48719 |
| 10 | CZ | 5.52585 |
| 11 | IE | 5.77347 |
| 12 | ES | 5.77698 |
| 13 | FR | 5.86294 |
| 14 | BE | 5.94709 |
| 15 | HU | 5.95846 |
| 16 | IT | 6.00291 |
| 17 | EE | 6.47164 |
| 18 | DE | 6.60984 |
| 19 | SE | 6.74789 |
| 20 | NL | 6.82068 |
| 21 | AT | 7.02821 |
| 22 | FI | 7.63789 |
| 23 | DK | 7.83906 |
#Heaptmap
#Heatmap
get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
## Simple feature collection with 37 features and 11 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -63.08825 ymin: -21.38917 xmax: 55.83616 ymax: 71.15304
## Geodetic CRS: WGS 84
## First 10 features:
## id LEVL_CODE NUTS_ID CNTR_CODE NAME_LATN NUTS_NAME MOUNT_TYPE
## 1 AL 0 AL AL SHQIPËRIA SHQIPËRIA 0
## 2 AT 0 AT AT ÖSTERREICH ÖSTERREICH 0
## 3 BE 0 BE BE BELGIQUE-BELGIË BELGIQUE-BELGIË 0
## 4 NL 0 NL NL NEDERLAND NEDERLAND 0
## 5 PL 0 PL PL POLSKA POLSKA 0
## 6 PT 0 PT PT PORTUGAL PORTUGAL 0
## 7 DK 0 DK DK DANMARK DANMARK 0
## 8 DE 0 DE DE DEUTSCHLAND DEUTSCHLAND 0
## 9 EL 0 EL EL ELLADA ΕΛΛΑΔΑ 0
## 10 ES 0 ES ES ESPAÑA ESPAÑA 0
## URBN_TYPE COAST_TYPE FID geometry geo
## 1 0 0 AL MULTIPOLYGON (((19.82698 42... AL
## 2 0 0 AT MULTIPOLYGON (((15.54245 48... AT
## 3 0 0 BE MULTIPOLYGON (((5.10218 51.... BE
## 4 0 0 NL MULTIPOLYGON (((6.87491 53.... NL
## 5 0 0 PL MULTIPOLYGON (((18.95003 54... PL
## 6 0 0 PT MULTIPOLYGON (((-8.16508 41... PT
## 7 0 0 DK MULTIPOLYGON (((14.8254 55.... DK
## 8 0 0 DE MULTIPOLYGON (((8.63593 54.... DE
## 9 0 0 EL MULTIPOLYGON (((29.60853 36... EL
## 10 0 0 ES MULTIPOLYGON (((4.28746 39.... ES
SHP_2 <- get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
SHP_27_2 <- SHP_2 %>%
select(geo) %>%
inner_join(df2, by = "geo") %>%
arrange(geo) %>%
st_as_sf()
SHP_27_2 %>%
ggplot() +
geom_sf() +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void()
df_shp_2 <- df2 %>%
select(geo, means) %>%
inner_join(SHP_27_2, by = "geo") %>%
st_as_sf()
g3 <- df_shp_2 %>%
ggplot() +
labs(title = "Durchschnittliches Vertrauen in regulative Institutionen") +
gg_theme2
g3
ggsave(filename = "Heatmap_PV_reg.png", plot = g3, width = 8, height = 7, dpi = 1000)
sumtable(ess_subset, vars = c('rep_institution', 'reg_institution', 'corruption')
,summ = list(
c('notNA(x)', 'mean(x)', 'median(x)', 'sd(x)', 'min(x)', 'max(x)', 'pctile(x)[25]', 'pctile(x)[75]')
),
summ.names = list(
c('N', 'Mean', 'Median', 'Standard Error', 'Minimum', 'Maximum', '1 Quantil', '4 Quantil')
)
,title = "Deskriptive Statistik der UV und AV"
,labels = c("rep. Institutionen", "reg. Institutionen", "wahrgenomme Korruption"), file = 'Deskriptive Statistik AV u. UV')
| Variable | N | Mean | Median | Standard Error | Minimum | Maximum | 1 Quantil | 4 Quantil |
|---|---|---|---|---|---|---|---|---|
| rep. Institutionen | 38508 | 4 | 4 | 2.2 | 0 | 10 | 2.2 | 5.5 |
| reg. Institutionen | 38508 | 5.8 | 6 | 2.4 | 0 | 10 | 4 | 7.5 |
| wahrgenomme Korruption | 38508 | 6.5 | 6.2 | 1.3 | 4.3 | 8.7 | 5.6 | 7.7 |
Skala von 1-4 (hoch ist schlecht)
attributes(ess_subset$polintr)
## NULL
ess_subset$polInteresse <- car::recode(ess_subset$polintr,
"1:2 = 1;
3:4 = 2;
else = NA")
#Kein Interese ist Referenz
polInteresse <- as.factor(ess_subset$polInteresse)
ess_subset$PolInteresse_dummy <- relevel(polInteresse, ref = 2)
1 = Male, 2 = Female
wird rekodiert zum Dummy, wobei 1 = Male die Referenz ist
attributes(ess$gndr)
## $value.labels
## Female Male
## "2" "1"
ess_subset$geschlecht <- car::recode(ess_subset$gndr,
"1 = 0;
2 = 1;
else = NA")
Desc(ess_subset$geschlecht)
## ------------------------------------------------------------------------------
## ess_subset$geschlecht (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 2 17'608 0.54 0.54
## 100.0% 0.0% 45.7% 0.55
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 0.00 1.00 1.00 1.00 1.00
##
## range sd vcoef mad IQR skew kurt
## 1.00 0.50 0.92 0.00 1.00 -0.17 -1.97
##
##
## value freq perc cumfreq cumperc
## 1 0 17'608 45.7% 17'608 45.7%
## 2 1 20'900 54.3% 38'508 100.0%
##
## ' 95%-CI (classic)
Desc(ess_subset$agea)
## ------------------------------------------------------------------------------
## ess_subset$agea (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'354 154 76 0 51.25 51.06
## 99.6% 0.4% 0.0% 51.44
##
## .05 .10 .25 median .75 .90 .95
## 20.00 25.00 36.00 52.00 66.00 76.00 80.00
##
## range sd vcoef mad IQR skew kurt
## 75.00 18.68 0.36 22.24 30.00 -0.07 -0.94
##
## lowest : 15.0 (183), 16.0 (346), 17.0 (357), 18.0 (391), 19.0 (463)
## highest: 86.0 (188), 87.0 (125), 88.0 (100), 89.0 (92), 90.0 (205)
##
## ' 95%-CI (classic)
center_scale <- function(x) {
scale(x, scale = F)
}
ess_subset$Alter_zentriert <- center_scale(ess_subset$agea)
table(ess_subset$Alter_zentriert)
##
## -36.2488397559577 -35.2488397559577 -34.2488397559577 -33.2488397559577
## 183 346 357 391
## -32.2488397559577 -31.2488397559577 -30.2488397559577 -29.2488397559577
## 463 392 403 418
## -28.2488397559577 -27.2488397559577 -26.2488397559577 -25.2488397559577
## 428 433 364 452
## -24.2488397559577 -23.2488397559577 -22.2488397559577 -21.2488397559577
## 468 468 488 493
## -20.2488397559577 -19.2488397559577 -18.2488397559577 -17.2488397559577
## 509 482 496 513
## -16.2488397559577 -15.2488397559577 -14.2488397559577 -13.2488397559577
## 520 528 571 520
## -12.2488397559577 -11.2488397559577 -10.2488397559577 -9.24883975595765
## 642 611 581 589
## -8.24883975595765 -7.24883975595765 -6.24883975595765 -5.24883975595765
## 595 587 599 623
## -4.24883975595765 -3.24883975595765 -2.24883975595765 -1.24883975595765
## 566 667 677 682
## -0.248839755957654 0.751160244042346 1.75116024404235 2.75116024404235
## 604 701 696 692
## 3.75116024404235 4.75116024404235 5.75116024404235 6.75116024404235
## 712 657 675 692
## 7.75116024404235 8.75116024404235 9.75116024404235 10.7511602440423
## 705 672 675 688
## 11.7511602440423 12.7511602440423 13.7511602440423 14.7511602440423
## 730 663 640 701
## 15.7511602440423 16.7511602440423 17.7511602440423 18.7511602440423
## 685 679 696 643
## 19.7511602440423 20.7511602440423 21.7511602440423 22.7511602440423
## 629 591 535 478
## 23.7511602440423 24.7511602440423 25.7511602440423 26.7511602440423
## 434 415 436 431
## 27.7511602440423 28.7511602440423 29.7511602440423 30.7511602440423
## 446 376 275 275
## 31.7511602440423 32.7511602440423 33.7511602440423 34.7511602440423
## 235 216 161 188
## 35.7511602440423 36.7511602440423 37.7511602440423 38.7511602440423
## 125 100 92 205
–> harmonisierte Bildungsvariable zwischen den Staaten, um den unterschiedlichen Abschlüssen gerecht zu werden
attributes(ess$eisced)
## $value.labels
## Other
## "55"
## ES-ISCED V2, higher tertiary education, >= MA level
## "7"
## ES-ISCED V1, lower tertiary education, BA level
## "6"
## ES-ISCED IV, advanced vocational, sub-degree
## "5"
## ES-ISCED IIIa, upper tier upper secondary
## "4"
## ES-ISCED IIIb, lower tier upper secondary
## "3"
## ES-ISCED II, lower secondary
## "2"
## ES-ISCED I , less than lower secondary
## "1"
## Not possible to harmonise into ES-ISCED
## "0"
Desc(ess_subset$eisced)
## ------------------------------------------------------------------------------
## ess_subset$eisced (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'425 83 8 0 4.08 4.05
## 99.8% 0.2% 0.0% 4.11
##
## .05 .10 .25 median .75 .90 .95
## 1.00 2.00 2.00 4.00 5.00 7.00 7.00
##
## range sd vcoef mad IQR skew kurt
## 54.00 3.04 0.75 1.48 3.00 10.84 178.63
##
##
## value freq perc cumfreq cumperc
## 1 1 2'936 7.6% 2'936 7.6%
## 2 2 6'767 17.6% 9'703 25.3%
## 3 3 6'452 16.8% 16'155 42.0%
## 4 4 8'743 22.8% 24'898 64.8%
## 5 5 4'532 11.8% 29'430 76.6%
## 6 6 3'970 10.3% 33'400 86.9%
## 7 7 4'936 12.8% 38'336 99.8%
## 8 55 89 0.2% 38'425 100.0%
##
## ' 95%-CI (classic)
table(ess_subset$eisced)
##
## 1 2 3 4 5 6 7 55
## 2936 6767 6452 8743 4532 3970 4936 89
ess_subset$bildung <- car::recode(ess_subset$eisced,
"1:2 = 1;
3:4 = 2;
5:7 = 3;
else = NA")
Bild <- as.factor(ess_subset$bildung)
table(Bild)
## Bild
## 1 2 3
## 9703 15195 13438
ess_subset$Bildung <- relevel(Bild, ref = 1)
Desc(ess_subset$Bildung)
## ------------------------------------------------------------------------------
## ess_subset$Bildung (factor)
##
## length n NAs unique levels dupes
## 38'508 38'336 172 3 3 y
## 99.6% 0.4%
##
## level freq perc cumfreq cumperc
## 1 2 15'195 39.6% 15'195 39.6%
## 2 3 13'438 35.1% 28'633 74.7%
## 3 1 9'703 25.3% 38'336 100.0%
Einkommen (hincfel) -> Wie wird das Einkommen wahrgenommen, kommt man in der heutigen Welt damit zurecht?
Skala von 1-4 (je höher desto schlechter)
1 = Living Comfortably, “2 = Coping on Income, 3 = Difficult on Income, 4 = Very Difficult on Income
Wenn Menschen komfortabel Leben ist es Referenz, da sie sich dann wsl nicht so sehr beeinflussen lassen von Korruption und dem Vertrauen (sie haben ja die Mittel, um sich Gehör zu verschaffen)
attributes(ess_subset$hincfel)
## NULL
ess_subset$Einkommen <- car::recode(ess_subset$hincfel,
"1:2 = 0;
3:4 = 1; else = NA")
Desc(ess_subset$Einkommen)
## ------------------------------------------------------------------------------
## ess_subset$Einkommen (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 37'918 590 2 28'833 0.24 0.24
## 98.5% 1.5% 74.9% 0.24
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 0.00 0.00 0.00 1.00 1.00
##
## range sd vcoef mad IQR skew kurt
## 1.00 0.43 1.78 0.00 0.00 1.22 -0.51
##
##
## value freq perc cumfreq cumperc
## 1 0 28'833 76.0% 28'833 76.0%
## 2 1 9'085 24.0% 37'918 100.0%
##
## ' 95%-CI (classic)
ess_subset$Einfluss_Regierung <- car::recode(ess_subset$psppsgva,"
1 = 0;
2 = 1;
3 = 2;
4 = 3;
5 = 4;
else = NA")
ess_subset$Einfluss_Politik <- car::recode(ess_subset$psppipla,"
1 = 0;
2 = 1;
3 = 2;
4 = 3;
5 = 4;
else = NA")
Teilhabe <- c("Einfluss_Regierung", "Einfluss_Politik")
ess_subset$polTeilhabe <- rowSums(ess_subset[, Teilhabe], na.rm = T) /2
Desc(ess_subset$polTeilhabe)
## ------------------------------------------------------------------------------
## ess_subset$polTeilhabe (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 9 8'103 1.12 1.11
## 100.0% 0.0% 21.0% 1.13
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 0.50 1.00 2.00 2.00 2.50
##
## range sd vcoef mad IQR skew kurt
## 4.00 0.85 0.76 0.74 1.50 0.46 -0.31
##
##
## value freq perc cumfreq cumperc
## 1 0 8'103 21.0% 8'103 21.0%
## 2 0.5 5'174 13.4% 13'277 34.5%
## 3 1 9'827 25.5% 23'104 60.0%
## 4 1.5 5'621 14.6% 28'725 74.6%
## 5 2 6'446 16.7% 35'171 91.3%
## 6 2.5 1'820 4.7% 36'991 96.1%
## 7 3 1'134 2.9% 38'125 99.0%
## 8 3.5 261 0.7% 38'386 99.7%
## 9 4 122 0.3% 38'508 100.0%
##
## ' 95%-CI (classic)
ks.test(ess_subset$polTeilhabe, "pnorm", mean=mean(ess_subset$polTeilhabe), sd=sd(ess_subset$polTeilhabe))
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: ess_subset$polTeilhabe
## D = 0.15542, p-value < 2.2e-16
## alternative hypothesis: two-sided
Einschätzung der eigenen Fähigkeit zur politischen Teilhabe (cptppola)
ess_subset$Fähigkeit_Teilhabe <- car::recode(ess_subset$cptppola,"
1 = 0;
2 = 1;
3 = 2;
4 = 3;
5 = 4;
else = NA")
Desc(ess_subset$Fähigkeit_Teilhabe)
## ------------------------------------------------------------------------------
## ess_subset$Fähigkeit_Teilhabe (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 37'224 1'284 5 13'703 1.07 1.06
## 96.7% 3.3% 35.6% 1.08
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 0.00 1.00 2.00 2.00 3.00
##
## range sd vcoef mad IQR skew kurt
## 4.00 1.06 0.99 1.48 2.00 0.82 0.07
##
##
## value freq perc cumfreq cumperc
## 1 0 13'703 36.8% 13'703 36.8%
## 2 1 12'054 32.4% 25'757 69.2%
## 3 2 7'840 21.1% 33'597 90.3%
## 4 3 2'496 6.7% 36'093 97.0%
## 5 4 1'131 3.0% 37'224 100.0%
##
## ' 95%-CI (classic)
–> Stärke der Religiösität, unabhängig von der Religion, welche verfolgt wird
Desc(ess_subset$rlgdgr)
## ------------------------------------------------------------------------------
## ess_subset$rlgdgr (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'072 436 11 6'909 4.53 4.50
## 98.9% 1.1% 17.9% 4.56
##
## .05 .10 .25 median .75 .90 .95
## 0.00 0.00 2.00 5.00 7.00 9.00 10.00
##
## range sd vcoef mad IQR skew kurt
## 10.00 3.15 0.69 4.45 5.00 -0.02 -1.14
##
##
## value freq perc cumfreq cumperc
## 1 0 6'909 18.1% 6'909 18.1%
## 2 1 2'211 5.8% 9'120 24.0%
## 3 2 2'667 7.0% 11'787 31.0%
## 4 3 2'807 7.4% 14'594 38.3%
## 5 4 2'281 6.0% 16'875 44.3%
## 6 5 5'748 15.1% 22'623 59.4%
## 7 6 3'633 9.5% 26'256 69.0%
## 8 7 4'152 10.9% 30'408 79.9%
## 9 8 3'699 9.7% 34'107 89.6%
## 10 9 1'426 3.7% 35'533 93.3%
## 11 10 2'539 6.7% 38'072 100.0%
##
## ' 95%-CI (classic)
ess_subset$religiösität <- ess_subset$rlgdgr
1 = Katholisch, 2 = Protestant, 3 = Eastern Orthodox, 4 = andere Form von Christentum, 5 = Judaismus, 6 = Islam, 7 = Eastern Religion, 8 = Andere nicht christliche Religionen
Als Referenz werden die anderen nicht christlichen Religionen gesetzt
Da die Religionszugehörigkeit ein Dummy ist, will ich nur Personen drinne haben, die eine hohe Religiosität haben, da die reine Zugehörigkeit keinen Effekt hat, sondern man auch die Werte der Religion vertreten muss, um einen Effekt zu erzielen. Da die Skala der Religiösität von 0-10 geht, werden also nur Personen mit einen wert über 5 gewählt also religiös gewählt.
Durch die Einschränkung der Personen nur auf starke Religiösität wird natürlich die Fallzahl enorm eingeschränkt, da alle Personen die nicht religiös sind ausgeschlossen werden
attributes(ess$rlgdnm)
## $value.labels
## Other Non-Christian religions Eastern religions
## "8" "7"
## Islam Jewish
## "6" "5"
## Other Christian denomination Eastern Orthodox
## "4" "3"
## Protestant Roman Catholic
## "2" "1"
ess_subset$religion <- ifelse(ess_subset$rlgdgr > 5, ess_subset$rlgdnm, NA)
table(ess_subset$religion)
##
## 1 2 3 4 5 6 7 8
## 9196 1538 1363 382 17 689 80 76
table(ess_subset$rlgdnm)
##
## 1 2 3 4 5 6 7 8
## 15174 3045 2804 509 36 1008 117 109
ess_subset$religzu <- car::recode(ess_subset$rlgdnm, "
1 = 1;
2 = 2;
3 = 3;
4 = 4;
5 = 5;
6 = 6;
7:8 = 7;
else = NA")
rlz <- as.factor(ess_subset$religzu)
ess_subset$religionszugehörigkeit <- relevel(rlz, ref = 7 )
table(ess_subset$religionszugehörigkeit)
##
## 7 1 2 3 4 5 6
## 226 15174 3045 2804 509 36 1008
Desc(ess_subset$religionszugehörigkeit)
## ------------------------------------------------------------------------------
## ess_subset$religionszugehörigkeit (factor)
##
## length n NAs unique levels dupes
## 38'508 22'802 15'706 7 7 y
## 59.2% 40.8%
##
## level freq perc cumfreq cumperc
## 1 1 15'174 66.5% 15'174 66.5%
## 2 2 3'045 13.4% 18'219 79.9%
## 3 3 2'804 12.3% 21'023 92.2%
## 4 6 1'008 4.4% 22'031 96.6%
## 5 4 509 2.2% 22'540 98.9%
## 6 7 226 1.0% 22'766 99.8%
## 7 5 36 0.2% 22'802 100.0%
sumtable(ess_subset, vars = c('polInteresse' ,'polTeilhabe', 'Einkommen', 'bildung', 'agea', 'geschlecht', 'religzu', 'GNP', 'Gini', 'Her')
,summ = list(
c('notNA(x)', 'mean(x)', 'median(x)', 'sd(x)', 'min(x)', 'max(x)', 'pctile(x)[25]', 'pctile(x)[75]')
),
summ.names = list(
c('N', 'Mean', 'Median', 'Standard Error', 'Minimum', 'Maximum', '1 Quantil', '4 Quantil')
)
,title = "Deskriptive Statistik der individuellen Kontrollvariablen"
,labels = c("pol. Interesse", "pol. Teilhabe (System)", "Fähigkeit mit Einkommen leben zu bestreiten", "Bildung (harmonisiert)", "Alter", "Geschlecht", "Religion","Bruttosozialprodukt", "Gini-Koeffizient", "Region der Herkunft"), file = 'Deskriptive Statistik Individual')
| Variable | N | Mean | Median | Standard Error | Minimum | Maximum | 1 Quantil | 4 Quantil |
|---|---|---|---|---|---|---|---|---|
| pol. Interesse | 38432 | 1.6 | 2 | 0.49 | 1 | 2 | 1 | 2 |
| pol. Teilhabe (System) | 38508 | 1.1 | 1 | 0.85 | 0 | 4 | 0.5 | 2 |
| Fähigkeit mit Einkommen leben zu bestreiten | 37918 | 0.24 | 0 | 0.43 | 0 | 1 | 0 | 0 |
| Bildung (harmonisiert) | 38336 | 2.1 | 2 | 0.77 | 1 | 3 | 1 | 3 |
| Alter | 38354 | 51 | 52 | 19 | 15 | 90 | 36 | 66 |
| Geschlecht | 38508 | 0.54 | 1 | 0.5 | 0 | 1 | 0 | 1 |
| Religion | 22802 | 1.7 | 1 | 1.3 | 1 | 7 | 1 | 2 |
| Bruttosozialprodukt | ||||||||
| Gini-Koeffizient | ||||||||
| Region der Herkunft |
Gruppierung der Herkunftsländer, um zu prüfen, ob es ein Unterschied gibt, zwischen europäischen Regionen (inspiriert, nach Unterscheidung von Kołczyńska 2019: S.799)
Die Gruppierung basiert auf dem Status Quo des Landes (= Ist es Demokratie oder nicht) und der Dauer seit der das Land eine Demokratie ist und in die EU integriert ist.
Länder mit EU-Beitritt 2004 oder später (= große Osterweiterung und das Baltikum)
Länder mit EU-Beitritt vor 2004 (= Gründungsmitglieder und direkte Nachfolge)
Skandinavische Mitgliedsländer
#Erstellung der Ländervariabeln
post_2004 <- c("HR", "BG", "CZ", "EE", "LT", "LV", "PL", "CY", "SI", "SK", "HU")
pre_2004 <- c("AT", "BE", "FR", "DE", "IE", "IT", "NL", "PT", "ES")
scandi <- c("SE", "DK")
ess_subset$Her[ess_subset$cntry %in% post_2004] <- 1
ess_subset$Her[ess_subset$cntry %in% pre_2004] <- 2
ess_subset$Her[ess_subset$cntry %in% scandi] <- 3
Herkunft <- as.factor(ess_subset$Her)
ess_subset$Herkunft <- relevel(Herkunft, ref = 3)
Desc(ess_subset$Herkunft)
## ------------------------------------------------------------------------------
## ess_subset$Herkunft (factor)
##
## length n NAs unique levels dupes
## 38'508 38'508 0 3 3 y
## 100.0% 0.0%
##
## level freq perc cumfreq cumperc
## 1 2 17'991 46.7% 17'991 46.7%
## 2 1 17'406 45.2% 35'397 91.9%
## 3 3 3'111 8.1% 38'508 100.0%
( in $) als Indikator des Entwicklungsstands und der Lebenssituation der Bevölkerung
Daten sind von der WorldBank von 2019
Macht es Sinn sich überhaupt noch das BIP anzuschauen? Beschreibt das nicht einen ähnlichen Zusammenhang?
ess_subset$GNP[ess_subset$cntry == "BE"] <- 48100
ess_subset$GNP[ess_subset$cntry == "BG"] <- 9500
ess_subset$GNP[ess_subset$cntry == "DK"] <- 63140
ess_subset$GNP[ess_subset$cntry == "DE"] <- 49220
ess_subset$GNP[ess_subset$cntry == "EE"] <- 23010
ess_subset$GNP[ess_subset$cntry == "FI"] <- 49940
ess_subset$GNP[ess_subset$cntry == "FR"] <- 42460
ess_subset$GNP[ess_subset$cntry == "GR"] <- 19690
ess_subset$GNP[ess_subset$cntry == "IE"] <- 63570
ess_subset$GNP[ess_subset$cntry == "IT"] <- 34930
ess_subset$GNP[ess_subset$cntry == "HR"] <- 15580
ess_subset$GNP[ess_subset$cntry == "LV"] <- 17830
ess_subset$GNP[ess_subset$cntry == "LT"] <- 19080
ess_subset$GNP[ess_subset$cntry == "LU"] <- 77500
ess_subset$GNP[ess_subset$cntry == "NL"] <- 51930
ess_subset$GNP[ess_subset$cntry == "AT"] <- 51020
ess_subset$GNP[ess_subset$cntry == "PL"] <- 15330
ess_subset$GNP[ess_subset$cntry == "PT"] <- 23200
ess_subset$GNP[ess_subset$cntry == "RO"] <- 12670
ess_subset$GNP[ess_subset$cntry == "SE"] <- 56420
ess_subset$GNP[ess_subset$cntry == "SK"] <- 19200
ess_subset$GNP[ess_subset$cntry == "SI"] <- 26040
ess_subset$GNP[ess_subset$cntry == "ES"] <- 30360
ess_subset$GNP[ess_subset$cntry == "CZ"] <- 22120
ess_subset$GNP[ess_subset$cntry == "HU"] <- 16570
ess_subset$GNP[ess_subset$cntry == "CY"] <- 28560
Desc(ess_subset$GNP)
## ------------------------------------------------------------------------------
## ess_subset$GNP (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 22 0 34'382.09 34'213.18
## 100.0% 0.0% 0.0% 34'551.01
##
## .05 .10 .25 median .75 .90 .95
## 9'500.00 15'580.00 19'080.00 30'360.00 49'220.00 56'420.00 63'570.00
##
## range sd vcoef mad IQR skew kurt
## 54'070.00 16'911.40 0.49 20'445.05 30'140.00 0.28 -1.30
##
## lowest : 9'500.0 (2'198), 15'330.0 (1'500), 15'580.0 (1'810), 16'570.0 (1'661), 17'830.0 (918)
## highest: 51'020.0 (2'499), 51'930.0 (1'673), 56'420.0 (1'539), 63'140.0 (1'572), 63'570.0 (2'216)
##
## heap(?): remarkable frequency (7.1%) for the mode(s) (= 34930)
##
## ' 95%-CI (classic)
df3 <- data.frame(
col1 = c("AT","BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR","DE", "EL","HU", "IE", "IT", "LV", "LT","LU", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE"),
col2 = c(51020,48100,9500,15580,28560,22120,63140,23010,49940,42460,49220,19690,16570,63570,34930,17830,19080,77500,51930,15330,23200,12670,19200,26040
,30360,56420))
names(df3)[names(df3) == "col1"] <- "geo"
names(df3)[names(df3) == "col2"] <- "means"
names(df3)
## [1] "geo" "means"
tableHTML::tableHTML(df3)
| geo | means | |
|---|---|---|
| 1 | AT | 51020 |
| 2 | BE | 48100 |
| 3 | BG | 9500 |
| 4 | HR | 15580 |
| 5 | CY | 28560 |
| 6 | CZ | 22120 |
| 7 | DK | 63140 |
| 8 | EE | 23010 |
| 9 | FI | 49940 |
| 10 | FR | 42460 |
| 11 | DE | 49220 |
| 12 | EL | 19690 |
| 13 | HU | 16570 |
| 14 | IE | 63570 |
| 15 | IT | 34930 |
| 16 | LV | 17830 |
| 17 | LT | 19080 |
| 18 | LU | 77500 |
| 19 | NL | 51930 |
| 20 | PL | 15330 |
| 21 | PT | 23200 |
| 22 | RO | 12670 |
| 23 | SK | 19200 |
| 24 | SI | 26040 |
| 25 | ES | 30360 |
| 26 | SE | 56420 |
get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
## Simple feature collection with 37 features and 11 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -63.08825 ymin: -21.38917 xmax: 55.83616 ymax: 71.15304
## Geodetic CRS: WGS 84
## First 10 features:
## id LEVL_CODE NUTS_ID CNTR_CODE NAME_LATN NUTS_NAME MOUNT_TYPE
## 1 AL 0 AL AL SHQIPËRIA SHQIPËRIA 0
## 2 AT 0 AT AT ÖSTERREICH ÖSTERREICH 0
## 3 BE 0 BE BE BELGIQUE-BELGIË BELGIQUE-BELGIË 0
## 4 NL 0 NL NL NEDERLAND NEDERLAND 0
## 5 PL 0 PL PL POLSKA POLSKA 0
## 6 PT 0 PT PT PORTUGAL PORTUGAL 0
## 7 DK 0 DK DK DANMARK DANMARK 0
## 8 DE 0 DE DE DEUTSCHLAND DEUTSCHLAND 0
## 9 EL 0 EL EL ELLADA ΕΛΛΑΔΑ 0
## 10 ES 0 ES ES ESPAÑA ESPAÑA 0
## URBN_TYPE COAST_TYPE FID geometry geo
## 1 0 0 AL MULTIPOLYGON (((19.82698 42... AL
## 2 0 0 AT MULTIPOLYGON (((15.54245 48... AT
## 3 0 0 BE MULTIPOLYGON (((5.10218 51.... BE
## 4 0 0 NL MULTIPOLYGON (((6.87491 53.... NL
## 5 0 0 PL MULTIPOLYGON (((18.95003 54... PL
## 6 0 0 PT MULTIPOLYGON (((-8.16508 41... PT
## 7 0 0 DK MULTIPOLYGON (((14.8254 55.... DK
## 8 0 0 DE MULTIPOLYGON (((8.63593 54.... DE
## 9 0 0 EL MULTIPOLYGON (((29.60853 36... EL
## 10 0 0 ES MULTIPOLYGON (((4.28746 39.... ES
SHP_3 <- get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
SHP_27_3 <- SHP_3 %>%
select(geo) %>%
inner_join(df3, by = "geo") %>%
arrange(geo) %>%
st_as_sf()
SHP_27_3 %>%
ggplot() +
geom_sf() +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void()
df_shp_3 <- df3 %>%
select(geo, means) %>%
inner_join(SHP_27_3, by = "geo") %>%
st_as_sf()
g4 <- df_shp_3 %>%
ggplot() +
labs(title = "GNP in Europa in $") +
gg_theme3
g4
ggsave(filename = "Heatmap_GNP.png", plot = g4, width = 8, height = 7, dpi = 1000)
ess_subset$Gini[ess_subset$cntry == "BE"] <- 26
ess_subset$Gini[ess_subset$cntry == "BG"] <- 40.5
ess_subset$Gini[ess_subset$cntry == "DK"] <- 27.5
ess_subset$Gini[ess_subset$cntry == "DE"] <- 31.8
ess_subset$Gini[ess_subset$cntry == "EE"] <- 30.7
ess_subset$Gini[ess_subset$cntry == "FI"] <- 27.1
ess_subset$Gini[ess_subset$cntry == "FR"] <- 30.7
ess_subset$Gini[ess_subset$cntry == "GR"] <- 33.6
ess_subset$Gini[ess_subset$cntry == "IE"] <- 29.2
ess_subset$Gini[ess_subset$cntry == "IT"] <- 35.2
ess_subset$Gini[ess_subset$cntry == "HR"] <- 29.5
ess_subset$Gini[ess_subset$cntry == "LV"] <- 35.7
ess_subset$Gini[ess_subset$cntry == "LT"] <- 36
ess_subset$Gini[ess_subset$cntry == "LU"] <- 33.4
ess_subset$Gini[ess_subset$cntry == "NL"] <- 26
ess_subset$Gini[ess_subset$cntry == "AT"] <- 29.8
ess_subset$Gini[ess_subset$cntry == "PL"] <- 30.2
ess_subset$Gini[ess_subset$cntry == "PT"] <- 34.7
ess_subset$Gini[ess_subset$cntry == "RO"] <- 34.6
ess_subset$Gini[ess_subset$cntry == "SE"] <- 28.9
ess_subset$Gini[ess_subset$cntry == "SK"] <- 25
ess_subset$Gini[ess_subset$cntry == "SI"] <- 24
ess_subset$Gini[ess_subset$cntry == "ES"] <- 34.9
ess_subset$Gini[ess_subset$cntry == "CZ"] <- 26.2
ess_subset$Gini[ess_subset$cntry == "HU"] <- 29.7
ess_subset$Gini[ess_subset$cntry == "CY"] <- 31.7
Desc(ess_subset$Gini)
## ------------------------------------------------------------------------------
## ess_subset$Gini (numeric)
##
## length n NAs unique 0s mean meanCI'
## 38'508 38'508 0 20 0 30.78 30.73
## 100.0% 0.0% 0.0% 30.82
##
## .05 .10 .25 median .75 .90 .95
## 25.00 26.00 27.50 29.80 34.70 36.00 40.50
##
## range sd vcoef mad IQR skew kurt
## 16.50 4.08 0.13 3.41 7.20 0.58 -0.16
##
## lowest : 24.0 (1'318), 25.0 (1'083), 26.0 (3'440), 26.2 (2'398), 27.5 (1'572)
## highest: 34.9 (1'668), 35.2 (2'745), 35.7 (918), 36.0 (1'835), 40.5 (2'198)
##
## heap(?): remarkable frequency (10.2%) for the mode(s) (= 30.7)
##
## ' 95%-CI (classic)
df4 <- data.frame(
col1 = c("AT","BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR","DE", "EL","HU", "IE", "IT", "LV", "LT","LU", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE"),
col2 = c(29.8,26,40.5,29.5,31.8,26.2,27.5,30.7,27.1,30.7,31.7,33.6,29.7,29.2,35.2,35.7,36,33.4,26,30.2,34.7,34.6,25,24,34.9,28.9))
names(df4)[names(df4) == "col1"] <- "geo"
names(df4)[names(df4) == "col2"] <- "means"
names(df4)
## [1] "geo" "means"
tableHTML::tableHTML(df4)
| geo | means | |
|---|---|---|
| 1 | AT | 29.8 |
| 2 | BE | 26 |
| 3 | BG | 40.5 |
| 4 | HR | 29.5 |
| 5 | CY | 31.8 |
| 6 | CZ | 26.2 |
| 7 | DK | 27.5 |
| 8 | EE | 30.7 |
| 9 | FI | 27.1 |
| 10 | FR | 30.7 |
| 11 | DE | 31.7 |
| 12 | EL | 33.6 |
| 13 | HU | 29.7 |
| 14 | IE | 29.2 |
| 15 | IT | 35.2 |
| 16 | LV | 35.7 |
| 17 | LT | 36 |
| 18 | LU | 33.4 |
| 19 | NL | 26 |
| 20 | PL | 30.2 |
| 21 | PT | 34.7 |
| 22 | RO | 34.6 |
| 23 | SK | 25 |
| 24 | SI | 24 |
| 25 | ES | 34.9 |
| 26 | SE | 28.9 |
get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
## Simple feature collection with 37 features and 11 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -63.08825 ymin: -21.38917 xmax: 55.83616 ymax: 71.15304
## Geodetic CRS: WGS 84
## First 10 features:
## id LEVL_CODE NUTS_ID CNTR_CODE NAME_LATN NUTS_NAME MOUNT_TYPE
## 1 AL 0 AL AL SHQIPËRIA SHQIPËRIA 0
## 2 AT 0 AT AT ÖSTERREICH ÖSTERREICH 0
## 3 BE 0 BE BE BELGIQUE-BELGIË BELGIQUE-BELGIË 0
## 4 NL 0 NL NL NEDERLAND NEDERLAND 0
## 5 PL 0 PL PL POLSKA POLSKA 0
## 6 PT 0 PT PT PORTUGAL PORTUGAL 0
## 7 DK 0 DK DK DANMARK DANMARK 0
## 8 DE 0 DE DE DEUTSCHLAND DEUTSCHLAND 0
## 9 EL 0 EL EL ELLADA ΕΛΛΑΔΑ 0
## 10 ES 0 ES ES ESPAÑA ESPAÑA 0
## URBN_TYPE COAST_TYPE FID geometry geo
## 1 0 0 AL MULTIPOLYGON (((19.82698 42... AL
## 2 0 0 AT MULTIPOLYGON (((15.54245 48... AT
## 3 0 0 BE MULTIPOLYGON (((5.10218 51.... BE
## 4 0 0 NL MULTIPOLYGON (((6.87491 53.... NL
## 5 0 0 PL MULTIPOLYGON (((18.95003 54... PL
## 6 0 0 PT MULTIPOLYGON (((-8.16508 41... PT
## 7 0 0 DK MULTIPOLYGON (((14.8254 55.... DK
## 8 0 0 DE MULTIPOLYGON (((8.63593 54.... DE
## 9 0 0 EL MULTIPOLYGON (((29.60853 36... EL
## 10 0 0 ES MULTIPOLYGON (((4.28746 39.... ES
SHP_4 <- get_eurostat_geospatial(resolution = 10,
nuts_level = 0,
year = 2016)
SHP_27_4 <- SHP_4 %>%
select(geo) %>%
inner_join(df4, by = "geo") %>%
arrange(geo) %>%
st_as_sf()
SHP_27_4 %>%
ggplot() +
geom_sf() +
scale_x_continuous(limits = c(-10, 35)) +
scale_y_continuous(limits = c(35, 65)) +
theme_void()
df_shp_4 <- df4 %>%
select(geo, means) %>%
inner_join(SHP_27_3, by = "geo") %>%
st_as_sf()
g5 <- df_shp_4 %>%
ggplot() +
labs(title = "Gini_Index in Europa") +
gg_theme4
g5
ggsave(filename = "Heatmap_Gini.png", plot = g5, width = 8, height = 7, dpi = 1000)
sumtable(ess_subset, vars = c('polTeilhabe', 'hincfel', 'bildung', 'agea', 'geschlecht', 'GNP', 'Gini', 'Herkunft')
,summ = list(
c('notNA(x)', 'mean(x)', 'median(x)', 'sd(x)', 'min(x)', 'max(x)', 'pctile(x)[25]', 'pctile(x)[75]')
),
summ.names = list(
c('N', 'Mean', 'Median', 'Standard Error', 'Minimum', 'Maximum', '1 Quantil', '4 Quantil')
)
,labels = c("Möglichkeit zur pol. Teilhabe", "Fähigkeit mit Einkommen leben zu bestreiten", "Bildung (harmonisiert)", "Alter", "Geschlecht", "GNP per capita", "Gini-Koeffizient", "Herkunft aus Europa"))#, file = 'Deskriptive Statistik Control')
| Variable | N | Mean | Median | Standard Error | Minimum | Maximum | 1 Quantil | 4 Quantil |
|---|---|---|---|---|---|---|---|---|
| Möglichkeit zur pol. Teilhabe | 38508 | 1.1 | 1 | 0.85 | 0 | 4 | 0.5 | 2 |
| Fähigkeit mit Einkommen leben zu bestreiten | 37918 | 2 | 2 | 0.85 | 1 | 4 | 1 | 2 |
| Bildung (harmonisiert) | 38336 | 2.1 | 2 | 0.77 | 1 | 3 | 1 | 3 |
| Alter | 38354 | 51 | 52 | 19 | 15 | 90 | 36 | 66 |
| Geschlecht | 38508 | 0.54 | 1 | 0.5 | 0 | 1 | 0 | 1 |
| GNP per capita | 38508 | 34382 | 30360 | 16911 | 9500 | 63570 | 19080 | 49220 |
| Gini-Koeffizient | 38508 | 31 | 30 | 4.1 | 24 | 40 | 28 | 35 |
| Herkunft aus Europa | 38508 | |||||||
| … 3 | 3111 | 8% | ||||||
| … 1 | 17406 | 45% | ||||||
| … 2 | 17991 | 47% |
sumtable(ess_subset, vars = c('GNP', 'Gini')
,summ = list(
c('notNA(x)', 'mean(x)', 'median(x)', 'sd(x)', 'min(x)', 'max(x)', 'pctile(x)[25]', 'pctile(x)[75]')
),
summ.names = list(
c('N', 'Mean', 'Median', 'Standard Error', 'Minimum', 'Maximum', '1 Quantil', '4 Quantil')
)
,title = "Deskriptive Statistik kontextuellen Variablen"
,labels = c("GNP per capita", "Gini-Koeffizient"), file = 'Deskriptive Statistik Kontextuell')
| Variable | N | Mean | Median | Standard Error | Minimum | Maximum | 1 Quantil | 4 Quantil |
|---|---|---|---|---|---|---|---|---|
| GNP per capita | 38508 | 34382 | 30360 | 16911 | 9500 | 63570 | 19080 | 49220 |
| Gini-Koeffizient | 38508 | 31 | 30 | 4.1 | 24 | 40 | 28 | 35 |
x = corruption, y = rep_institution, reg_institution
Es wird zur besseren Betrachtung noch eine Unterscheidung nach Ländern durchgeführt, um zu sehen, ob es unterschiedliche Werte gibt, für die Unterscheidung zwischen den Ländern
bevor es zu den Regression kommt, sollen die Daten, für eine vereinfachte Replizierung gespeichert werden, um so das Problem zu umgehen, dass aufgrund der Imputation, die Ergebnisse der Regressionen sich immer minimal unterscheiden können, zu den Ergebnissen, welcher in der Bachelorarbeit präsentiert wurden.
#save(ess_subset, file = "Analysedaten.Rda")
#Falls diese Daten genutzt werden wollen, können sie einfache mit load() eingelesen werden, oder durch Drag and Drop
#ess_subset$corruption <- order(as.factor(ess_subset$corruption))
m1 <- lmer(rep_institution ~ 1 + (1|cntry), data = ess_subset)
summary(m1)
## Linear mixed model fit by REML ['lmerMod']
## Formula: rep_institution ~ 1 + (1 | cntry)
## Data: ess_subset
##
## REML criterion at convergence: 163923.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.6978 -0.7545 0.0464 0.7088 3.7386
##
## Random effects:
## Groups Name Variance Std.Dev.
## cntry (Intercept) 0.6769 0.8227
## Residual 4.1197 2.0297
## Number of obs: 38508, groups: cntry, 22
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.9433 0.1757 22.44
tab_model(m1)
| rep_institution | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 3.94 | 3.60 – 4.29 | <0.001 |
| Random Effects | |||
| σ2 | 4.12 | ||
| τ00 cntry | 0.68 | ||
| ICC | 0.14 | ||
| N cntry | 22 | ||
| Observations | 38508 | ||
| Marginal R2 / Conditional R2 | 0.000 / 0.141 | ||
performance::icc(m1)
## # Intraclass Correlation Coefficient
##
## Adjusted ICC: 0.141
## Unadjusted ICC: 0.141
#Modell mit Variation über die Länder
m2 <- lmer(rep_institution ~ 1 + cntry + (1 | cntry), data = ess_subset)
summary(m2)
## Linear mixed model fit by REML ['lmerMod']
## Formula: rep_institution ~ 1 + cntry + (1 | cntry)
## Data: ess_subset
##
## REML criterion at convergence: 163869.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.7006 -0.7530 0.0458 0.7107 3.7411
##
## Random effects:
## Groups Name Variance Std.Dev.
## cntry (Intercept) 1.957 1.399
## Residual 4.120 2.030
## Number of obs: 38508, groups: cntry, 22
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 4.548719 1.399486 3.250
## cntryBE -0.003304 1.979345 -0.002
## cntryBG -1.991281 1.979229 -1.006
## cntryCY -1.061203 1.980088 -0.536
## cntryCZ -0.695091 1.979190 -0.351
## cntryDE -0.141701 1.979197 -0.072
## cntryDK 0.927267 1.979418 0.468
## cntryEE -0.264056 1.979302 -0.133
## cntryES -1.151387 1.979380 -0.582
## cntryFR -0.869366 1.979274 -0.439
## cntryHR -2.142090 1.979331 -1.082
## cntryHU -0.225571 1.979382 -0.114
## cntryIE -0.223020 1.979225 -0.113
## cntryIT -0.899539 1.979135 -0.455
## cntryLT -1.010300 1.979323 -0.510
## cntryLV -1.270397 1.979889 -0.642
## cntryNL 0.932601 1.979378 0.471
## cntryPL -0.868886 1.979450 -0.439
## cntryPT -0.997535 1.979742 -0.504
## cntrySE 0.749526 1.979432 0.379
## cntrySI -1.350692 1.979545 -0.682
## cntrySK -0.768249 1.979717 -0.388
tab_model(m2, p.style ="star")
| rep_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 4.55 ** | 1.81 – 7.29 |
| cntry [BE] | -0.00 | -3.88 – 3.88 |
| cntry [BG] | -1.99 | -5.87 – 1.89 |
| cntry [CY] | -1.06 | -4.94 – 2.82 |
| cntry [CZ] | -0.70 | -4.57 – 3.18 |
| cntry [DE] | -0.14 | -4.02 – 3.74 |
| cntry [DK] | 0.93 | -2.95 – 4.81 |
| cntry [EE] | -0.26 | -4.14 – 3.62 |
| cntry [ES] | -1.15 | -5.03 – 2.73 |
| cntry [FR] | -0.87 | -4.75 – 3.01 |
| cntry [HR] | -2.14 | -6.02 – 1.74 |
| cntry [HU] | -0.23 | -4.11 – 3.65 |
| cntry [IE] | -0.22 | -4.10 – 3.66 |
| cntry [IT] | -0.90 | -4.78 – 2.98 |
| cntry [LT] | -1.01 | -4.89 – 2.87 |
| cntry [LV] | -1.27 | -5.15 – 2.61 |
| cntry [NL] | 0.93 | -2.95 – 4.81 |
| cntry [PL] | -0.87 | -4.75 – 3.01 |
| cntry [PT] | -1.00 | -4.88 – 2.88 |
| cntry [SE] | 0.75 | -3.13 – 4.63 |
| cntry [SI] | -1.35 | -5.23 – 2.53 |
| cntry [SK] | -0.77 | -4.65 – 3.11 |
| Random Effects | ||
| σ2 | 4.12 | |
| τ00 cntry | 1.96 | |
| ICC | 0.32 | |
| N cntry | 22 | |
| Observations | 38508 | |
| Marginal R2 / Conditional R2 | 0.095 / 0.387 | |
|
||
performance::icc(m2)
## # Intraclass Correlation Coefficient
##
## Adjusted ICC: 0.322
## Unadjusted ICC: 0.291
m3 <- lmer(reg_institution ~ 1 + (1|cntry), data = ess_subset)
summary(m3)
## Linear mixed model fit by REML ['lmerMod']
## Formula: reg_institution ~ 1 + (1 | cntry)
## Data: ess_subset
##
## REML criterion at convergence: 168090.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6527 -0.6370 0.0824 0.6968 3.0496
##
## Random effects:
## Groups Name Variance Std.Dev.
## cntry (Intercept) 1.048 1.024
## Residual 4.590 2.142
## Number of obs: 38508, groups: cntry, 22
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 5.6839 0.2185 26.01
tab_model(m3)
| reg_institution | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 5.68 | 5.26 – 6.11 | <0.001 |
| Random Effects | |||
| σ2 | 4.59 | ||
| τ00 cntry | 1.05 | ||
| ICC | 0.19 | ||
| N cntry | 22 | ||
| Observations | 38508 | ||
| Marginal R2 / Conditional R2 | 0.000 / 0.186 | ||
performance::icc(m3)
## # Intraclass Correlation Coefficient
##
## Adjusted ICC: 0.186
## Unadjusted ICC: 0.186
#Modell mit Variation über die Länder
m4 <- lmer(reg_institution ~ 1 + cntry + (1 | cntry), data = ess_subset)
summary(m4)
## Linear mixed model fit by REML ['lmerMod']
## Formula: reg_institution ~ 1 + cntry + (1 | cntry)
## Data: ess_subset
##
## REML criterion at convergence: 168027.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6555 -0.6372 0.0811 0.6966 3.0517
##
## Random effects:
## Groups Name Variance Std.Dev.
## cntry (Intercept) 2.274 1.508
## Residual 4.590 2.142
## Number of obs: 38508, groups: cntry, 22
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 7.0280 1.5087 4.658
## cntryBE -1.0855 2.1339 -0.509
## cntryBG -3.5658 2.1337 -1.671
## cntryCY -2.1464 2.1346 -1.006
## cntryCZ -1.4955 2.1337 -0.701
## cntryDE -0.4158 2.1337 -0.195
## cntryDK 0.8034 2.1339 0.376
## cntryEE -0.5611 2.1338 -0.263
## cntryES -1.2594 2.1339 -0.590
## cntryFR -1.1628 2.1338 -0.545
## cntryHR -3.1471 2.1338 -1.475
## cntryHU -1.0732 2.1339 -0.503
## cntryIE -1.2577 2.1337 -0.589
## cntryIT -1.0204 2.1336 -0.478
## cntryLT -1.5501 2.1338 -0.726
## cntryLV -2.0629 2.1344 -0.966
## cntryNL -0.2017 2.1339 -0.094
## cntryPL -1.9787 2.1340 -0.927
## cntryPT -1.8062 2.1343 -0.846
## cntrySE -0.2743 2.1339 -0.129
## cntrySI -1.9768 2.1341 -0.926
## cntrySK -2.3396 2.1342 -1.096
## optimizer (nloptwrap) convergence code: 0 (OK)
## unable to evaluate scaled gradient
## Model failed to converge: degenerate Hessian with 1 negative eigenvalues
tab_model(m4, p.style = "stars")
| reg_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 7.03 *** | 4.07 – 9.99 |
| cntry [BE] | -1.09 | -5.27 – 3.10 |
| cntry [BG] | -3.57 | -7.75 – 0.62 |
| cntry [CY] | -2.15 | -6.33 – 2.04 |
| cntry [CZ] | -1.50 | -5.68 – 2.69 |
| cntry [DE] | -0.42 | -4.60 – 3.77 |
| cntry [DK] | 0.80 | -3.38 – 4.99 |
| cntry [EE] | -0.56 | -4.74 – 3.62 |
| cntry [ES] | -1.26 | -5.44 – 2.92 |
| cntry [FR] | -1.16 | -5.35 – 3.02 |
| cntry [HR] | -3.15 | -7.33 – 1.04 |
| cntry [HU] | -1.07 | -5.26 – 3.11 |
| cntry [IE] | -1.26 | -5.44 – 2.92 |
| cntry [IT] | -1.02 | -5.20 – 3.16 |
| cntry [LT] | -1.55 | -5.73 – 2.63 |
| cntry [LV] | -2.06 | -6.25 – 2.12 |
| cntry [NL] | -0.20 | -4.38 – 3.98 |
| cntry [PL] | -1.98 | -6.16 – 2.20 |
| cntry [PT] | -1.81 | -5.99 – 2.38 |
| cntry [SE] | -0.27 | -4.46 – 3.91 |
| cntry [SI] | -1.98 | -6.16 – 2.21 |
| cntry [SK] | -2.34 | -6.52 – 1.84 |
| Random Effects | ||
| σ2 | 4.59 | |
| τ00 cntry | 2.27 | |
| ICC | 0.33 | |
| N cntry | 22 | |
| Observations | 38508 | |
| Marginal R2 / Conditional R2 | 0.130 / 0.418 | |
|
||
performance::icc(m4)
## # Intraclass Correlation Coefficient
##
## Adjusted ICC: 0.331
## Unadjusted ICC: 0.288
#Prüfung des Modells
#model_dashboard(m1)
#model_dashboard(m2)
#model_dashboard(m3)
#model_dashboard(m4)
#Tabelle
tab_model(m1, m2, m3, m4,
show.aic = T,
show.dev = T,
p.style = "stars",
title = "Nullmodell des Efekts wahrgenommener Korruption auf das institutionelle politische Vertrauen",
dv.labels = c("Vertrauen in repräsenative Institutionen", "Variation über die Länder", "Vertrauen in regulative Institutionen", "Variation über die Länder"),file = "Nullmodell.html")
| Vertrauen in repräsenative Institutionen | Variation über die Länder | Vertrauen in regulative Institutionen | Variation über die Länder | |||||
|---|---|---|---|---|---|---|---|---|
| Predictors | Estimates | CI | Estimates | CI | Estimates | CI | Estimates | CI |
| (Intercept) | 3.94 *** | 3.60 – 4.29 | 4.55 ** | 1.81 – 7.29 | 5.68 *** | 5.26 – 6.11 | 7.03 *** | 4.07 – 9.99 |
| cntry [BE] | -0.00 | -3.88 – 3.88 | -1.09 | -5.27 – 3.10 | ||||
| cntry [BG] | -1.99 | -5.87 – 1.89 | -3.57 | -7.75 – 0.62 | ||||
| cntry [CY] | -1.06 | -4.94 – 2.82 | -2.15 | -6.33 – 2.04 | ||||
| cntry [CZ] | -0.70 | -4.57 – 3.18 | -1.50 | -5.68 – 2.69 | ||||
| cntry [DE] | -0.14 | -4.02 – 3.74 | -0.42 | -4.60 – 3.77 | ||||
| cntry [DK] | 0.93 | -2.95 – 4.81 | 0.80 | -3.38 – 4.99 | ||||
| cntry [EE] | -0.26 | -4.14 – 3.62 | -0.56 | -4.74 – 3.62 | ||||
| cntry [ES] | -1.15 | -5.03 – 2.73 | -1.26 | -5.44 – 2.92 | ||||
| cntry [FR] | -0.87 | -4.75 – 3.01 | -1.16 | -5.35 – 3.02 | ||||
| cntry [HR] | -2.14 | -6.02 – 1.74 | -3.15 | -7.33 – 1.04 | ||||
| cntry [HU] | -0.23 | -4.11 – 3.65 | -1.07 | -5.26 – 3.11 | ||||
| cntry [IE] | -0.22 | -4.10 – 3.66 | -1.26 | -5.44 – 2.92 | ||||
| cntry [IT] | -0.90 | -4.78 – 2.98 | -1.02 | -5.20 – 3.16 | ||||
| cntry [LT] | -1.01 | -4.89 – 2.87 | -1.55 | -5.73 – 2.63 | ||||
| cntry [LV] | -1.27 | -5.15 – 2.61 | -2.06 | -6.25 – 2.12 | ||||
| cntry [NL] | 0.93 | -2.95 – 4.81 | -0.20 | -4.38 – 3.98 | ||||
| cntry [PL] | -0.87 | -4.75 – 3.01 | -1.98 | -6.16 – 2.20 | ||||
| cntry [PT] | -1.00 | -4.88 – 2.88 | -1.81 | -5.99 – 2.38 | ||||
| cntry [SE] | 0.75 | -3.13 – 4.63 | -0.27 | -4.46 – 3.91 | ||||
| cntry [SI] | -1.35 | -5.23 – 2.53 | -1.98 | -6.16 – 2.21 | ||||
| cntry [SK] | -0.77 | -4.65 – 3.11 | -2.34 | -6.52 – 1.84 | ||||
| Random Effects | ||||||||
| σ2 | 4.12 | 4.12 | 4.59 | 4.59 | ||||
| τ00 | 0.68 cntry | 1.96 cntry | 1.05 cntry | 2.27 cntry | ||||
| ICC | 0.14 | 0.32 | 0.19 | 0.33 | ||||
| N | 22 cntry | 22 cntry | 22 cntry | 22 cntry | ||||
| Observations | 38508 | 38508 | 38508 | 38508 | ||||
| Marginal R2 / Conditional R2 | 0.000 / 0.141 | 0.095 / 0.387 | 0.000 / 0.186 | 0.130 / 0.418 | ||||
| Deviance | 163922.166 | 163924.463 | 168089.590 | 168085.608 | ||||
| AIC | 163929.805 | 163917.236 | 168096.794 | 168075.075 | ||||
|
||||||||
Ebene 1 mit Fixed slopes und random intercepts
#fixed slope Ebene 1
m5 <- lmer(rep_institution ~ 1 + corruption +
PolInteresse_dummy +
geschlecht +
Alter_zentriert +
Bildung +
Einkommen +
polTeilhabe +
religionszugehörigkeit +
(1 | cntry), data = ess_subset)
tab_model(m5, p.style = "stars")
| rep_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 1.10 * | 0.18 – 2.01 |
| corruption | 0.28 *** | 0.15 – 0.42 |
| PolInteresse dummy [1] | 0.25 *** | 0.19 – 0.31 |
| geschlecht | 0.16 *** | 0.11 – 0.21 |
| Alter zentriert | 0.00 | -0.00 – 0.00 |
| Bildung [2] | -0.10 ** | -0.17 – -0.04 |
| Bildung [3] | -0.04 | -0.11 – 0.02 |
| Einkommen | -0.28 *** | -0.34 – -0.22 |
| polTeilhabe | 0.98 *** | 0.95 – 1.01 |
|
religionszugehörigkeit [1] |
-0.08 | -0.32 – 0.17 |
|
religionszugehörigkeit [2] |
-0.02 | -0.28 – 0.23 |
|
religionszugehörigkeit [3] |
-0.07 | -0.34 – 0.20 |
|
religionszugehörigkeit [4] |
-0.10 | -0.39 – 0.20 |
|
religionszugehörigkeit [5] |
0.20 | -0.44 – 0.85 |
|
religionszugehörigkeit [6] |
0.58 *** | 0.30 – 0.85 |
| Random Effects | ||
| σ2 | 3.39 | |
| τ00 cntry | 0.17 | |
| ICC | 0.05 | |
| N cntry | 22 | |
| Observations | 22281 | |
| Marginal R2 / Conditional R2 | 0.256 / 0.291 | |
|
||
#fixed slope Ebene 1
m6 <- lmer(reg_institution ~ 1 + corruption +
PolInteresse_dummy +
geschlecht +
Alter_zentriert +
Bildung +
Einkommen +
polTeilhabe +
religionszugehörigkeit +
(1 | cntry), data = ess_subset)
tab_model(m6, p.style = "stars", show.aic = T)
| reg_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 2.24 *** | 1.01 – 3.47 |
| corruption | 0.46 *** | 0.27 – 0.64 |
| PolInteresse dummy [1] | -0.01 | -0.07 – 0.05 |
| geschlecht | 0.10 *** | 0.04 – 0.15 |
| Alter zentriert | 0.00 | -0.00 – 0.00 |
| Bildung [2] | -0.07 | -0.14 – 0.00 |
| Bildung [3] | 0.01 | -0.06 – 0.09 |
| Einkommen | -0.35 *** | -0.42 – -0.28 |
| polTeilhabe | 0.63 *** | 0.59 – 0.66 |
|
religionszugehörigkeit [1] |
-0.00 | -0.28 – 0.27 |
|
religionszugehörigkeit [2] |
-0.00 | -0.29 – 0.28 |
|
religionszugehörigkeit [3] |
-0.28 | -0.59 – 0.02 |
|
religionszugehörigkeit [4] |
-0.17 | -0.49 – 0.16 |
|
religionszugehörigkeit [5] |
-0.07 | -0.79 – 0.64 |
|
religionszugehörigkeit [6] |
0.39 * | 0.09 – 0.69 |
| Random Effects | ||
| σ2 | 4.16 | |
| τ00 cntry | 0.32 | |
| ICC | 0.07 | |
| N cntry | 22 | |
| Observations | 22281 | |
| Marginal R2 / Conditional R2 | 0.185 / 0.243 | |
| AIC | 95150.396 | |
|
||
#Prüfung des Modells
#model_dashboard(m5)
x <- check_collinearity(m5)
plot(x)
#model_dashboard(m6)
pander(anova(m5, m6))
| npar | AIC | BIC | logLik | deviance | Chisq | Df | Pr(>Chisq) | |
|---|---|---|---|---|---|---|---|---|
| m5 | 17 | 90504 | 90640 | -45235 | 90470 | NA | NA | NA |
| m6 | 17 | 95085 | 95221 | -47525 | 95051 | 0 | 0 | NA |
#Tabelle
tab_model(m5, m6,
show.aic = T,
show.dev = T,
p.style = "stars",
title = "MLM des Effekts wahrgenommener Korruption auf das institutionelle politische Vertrauen Ebene I",
dv.labels = c("Vertrauen in repräsentative Institutionen", "Vertrauen in regulative Institutionen"),
pred.labels = c("Intercept", "wahrgenommene Korruption", "politisches Interesse (kein Interesse = Referenz)", "Frauen (Männer = Refernz)", "Alter (Mittelwertszentriert, 51 Jahre)", "Mittlere Bildung", "Hohe Bildung", "Einkommen", "politische Teilhabe (System)", "Katholizismus", "Protestantismus", "Orthodoxie", "andere Form von Christentum", "Judentum", "Islam"),
file = "Ebene1.html")
| Vertrauen in repräsentative Institutionen | Vertrauen in regulative Institutionen | |||
|---|---|---|---|---|
| Predictors | Estimates | CI | Estimates | CI |
| Intercept | 1.10 * | 0.18 – 2.01 | 2.24 *** | 1.01 – 3.47 |
| wahrgenommene Korruption | 0.28 *** | 0.15 – 0.42 | 0.46 *** | 0.27 – 0.64 |
| politisches Interesse (kein Interesse = Referenz) | 0.25 *** | 0.19 – 0.31 | -0.01 | -0.07 – 0.05 |
| Frauen (Männer = Refernz) | 0.16 *** | 0.11 – 0.21 | 0.10 *** | 0.04 – 0.15 |
| Alter (Mittelwertszentriert, 51 Jahre) | 0.00 | -0.00 – 0.00 | 0.00 | -0.00 – 0.00 |
| Mittlere Bildung | -0.10 ** | -0.17 – -0.04 | -0.07 | -0.14 – 0.00 |
| Hohe Bildung | -0.04 | -0.11 – 0.02 | 0.01 | -0.06 – 0.09 |
| Einkommen | -0.28 *** | -0.34 – -0.22 | -0.35 *** | -0.42 – -0.28 |
| politische Teilhabe (System) | 0.98 *** | 0.95 – 1.01 | 0.63 *** | 0.59 – 0.66 |
| Katholizismus | -0.08 | -0.32 – 0.17 | -0.00 | -0.28 – 0.27 |
| Protestantismus | -0.02 | -0.28 – 0.23 | -0.00 | -0.29 – 0.28 |
| Orthodoxie | -0.07 | -0.34 – 0.20 | -0.28 | -0.59 – 0.02 |
| andere Form von Christentum | -0.10 | -0.39 – 0.20 | -0.17 | -0.49 – 0.16 |
| Judentum | 0.20 | -0.44 – 0.85 | -0.07 | -0.79 – 0.64 |
| Islam | 0.58 *** | 0.30 – 0.85 | 0.39 * | 0.09 – 0.69 |
| Random Effects | ||||
| σ2 | 3.39 | 4.16 | ||
| τ00 | 0.17 cntry | 0.32 cntry | ||
| ICC | 0.05 | 0.07 | ||
| N | 22 cntry | 22 cntry | ||
| Observations | 22281 | 22281 | ||
| Marginal R2 / Conditional R2 | 0.256 / 0.291 | 0.185 / 0.243 | ||
| Deviance | 90469.604 | 95051.086 | ||
| AIC | 90572.870 | 95150.396 | ||
|
||||
#random slope Ebene I+II
m7 <- lmer(rep_institution ~ 1 + corruption +
PolInteresse_dummy +
geschlecht +
Alter_zentriert +
Bildung +
Einkommen +
polTeilhabe +
religionszugehörigkeit +
Herkunft+
Gini +
(1 + corruption | cntry), data = ess_subset)
tab_model(m7, p.style = "stars")
| rep_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 2.69 * | 0.53 – 4.84 |
| corruption | 0.32 *** | 0.15 – 0.48 |
| PolInteresse dummy [1] | 0.25 *** | 0.20 – 0.31 |
| geschlecht | 0.16 *** | 0.11 – 0.21 |
| Alter zentriert | 0.00 | -0.00 – 0.00 |
| Bildung [2] | -0.10 ** | -0.17 – -0.04 |
| Bildung [3] | -0.05 | -0.11 – 0.02 |
| Einkommen | -0.28 *** | -0.34 – -0.22 |
| polTeilhabe | 0.98 *** | 0.95 – 1.01 |
|
religionszugehörigkeit [1] |
-0.08 | -0.33 – 0.17 |
|
religionszugehörigkeit [2] |
-0.03 | -0.29 – 0.23 |
|
religionszugehörigkeit [3] |
-0.06 | -0.33 – 0.22 |
|
religionszugehörigkeit [4] |
-0.10 | -0.39 – 0.19 |
|
religionszugehörigkeit [5] |
0.20 | -0.45 – 0.85 |
|
religionszugehörigkeit [6] |
0.58 *** | 0.31 – 0.85 |
| Herkunft [1] | 0.06 | -0.53 – 0.65 |
| Herkunft [2] | -0.01 | -0.52 – 0.49 |
| Gini | -0.06 ** | -0.10 – -0.02 |
| Random Effects | ||
| σ2 | 3.39 | |
| τ00 cntry | 3.63 | |
| τ11 cntry.corruption | 0.07 | |
| ρ01 cntry | -1.00 | |
| ICC | 0.06 | |
| N cntry | 22 | |
| Observations | 22281 | |
| Marginal R2 / Conditional R2 | 0.295 / 0.335 | |
|
||
m8 <- lmer(reg_institution ~ 1 + corruption +
PolInteresse_dummy +
geschlecht +
Alter_zentriert +
Bildung +
Einkommen +
polTeilhabe +
religionszugehörigkeit +
Herkunft +
(1| cntry), data = ess_subset)
vif(m8)
## GVIF Df GVIF^(1/(2*Df))
## corruption 2.446633 1 1.564172
## PolInteresse_dummy 1.172591 1 1.082862
## geschlecht 1.035181 1 1.017439
## Alter_zentriert 1.132943 1 1.064398
## Bildung 1.175301 2 1.041208
## Einkommen 1.072843 1 1.035781
## polTeilhabe 1.139919 1 1.067670
## religionszugehörigkeit 1.085805 6 1.006884
## Herkunft 2.465786 2 1.253109
summary(m8)
## Linear mixed model fit by REML ['lmerMod']
## Formula: reg_institution ~ 1 + corruption + PolInteresse_dummy + geschlecht +
## Alter_zentriert + Bildung + Einkommen + polTeilhabe + religionszugehörigkeit +
## Herkunft + (1 | cntry)
## Data: ess_subset
##
## REML criterion at convergence: 95115.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.9205 -0.6260 0.0674 0.6731 3.4789
##
## Random effects:
## Groups Name Variance Std.Dev.
## cntry (Intercept) 0.3345 0.5784
## Residual 4.1562 2.0387
## Number of obs: 22281, groups: cntry, 22
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 3.3498085 1.3516382 2.478
## corruption 0.3403487 0.1487803 2.288
## PolInteresse_dummy1 -0.0084331 0.0312561 -0.270
## geschlecht 0.0965105 0.0283161 3.408
## Alter_zentriert 0.0010575 0.0007905 1.338
## Bildung2 -0.0667110 0.0364097 -1.832
## Bildung3 0.0154665 0.0390361 0.396
## Einkommen -0.3515839 0.0344169 -10.215
## polTeilhabe 0.6279693 0.0186035 33.756
## religionszugehörigkeit1 -0.0033302 0.1403923 -0.024
## religionszugehörigkeit2 -0.0057181 0.1460308 -0.039
## religionszugehörigkeit3 -0.2810403 0.1538009 -1.827
## religionszugehörigkeit4 -0.1655401 0.1660678 -0.997
## religionszugehörigkeit5 -0.0758209 0.3672276 -0.206
## religionszugehörigkeit6 0.3887109 0.1542052 2.521
## Herkunft1 -0.5566888 0.6431701 -0.866
## Herkunft2 -0.2153828 0.5124825 -0.420
tab_model(m8, p.style = "stars", show.aic = T)
| reg_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 3.35 * | 0.70 – 6.00 |
| corruption | 0.34 * | 0.05 – 0.63 |
| PolInteresse dummy [1] | -0.01 | -0.07 – 0.05 |
| geschlecht | 0.10 *** | 0.04 – 0.15 |
| Alter zentriert | 0.00 | -0.00 – 0.00 |
| Bildung [2] | -0.07 | -0.14 – 0.00 |
| Bildung [3] | 0.02 | -0.06 – 0.09 |
| Einkommen | -0.35 *** | -0.42 – -0.28 |
| polTeilhabe | 0.63 *** | 0.59 – 0.66 |
|
religionszugehörigkeit [1] |
-0.00 | -0.28 – 0.27 |
|
religionszugehörigkeit [2] |
-0.01 | -0.29 – 0.28 |
|
religionszugehörigkeit [3] |
-0.28 | -0.58 – 0.02 |
|
religionszugehörigkeit [4] |
-0.17 | -0.49 – 0.16 |
|
religionszugehörigkeit [5] |
-0.08 | -0.80 – 0.64 |
|
religionszugehörigkeit [6] |
0.39 * | 0.09 – 0.69 |
| Herkunft [1] | -0.56 | -1.82 – 0.70 |
| Herkunft [2] | -0.22 | -1.22 – 0.79 |
| Random Effects | ||
| σ2 | 4.16 | |
| τ00 cntry | 0.33 | |
| ICC | 0.07 | |
| N cntry | 22 | |
| Observations | 22281 | |
| Marginal R2 / Conditional R2 | 0.184 / 0.245 | |
| AIC | 95153.119 | |
|
||
m8.1 <- lmer(reg_institution ~ 1 + corruption +
PolInteresse_dummy +
geschlecht +
Alter_zentriert +
Bildung +
Einkommen +
polTeilhabe +
religionszugehörigkeit +
Herkunft +
Gini +
(1 + corruption | cntry), data = ess_subset)
vif(m8.1)
## GVIF Df GVIF^(1/(2*Df))
## corruption 2.000230 1 1.414295
## PolInteresse_dummy 1.172631 1 1.082881
## geschlecht 1.035236 1 1.017466
## Alter_zentriert 1.132807 1 1.064334
## Bildung 1.175861 2 1.041331
## Einkommen 1.072685 1 1.035705
## polTeilhabe 1.139457 1 1.067453
## religionszugehörigkeit 1.096756 6 1.007726
## Herkunft 1.834352 2 1.163779
## Gini 1.226328 1 1.107397
tab_model(m8.1, p.style = "stars", show.aic = T)
| reg_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 1.18 | -2.42 – 4.78 |
| corruption | 0.49 *** | 0.20 – 0.77 |
| PolInteresse dummy [1] | -0.01 | -0.07 – 0.05 |
| geschlecht | 0.10 *** | 0.04 – 0.15 |
| Alter zentriert | 0.00 | -0.00 – 0.00 |
| Bildung [2] | -0.07 | -0.14 – 0.01 |
| Bildung [3] | 0.02 | -0.06 – 0.09 |
| Einkommen | -0.35 *** | -0.42 – -0.28 |
| polTeilhabe | 0.63 *** | 0.59 – 0.66 |
|
religionszugehörigkeit [1] |
-0.01 | -0.28 – 0.27 |
|
religionszugehörigkeit [2] |
-0.01 | -0.29 – 0.28 |
|
religionszugehörigkeit [3] |
-0.28 | -0.58 – 0.02 |
|
religionszugehörigkeit [4] |
-0.17 | -0.49 – 0.16 |
|
religionszugehörigkeit [5] |
-0.08 | -0.80 – 0.64 |
|
religionszugehörigkeit [6] |
0.39 * | 0.09 – 0.69 |
| Herkunft [1] | -0.16 | -1.41 – 1.10 |
| Herkunft [2] | -0.14 | -1.25 – 0.98 |
| Gini | 0.03 | -0.03 – 0.09 |
| Random Effects | ||
| σ2 | 4.16 | |
| τ00 cntry | 6.97 | |
| τ11 cntry.corruption | 0.15 | |
| ρ01 cntry | -1.00 | |
| ICC | 0.08 | |
| N cntry | 22 | |
| Observations | 22281 | |
| Marginal R2 / Conditional R2 | 0.184 / 0.248 | |
| AIC | 95158.557 | |
|
||
m8.2 <- lmer(reg_institution ~ 1 + corruption +
PolInteresse_dummy +
geschlecht +
Alter_zentriert +
Bildung +
Einkommen +
polTeilhabe +
religionszugehörigkeit +
Herkunft +
GNP +
Gini +
(1 | cntry), data = ess_subset)
vif(m8.2)
## GVIF Df GVIF^(1/(2*Df))
## corruption 4.427760 1 2.104224
## PolInteresse_dummy 1.172516 1 1.082828
## geschlecht 1.035181 1 1.017438
## Alter_zentriert 1.133038 1 1.064443
## Bildung 1.175608 2 1.041275
## Einkommen 1.072813 1 1.035767
## polTeilhabe 1.139768 1 1.067599
## religionszugehörigkeit 1.091858 6 1.007350
## Herkunft 5.432035 2 1.526654
## GNP 8.672340 1 2.944884
## Gini 1.530037 1 1.236947
tab_model(m8.2, p.style = "stars", show.aic = T)
| reg_institution | ||
|---|---|---|
| Predictors | Estimates | CI |
| (Intercept) | 3.29 | -1.23 – 7.81 |
| corruption | 0.29 | -0.12 – 0.71 |
| PolInteresse dummy [1] | -0.01 | -0.07 – 0.05 |
| geschlecht | 0.10 *** | 0.04 – 0.15 |
| Alter zentriert | 0.00 | -0.00 – 0.00 |
| Bildung [2] | -0.07 | -0.14 – 0.00 |
| Bildung [3] | 0.02 | -0.06 – 0.09 |
| Einkommen | -0.35 *** | -0.42 – -0.28 |
| polTeilhabe | 0.63 *** | 0.59 – 0.66 |
|
religionszugehörigkeit [1] |
-0.00 | -0.28 – 0.27 |
|
religionszugehörigkeit [2] |
-0.01 | -0.29 – 0.28 |
|
religionszugehörigkeit [3] |
-0.28 | -0.58 – 0.02 |
|
religionszugehörigkeit [4] |
-0.17 | -0.49 – 0.16 |
|
religionszugehörigkeit [5] |
-0.08 | -0.80 – 0.64 |
|
religionszugehörigkeit [6] |
0.39 * | 0.09 – 0.69 |
| Herkunft [1] | -0.41 | -2.10 – 1.28 |
| Herkunft [2] | -0.18 | -1.27 – 0.92 |
| GNP | 0.00 | -0.00 – 0.00 |
| Gini | 0.00 | -0.08 – 0.08 |
| Random Effects | ||
| σ2 | 4.16 | |
| τ00 cntry | 0.37 | |
| ICC | 0.08 | |
| N cntry | 22 | |
| Observations | 22281 | |
| Marginal R2 / Conditional R2 | 0.184 / 0.252 | |
| AIC | 95181.432 | |
|
||
x3 <- check_collinearity(m8.2)
plot(x3)
anova(m5, m6, m7, m8.1)
## Data: ess_subset
## Models:
## m5: rep_institution ~ 1 + corruption + PolInteresse_dummy + geschlecht + Alter_zentriert + Bildung + Einkommen + polTeilhabe + religionszugehörigkeit + (1 | cntry)
## m6: reg_institution ~ 1 + corruption + PolInteresse_dummy + geschlecht + Alter_zentriert + Bildung + Einkommen + polTeilhabe + religionszugehörigkeit + (1 | cntry)
## m7: rep_institution ~ 1 + corruption + PolInteresse_dummy + geschlecht + Alter_zentriert + Bildung + Einkommen + polTeilhabe + religionszugehörigkeit + Herkunft + Gini + (1 + corruption | cntry)
## m8.1: reg_institution ~ 1 + corruption + PolInteresse_dummy + geschlecht + Alter_zentriert + Bildung + Einkommen + polTeilhabe + religionszugehörigkeit + Herkunft + Gini + (1 + corruption | cntry)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## m5 17 90504 90640 -45235 90470
## m6 17 95085 95221 -47525 95051 0.0 0
## m7 22 90503 90679 -45229 90459 4592.4 5 < 2.2e-16 ***
## m8.1 22 95086 95262 -47521 95042 0.0 0
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
nach den Robustheitstests (= VIF) zeigt sich, das GNP nicht ins Modell aufgenommen werden darf, da sie die Unsicherheit der Parameter erhöhen aufgrund von Kolinearität und müssen aus dem Modell entfernt werden
Die Modelle ohne Kontrollvariablen auf der Kontextebene, haben ein höheres AIC und BIC und stellen somit keine Verbesserung des Modells dar
Weiterhin zeigt sich, dass die Herkunft als Dummy im Vergleich zu dem ohne ein höheres VIF hat Außerdem zeigt sich keine Modellverbesserung, weshalb es sinnlos ist diese Modell zu nutzen und sie dürfen nicht interpretiert werden. Auch der Interaktionseffekt führt zu keiner Verbesserung des Modells
#Prüfung des Modells
#model_dashboard(m7)
x1 <- check_collinearity(m7)
plot(x1)
#model_dashboard(m8.1)
pander(anova(m5, m6, m7, m8.1))
| npar | AIC | BIC | logLik | deviance | Chisq | Df | Pr(>Chisq) | |
|---|---|---|---|---|---|---|---|---|
| m5 | 17 | 90504 | 90640 | -45235 | 90470 | NA | NA | NA |
| m6 | 17 | 95085 | 95221 | -47525 | 95051 | 0 | 0 | NA |
| m7 | 22 | 90503 | 90679 | -45229 | 90459 | 4592 | 5 | 0 |
| m8.1 | 22 | 95086 | 95262 | -47521 | 95042 | 0 | 0 | NA |
#Tabelle
tab_model(m7, m8.1,
show.aic = T,
show.dev = T,
p.style = "stars",
title = "MLM des Effekts wahrgenommener Korruption auf das institutionelle politische Vertrauen Ebene I+II",
dv.labels = c("Vertrauen in repräsentative Institutionen", "Vertrauen in regulative Institutionen"),
pred.labels = c("Intercept", "wahrgenommene Korruption", "politisches Interesse (kein Interesse = Referenz)", "Frauen (Männer = Refernz)", "Alter (Mittelwertszentriert, 51 Jahre)", "Mittlere Bildung", "hohe Bildung", "Einkommen", "politische Teilhabe (System)", "Katholizismus", "Protestantismus", "Orthodoxie", "andere Form von Christentum", "Judentum", "Islam", "EU-Beitritt nach oder 2004", "EU-Beitritt vor 2004", "Gini"),
file = "Ebene2.html")
| Vertrauen in repräsentative Institutionen | Vertrauen in regulative Institutionen | |||
|---|---|---|---|---|
| Predictors | Estimates | CI | Estimates | CI |
| Intercept | 2.69 * | 0.53 – 4.84 | 1.18 | -2.42 – 4.78 |
| wahrgenommene Korruption | 0.32 *** | 0.15 – 0.48 | 0.49 *** | 0.20 – 0.77 |
| politisches Interesse (kein Interesse = Referenz) | 0.25 *** | 0.20 – 0.31 | -0.01 | -0.07 – 0.05 |
| Frauen (Männer = Refernz) | 0.16 *** | 0.11 – 0.21 | 0.10 *** | 0.04 – 0.15 |
| Alter (Mittelwertszentriert, 51 Jahre) | 0.00 | -0.00 – 0.00 | 0.00 | -0.00 – 0.00 |
| Mittlere Bildung | -0.10 ** | -0.17 – -0.04 | -0.07 | -0.14 – 0.01 |
| hohe Bildung | -0.05 | -0.11 – 0.02 | 0.02 | -0.06 – 0.09 |
| Einkommen | -0.28 *** | -0.34 – -0.22 | -0.35 *** | -0.42 – -0.28 |
| politische Teilhabe (System) | 0.98 *** | 0.95 – 1.01 | 0.63 *** | 0.59 – 0.66 |
| Katholizismus | -0.08 | -0.33 – 0.17 | -0.01 | -0.28 – 0.27 |
| Protestantismus | -0.03 | -0.29 – 0.23 | -0.01 | -0.29 – 0.28 |
| Orthodoxie | -0.06 | -0.33 – 0.22 | -0.28 | -0.58 – 0.02 |
| andere Form von Christentum | -0.10 | -0.39 – 0.19 | -0.17 | -0.49 – 0.16 |
| Judentum | 0.20 | -0.45 – 0.85 | -0.08 | -0.80 – 0.64 |
| Islam | 0.58 *** | 0.31 – 0.85 | 0.39 * | 0.09 – 0.69 |
| EU-Beitritt nach oder 2004 | 0.06 | -0.53 – 0.65 | -0.16 | -1.41 – 1.10 |
| EU-Beitritt vor 2004 | -0.01 | -0.52 – 0.49 | -0.14 | -1.25 – 0.98 |
| Gini | -0.06 ** | -0.10 – -0.02 | 0.03 | -0.03 – 0.09 |
| Random Effects | ||||
| σ2 | 3.39 | 4.16 | ||
| τ00 | 3.63 cntry | 6.97 cntry | ||
| τ11 | 0.07 cntry.corruption | 0.15 cntry.corruption | ||
| ρ01 | -1.00 cntry | -1.00 cntry | ||
| ICC | 0.06 | 0.08 | ||
| N | 22 cntry | 22 cntry | ||
| Observations | 22281 | 22281 | ||
| Marginal R2 / Conditional R2 | 0.295 / 0.335 | 0.184 / 0.248 | ||
| Deviance | 90457.295 | 95043.481 | ||
| AIC | 90580.672 | 95158.557 | ||
|
||||