-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2_analyse_BVV_with_strukturdata.R
41 lines (35 loc) · 1.63 KB
/
2_analyse_BVV_with_strukturdata.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
library(tidyverse)
source("0_read_berlin_strukturdaten.R")
source("0_read_berlin_wahldaten.R")
source("election_functions.R")
BVV <- get_BVV_ah() %>% mutate(GRÜNE_p = GRÜNE / Wählende)
struktur <- get_struktur() %>% summarize_across_ah_wahlkreise()
BVV_struktur <- right_join(BVV %>% filter(Jahr == 2023), struktur, by = c("Bezirk", "AH_Wahlkreis"))
#alter
# Rentner
ggplot(BVV_struktur, aes(x = `Einwohner 65 und älter Prozent`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# aes(shape = Bezirk) + scale_shape_manual(values = c(1:10,12,13))
# Boomer
ggplot(BVV_struktur, aes(x = `Deutsche 45 - 60 Anzahl`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# GenX
ggplot(BVV_struktur, aes(x = `Deutsche 35 - 45 Anzahl`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# GenY/Millenlials
ggplot(BVV_struktur, aes(x = `Deutsche 25 - 35 Anzahl`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# GenZ
ggplot(BVV_struktur, aes(x = `Deutsche 18 - 25 Anzahl`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# ausländer/eu/migration
ggplot(BVV_struktur, aes(x = `Ausländer Prozent`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
ggplot(BVV_struktur, aes(x = `Deutsche 16 + Migrationshintergrund Prozent`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# LGTBQ
ggplot(BVV_struktur, aes(x = `Deutsche 18 + Familienstand ELP Prozent`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")
# Arbeitslosenquote (in SGB2)
ggplot(BVV_struktur, aes(x = `Einwohner unter 65 in SGB II 2021 Prozent`, y = GRÜNE_p)) +
geom_point() + geom_smooth(method = "lm")