Data from Busola Electorala between 11 Nov 2016 - 10 December 2016
This document provides descriptive statistics, offering an overwiew of the data we collected through https://pressone.ro/busola/.
In the top right, there’s a button called Code. If you press Hide All Code, the R code will disappear and you are left with the results. I suggest doing that, it’s easier to read.
library(foreign)
library(ggplot2)
options(digits=2)
ro <- read.csv("C:/Users/poppr/Desktop/Romania data 2016.csv", header = TRUE)
First things first: we want to know how many people went through all 30 statements. We discard the others.
ro <- subset(ro, answered_all_statements != 0)
length(ro$answered_all_statements)
[1] 15022
That leaves us with 15.022 people who were able to see their position in the political landscape after going through all statements. You can your position even if you fill out the tool partially, but the results won’t be accurate.
All the analysis from now on is based on this sample of 15.022.
Let’s see where the users come from:
This is additional data we collect, not asked in the survey
ro$country[ro$country==""] <- NA
prop.table(table(ro$country)) * 100
Algeria Angola Australia Austria
0.0000 0.0067 0.0067 0.0400 0.3068
Belarus Belgium Bosnia and Herzegovina Brazil Bulgaria
0.0067 0.7536 0.0000 0.0067 0.0600
Cambodia Cameroon Canada Cape Verde Colombia
0.0000 0.0067 0.2401 0.0067 0.0133
Croatia Cyprus Czech Republic Denmark Finland
0.0133 0.0067 0.0800 0.3001 0.0267
France Germany Greece Guernsey Hong Kong
0.7669 1.4138 0.0000 0.0067 0.0133
Hungary Iceland India Indonesia Ireland
0.2401 0.0133 0.0467 0.0067 0.1000
Israel Italy Japan Lebanon Liberia
0.0133 0.3401 0.0133 0.0067 0.0067
Liechtenstein Luxembourg Macedonia Malaysia Malta
0.0067 0.0734 0.0133 0.0067 0.0133
Mexico Monaco Morocco Netherlands Nigeria
0.0067 0.0067 0.0133 0.5068 0.0200
Norway Oman Peru Poland Portugal
0.0467 0.0067 0.0067 0.0800 0.0934
Puerto Rico Qatar Republic of Korea Republic of Lithuania Republic of Moldova
0.0067 0.0133 0.0067 0.0200 0.0734
Romania Saudi Arabia Serbia Singapore Slovak Republic
89.9166 0.0000 0.0400 0.0267 0.0200
Slovenia South Sudan Spain Sri Lanka Sweden
0.0200 0.0067 0.2934 0.0067 0.1801
Switzerland Taiwan Thailand Turkey Ukraine
0.1467 0.0067 0.0133 0.0200 0.0200
United Arab Emirates United Kingdom United States unknown Venezuela
0.0200 2.0874 0.9270 0.3401 0.0067
Vietnam
0.0133
Let’s have a look at the demographics. We ask these questions in the beginning of the tool, and quite a few people fill in this information. The variables are collected separatelly for people who took the survey on their phone, that’s why there are two variables for gender. You need to look at the last 2 rows, where coded 0 are females, code 1 are males.
ro$male <- ifelse(ro$background_question_0==0, 1,
ifelse(ro$background_question_0==1, 0,
NA))
ro$malem <- ifelse(ro$background_question_1_is_mobile==0, 1,
ifelse(ro$background_question_1_is_mobile==1, 0,
NA))
ro$male[is.na(ro$male)] <- ro$malem[is.na(ro$male)]
prop.table(table(ro$male)) * 100
0 1
31 69
So there are 69% (4953) men and 31% (2263) women. This is quite normal, as men are more interested in politics than women.
Next, age. I’ll create age categories, 18-29 coded 1, 30-49 coded 2, 50-64 coded 3 and 65+ coded 4
ro$age <- 2016 - (ro$background_question_2 + 1910)
ro$age[ro$age < 18] <- NA
ro$age[ro$age >= 18 & ro$age <= 29] <- 1
ro$age[ro$age >= 30 & ro$age <= 49] <- 2
ro$age[ro$age >= 50 & ro$age <= 64] <- 3
ro$age[ro$age >= 65] <- 4
ro$agea <- 2016 - (ro$background_question_3_is_mobile + 1910)
ro$agea[ro$agea < 18] <- NA
ro$agea[ro$agea >= 18 & ro$agea <= 29] <- 1
ro$agea[ro$agea >= 30 & ro$agea <= 49] <- 2
ro$agea[ro$agea >= 50 & ro$agea <= 64] <- 3
ro$agea[ro$agea >= 65] <- 4
ro$age[is.na(ro$age)] <- ro$agea[is.na(ro$age)]
prop.table(table(ro$age)) * 100
1 2 3 4
43.2 44.3 9.0 3.4
I can make smaller age brackets if needed.
We move on to education 0 - no education, 1 - elementary school, 2 - high school, 3 - university degree, master and PhD, 4 - post doctoral studies
ro$edu <- ifelse(ro$background_question_4==0, 0,
ifelse(ro$background_question_4==1, 1,
ifelse(ro$background_question_4==2, 2,
ifelse(ro$background_question_4==4, 4,
ifelse(ro$background_question_4=="Facultate\nMasterat/Doctorat", 3,
ifelse(ro$background_question_4=="Posztgraduális végzettség ", 4,
NA))))))
ro$edum <- ifelse(ro$background_question_5_is_mobile==0, 0,
ifelse(ro$background_question_5_is_mobile==1, 1,
ifelse(ro$background_question_5_is_mobile==2, 2,
ifelse(ro$background_question_5_is_mobile==4, 4,
ifelse(ro$background_question_5_is_mobile=="Facultate\nMasterat/Doctorat", 3,
ifelse(ro$background_question_5_is_mobile=="Posztgraduális végzettség ", 4,
NA))))))
ro$edu[is.na(ro$edu)] <- ro$edum[is.na(ro$edu)]
table(ro$edu)
0 1 2 3 4
23 107 1570 4847 483
prop.table(table(ro$edu)) * 100
0 1 2 3 4
0.33 1.52 22.33 68.95 6.87
As expected, mostly highly educated people.
Now, we can see the city where people intend to vote (for this type of election, you can only vote in the electoral circumscription you belong to, which is usually the hometown)
ro$location <- 0
ro$location[is.na(ro$background_question_8)] <- NA # overwrite 0's with NA's if background_question_8 is NA
ro$location[ro$background_question_8==0] <- "Alba"
ro$location[ro$background_question_8==1] <- "Arad"
ro$location[ro$background_question_8==2] <- "Arges"
ro$location[ro$background_question_8==3] <- "Bacau"
ro$location[ro$background_question_8==4] <- "Bihor"
ro$location[ro$background_question_8==5] <- "Bistrita-Nasaud"
ro$location[ro$background_question_8==6] <- "Botosani"
ro$location[ro$background_question_8==7] <- "Brasov"
ro$location[ro$background_question_8==8] <- "Braila"
ro$location[ro$background_question_8==9] <- "Bucuresti"
ro$location[ro$background_question_8==10] <- "Buzau"
ro$location[ro$background_question_8==11] <- "Caras-Severin"
ro$location[ro$background_question_8==12] <- "Calarasi"
ro$location[ro$background_question_8==13] <- "Cluj"
ro$location[ro$background_question_8==14] <- "Constanta"
ro$location[ro$background_question_8==15] <- "Covasna"
ro$location[ro$background_question_8==16] <- "Dambovita"
ro$location[ro$background_question_8==17] <- "Dolj"
ro$location[ro$background_question_8==18] <- "Galati"
ro$location[ro$background_question_8==19] <- "Giurgiu"
ro$location[ro$background_question_8==20] <- "Gorj"
ro$location[ro$background_question_8==21] <- "harghita"
ro$location[ro$background_question_8==22] <- "Hunedoara"
ro$location[ro$background_question_8==23] <- "Ialomita"
ro$location[ro$background_question_8==24] <- "Iasi"
ro$location[ro$background_question_8==25] <- "Ilfov"
ro$location[ro$background_question_8==26] <- "Maramures"
ro$location[ro$background_question_8==27] <- "Mehendinti"
ro$location[ro$background_question_8==28] <- "Mures"
ro$location[ro$background_question_8==29] <- "Neamt"
ro$location[ro$background_question_8==30] <- "Olt"
ro$location[ro$background_question_8==31] <- "Prahova"
ro$location[ro$background_question_8==32] <- "Satu Mare"
ro$location[ro$background_question_8==33] <- "Salaj"
ro$location[ro$background_question_8==34] <- "Sibiu"
ro$location[ro$background_question_8==35] <- "Suceava"
ro$location[ro$background_question_8==36] <- "Teleorman"
ro$location[ro$background_question_8==37] <- "Timis"
ro$location[ro$background_question_8==38] <- "Tulcea"
ro$location[ro$background_question_8==39] <- "Vaslui"
ro$location[ro$background_question_8==40] <- "Valcea"
ro$location[ro$background_question_8==41] <- "Vrancea"
ro$location[ro$background_question_8==42] <- "Strainatate"
ro$locationm <- 0
ro$locationm[is.na(ro$background_question_9_is_mobile)] <- NA # overwrite 0's with NA's if background_question_8 is NA
ro$locationm[ro$background_question_9_is_mobile==0] <- "Alba"
ro$locationm[ro$background_question_9_is_mobile==1] <- "Arad"
ro$locationm[ro$background_question_9_is_mobile==2] <- "Arges"
ro$locationm[ro$background_question_9_is_mobile==3] <- "Bacau"
ro$locationm[ro$background_question_9_is_mobile==4] <- "Bihor"
ro$locationm[ro$background_question_9_is_mobile==5] <- "Bistrita-Nasaud"
ro$locationm[ro$background_question_9_is_mobile==6] <- "Botosani"
ro$locationm[ro$background_question_9_is_mobile==7] <- "Brasov"
ro$locationm[ro$background_question_9_is_mobile==8] <- "Braila"
ro$locationm[ro$background_question_9_is_mobile==9] <- "Bucuresti"
ro$locationm[ro$background_question_9_is_mobile==10] <- "Buzau"
ro$locationm[ro$background_question_9_is_mobile==11] <- "Caras-Severin"
ro$locationm[ro$background_question_9_is_mobile==12] <- "Calarasi"
ro$locationm[ro$background_question_9_is_mobile==13] <- "Cluj"
ro$locationm[ro$background_question_9_is_mobile==14] <- "Constanta"
ro$locationm[ro$background_question_9_is_mobile==15] <- "Covasna"
ro$locationm[ro$background_question_9_is_mobile==16] <- "Dambovita"
ro$locationm[ro$background_question_9_is_mobile==17] <- "Dolj"
ro$locationm[ro$background_question_9_is_mobile==18] <- "Galati"
ro$locationm[ro$background_question_9_is_mobile==19] <- "Giurgiu"
ro$locationm[ro$background_question_9_is_mobile==20] <- "Gorj"
ro$locationm[ro$background_question_9_is_mobile==21] <- "harghita"
ro$locationm[ro$background_question_9_is_mobile==22] <- "Hunedoara"
ro$locationm[ro$background_question_9_is_mobile==23] <- "Ialomita"
ro$locationm[ro$background_question_9_is_mobile==24] <- "Iasi"
ro$locationm[ro$background_question_9_is_mobile==25] <- "Ilfov"
ro$locationm[ro$background_question_9_is_mobile==26] <- "Maramures"
ro$locationm[ro$background_question_9_is_mobile==27] <- "Mehendinti"
ro$locationm[ro$background_question_9_is_mobile==28] <- "Mures"
ro$locationm[ro$background_question_9_is_mobile==29] <- "Neamt"
ro$locationm[ro$background_question_9_is_mobile==30] <- "Olt"
ro$locationm[ro$background_question_9_is_mobile==31] <- "Prahova"
ro$locationm[ro$background_question_9_is_mobile==32] <- "Satu Mare"
ro$locationm[ro$background_question_9_is_mobile==33] <- "Salaj"
ro$locationm[ro$background_question_9_is_mobile==34] <- "Sibiu"
ro$locationm[ro$background_question_9_is_mobile==35] <- "Suceava"
ro$locationm[ro$background_question_9_is_mobile==36] <- "Teleorman"
ro$locationm[ro$background_question_9_is_mobile==37] <- "Timis"
ro$locationm[ro$background_question_9_is_mobile==38] <- "Tulcea"
ro$locationm[ro$background_question_9_is_mobile==39] <- "Vaslui"
ro$locationm[ro$background_question_9_is_mobile==40] <- "Valcea"
ro$locationm[ro$background_question_9_is_mobile==41] <- "Vrancea"
ro$locationm[ro$background_question_9_is_mobile==42] <- "Strainatate"
ro$location[is.na(ro$location)] <- ro$locationm[is.na(ro$location)]
table(ro$location)
Alba Arad Arges Bacau Bihor Bistrita-Nasaud Botosani Braila
133 107 95 98 162 61 40 38
Brasov Bucuresti Buzau Calarasi Caras-Severin Cluj Constanta Covasna
230 2464 84 34 35 753 202 18
Dambovita Dolj Galati Giurgiu Gorj harghita Hunedoara Ialomita
68 94 105 26 43 36 83 39
Iasi Ilfov Maramures Mehendinti Mures Neamt Olt Prahova
342 154 61 41 96 62 35 155
Salaj Satu Mare Sibiu Strainatate Suceava Teleorman Timis Tulcea
56 39 143 398 94 53 355 39
Valcea Vaslui Vrancea
51 46 52
There are 398 people who will vote abroad. now it’s a small sample, maybe later is worth doing some sort of analysis on them.
We break down the location according to regions (NUTS2). I am doing this because the ultimate goal is to weight the data (using census data, trying to make the data more representative)
ro$regiune <- 0
ro$regiune[is.na(ro$location)] <- NA # overwrite 0's with NA's if background_question_8 is NA
# Nord-Vest - RO11; Bihor, Bistrita-Nasaud, Cluj, Maramures, Satu Mare, Salaj
ro$regiune[ro$location=="Bihor"] <- "RO11"
ro$regiune[ro$location=="Cluj"] <- "RO11"
ro$regiune[ro$location=="Bistrita-Nasaud"]<-"RO11"
ro$regiune[ro$location=="Maramures"] <- "RO11"
ro$regiune[ro$location=="Satu Mare"] <- "RO11"
ro$regiune[ro$location=="Salaj"] <- "RO11"
# Centru - RO12; Alba, Brasov, Covasna, Harghita, Mures, Sibiu
ro$regiune[ro$location=="Alba"] <- "RO12"
ro$regiune[ro$location=="Brasov"] <- "RO12"
ro$regiune[ro$location=="Covasna"] <- "RO12"
ro$regiune[ro$location=="Harghita"] <- "RO12"
ro$regiune[ro$location=="Mures"] <- "RO12"
ro$regiune[ro$location=="Sibiu"] <- "RO12"
# Nord-Est - RO21; Bacau, Botosani, Iasi, Neamt, Suceava, Vaslui
ro$regiune[ro$location=="Bacau"] <- "RO21"
ro$regiune[ro$location=="Botosani"] <- "RO21"
ro$regiune[ro$location=="Iasi"] <- "RO21"
ro$regiune[ro$location=="Neamt"] <- "RO21"
ro$regiune[ro$location=="Suceava"] <- "RO21"
ro$regiune[ro$location=="Vaslui"] <- "RO21"
# Sud-Est - RO22; Braila, Buzau, Constanta, Galati, Tulcea, Vrancea
ro$regiune[ro$location=="Braila"] <- "RO22"
ro$regiune[ro$location=="Buzau"] <- "RO22"
ro$regiune[ro$location=="Constanta"] <- "RO22"
ro$regiune[ro$location=="Galati"] <- "RO22"
ro$regiune[ro$location=="Tulcea"] <- "RO22"
ro$regiune[ro$location=="Vrancea"] <- "RO22"
# Sud - Muntenia - RO31; Arges, Calarasi, Dambovita, Giurgiu, Ialomita, Prahova, Teleorman
ro$regiune[ro$location=="Arges"] <- "RO31"
ro$regiune[ro$location=="Calarasi"] <- "RO31"
ro$regiune[ro$location=="Dambovita"] <- "RO31"
ro$regiune[ro$location=="Giurgiu"] <- "RO31"
ro$regiune[ro$location=="Ialomita"] <- "RO31"
ro$regiune[ro$location=="Prahova"] <- "RO31"
ro$regiune[ro$location=="Teleorman"] <- "RO31"
# Bucuresti - Ilfov - RO32; Bucuresti, Ilfov
ro$regiune[ro$location=="Bucuresti"] <- "RO32"
ro$regiune[ro$location=="Ilfov"] <- "RO32"
# Sud-Vest Oltenia - RO41; Dolj, Gorj, Mehedinti, Olt, Valcea
ro$regiune[ro$location=="Dolj"] <- "RO41"
ro$regiune[ro$location=="Gorj"] <- "RO41"
ro$regiune[ro$location=="Mehedinti"] <- "RO41"
ro$regiune[ro$location=="Olt"] <- "RO41"
ro$regiune[ro$location=="Valcea"] <- "RO41"
# Vest - RO42; Arad, Caras-Severin, Hunedoara, Timis
ro$regiune[ro$location=="Arad"] <- "RO42"
ro$regiune[ro$location=="Caras-Severin"]<-"RO42"
ro$regiune[ro$location=="Hunedoara"] <- "RO42"
ro$regiune[ro$location=="Timis"] <- "RO42"
# strainatate = abroad
ro$regiune[ro$location=="Strainatate"] <- "abroad"
ro$regiune[ro$regiune==0] <- NA
table(ro$regiune)
abroad RO11 RO12 RO21 RO22 RO31 RO32 RO41
After we have an idea about who the users are and where they come from, let’s look into their political affilition. Here we see for which coalition they voted for in the last parliamentary elections of 2012. Here we miss quite a few users, because they dont remember who they voted for (tipically).
ro$voterec <- 0
ro$voterec[is.na(ro$background_question_10)] <- NA
ro$voterec <- ifelse(ro$background_question_10==0, "USL",
ifelse(ro$background_question_10==1, "ARD",
ifelse(ro$background_question_10==2, "PPDD",
ifelse(ro$background_question_10==3, "UDMR",
ifelse(ro$background_question_10==4, "other",
ifelse(ro$background_question_10==6, "did not vote",
NA))))))
ro$voterecm <- 0
ro$voterecm[is.na(ro$background_question_11_is_mobile)] <- NA
ro$voterecm <- ifelse(ro$background_question_11_is_mobile==0, "USL",
ifelse(ro$background_question_11_is_mobile==1, "ARD",
ifelse(ro$background_question_11_is_mobile==2, "PPDD",
ifelse(ro$background_question_11_is_mobile==3, "UDMR",
ifelse(ro$background_question_11_is_mobile==4, "other",
ifelse(ro$background_question_11_is_mobile==6, "did not vote",
NA))))))
ro$voterec[is.na(ro$voterec)] <- ro$voterecm[is.na(ro$voterec)]
voterec <- ro[c("voterec")]
voterec <- na.omit(voterec)
voterec$voterec <- factor(voterec$voterec, c("ARD", "PPDD", "UDMR", "USL", "other", "did not vote"))
require(scales)
ggplot(voterec, aes(x = factor(voterec))) + geom_bar(stat = "count", fill="darkblue", colour="black") + labs(title = "Vot la alegerile parlamentare 2012", x="") + theme_minimal()
prop.table(table(voterec$voterec)) * 100
ARD PPDD UDMR USL other did not vote
16.1 1.7 2.9 33.5 14.4 31.4
We can see who they intend to vote for, which is quite exciting
library(ggplot2)
ro$voteint <- ifelse(ro$popup_question_6==0, "PSD",
ifelse(ro$popup_question_6==1, "ALDE",
ifelse(ro$popup_question_6==2, "PNL",
ifelse(ro$popup_question_6==3, "UDMR",
ifelse(ro$popup_question_6==4, "USR",
ifelse(ro$popup_question_6==5, "other",
NA))))))
voteint <- ro[c("voteint")]
voteint <- na.omit(voteint)
voteint$voteint <- factor(voteint$voteint, c("ALDE", "PNL", "PSD", "UDMR", "USR", "other"))
ggplot(voteint, aes(x = factor(voteint))) + geom_bar(stat = "count", fill="darkblue", colour="black") + labs(title = "Intentie de vot la alegerile parlamentare 2016", x="") + theme_minimal()
prop.table(table(voteint$voteint)) * 100
ALDE PNL PSD UDMR USR other
5.2 16.4 9.5 2.2 64.6 2.1
1 means “Completely dissagree, 3,”Neither agree nor disagree“, 5”“Completely agree”, -1 “No opinion”
Free market makes the health system to function better
Competitia economica libera face sistemul de sanatate sa functioneze mai eficient
ro$statement_0[ro$statement_0=="-1"] <- NA
prop.table(table(ro$statement_0)) * 100
1 2 3 4 5
5.1 13.3 23.1 39.2 19.3
The number of employees in the public sector should be reduced
Numarul angajatilor din sectorul public ar trebui redus
ro$statement_1[ro$statement_1=="-1"] <- NA
prop.table(table(ro$statement_1)) * 100
1 2 3 4 5
4.4 11.5 15.8 35.0 33.4
The state should intervene in the economy as little as possible
Statul ar trebui sa intervina cat mai putin posibil in economie
ro$statement_2[ro$statement_2=="-1"] <- NA
prop.table(table(ro$statement_2)) * 100
1 2 3 4 5
7.2 20.3 21.8 33.6 17.1
Romania should adopt a progressive taxation system
Romania ar trebui sa adopte un sistem de taxare progresiva
ro$statement_3[ro$statement_3=="-1"] <- NA
prop.table(table(ro$statement_3)) * 100
1 2 3 4 5
11 17 15 39 18
Foreign investors are a threat to Romania’s national sovereignty
Investitorii straini sunt o amenintare la suveranitatea nationala a Romaniei
ro$statement_4[ro$statement_4=="-1"] <- NA
prop.table(table(ro$statement_4)) * 100
1 2 3 4 5
47.1 29.5 12.6 6.8 3.9
VTA should be reduced under 20%
TVA trebuie redus sub pragul de 20%
ro$statement_5[ro$statement_5=="-1"] <- NA
prop.table(table(ro$statement_5)) * 100
1 2 3 4 5
2.0 7.7 23.8 41.7 24.9
Romania should never adopt the euro
Romania ar trebui sa nu adopte niciodata moneda Euro
ro$statement_6[ro$statement_6=="-1"] <- NA
prop.table(table(ro$statement_6)) * 100
1 2 3 4 5
26.6 29.7 21.8 12.8 9.1
International actors (such as EU or USA) have the right to intervene in Romania’s internal affairs if the state of democracy is threatend
Partenerii internationali (precum UE sau SUA) pot interveni in afacerile interne ale Romaniei atunci cand exista o amenintare la adresa democratiei
ro$statement_7[ro$statement_7=="-1"] <- NA
prop.table(table(ro$statement_7)) * 100
1 2 3 4 5
15 19 15 37 14
The strategic partnership with USA is essential for Romania’s national security
Parteneriatul strategic cu SUA este esential pentru securitatea nationala
ro$statement_8[ro$statement_8=="-1"] <- NA
prop.table(table(ro$statement_8)) * 100
1 2 3 4 5
4.0 6.5 16.6 42.0 30.9
Women should be able to decide on any matters related to abortion
Femeile ar trebui sa aiba libertatea de a decide asupra chestiunilor legate de avort
ro$statement_9[ro$statement_9=="-1"] <- NA
prop.table(table(ro$statement_9)) * 100
1 2 3 4 5
3.3 3.3 5.5 26.6 61.2
Romania should not receive refugees that try to enter the EU
Romania ar trebui sa accepte mai multi migranti care intra in UE, ca semn de solidaritate
ro$statement_10[ro$statement_10=="-1"] <- NA
prop.table(table(ro$statement_10)) * 100
1 2 3 4 5
21.8 21.9 25.1 21.3 9.8
Gay couples should have the same rights as the heterosexual ones
Cuplurile homosexuale ar trebui sa se bucure de aceleasi drepturi ca si cuplurile heterosexuale
library(ggplot2)
table(ro$statement_11)
-1 1 2 3 4 5
178 2433 1580 1918 3082 5831
ro$statement_11[ro$statement_11=="-1"] <- NA
ro$statement_11[ro$statement_11=="1"] <- "Total impotriva"
ro$statement_11[ro$statement_11=="2"] <- "Impotriva"
ro$statement_11[ro$statement_11=="3"] <- "Neutru"
ro$statement_11[ro$statement_11=="4"] <- "De acord"
ro$statement_11[ro$statement_11=="5"] <- "Total de acord"
ro$statement_11 <- factor(ro$statement_11, c("Total impotriva", "Impotriva", "Neutru", "De acord", "Total de acord"))
ggplot(ro, aes(x = factor(statement_11))) + geom_bar(stat = "count", fill="darkblue", colour="black") + labs(title = "Cuplurile homosexuale ar trebui \n sa se bucure de aceleasi drepturi ca si cuplurile heterosexuale", x = "", y = "Numar utilizatori") + theme_minimal()
Smoking should be prohibited in all the public places, even the open-space ones
Fumatul trebuie interzis in toate locurile publice, chiar si cele deschise
ro$statement_12[ro$statement_12=="-1"] <- NA
prop.table(table(ro$statement_12)) * 100
1 2 3 4 5
16 25 17 19 22
Immigrants should adopt the values and culture of Romania
Imigrantii ar trebui sa se adapteze la valorile si cultura Romaniei
ro$statement_13[ro$statement_13=="-1"] <- NA
prop.table(table(ro$statement_13)) * 100
1 2 3 4 5
2.1 5.9 14.6 39.7 37.7
Romania should pursue state unification with Moldova
Romania ar trebui sa urmareasca reunificarea statala cu Republica Moldova
ro$statement_14[ro$statement_14=="-1"] <- NA
prop.table(table(ro$statement_14)) * 100
1 2 3 4 5
13 18 30 22 16
A territorial reform should include the creation of an autonomous Hungarian region
O reforma teritoriala ar trebui sa includa crearea unei regiuni maghiare autonome
ro$statement_15[ro$statement_15=="-1"] <- NA
prop.table(table(ro$statement_15)) * 100
1 2 3 4 5
49.8 29.5 12.6 5.3 2.8
ro$statement_15[ro$statement_15=="1"] <- "Total impotriva"
ro$statement_15[ro$statement_15=="2"] <- "Impotriva"
ro$statement_15[ro$statement_15=="3"] <- "Neutru"
ro$statement_15[ro$statement_15=="4"] <- "De acord"
ro$statement_15[ro$statement_15=="5"] <- "Total de acord"
ro$statement_15 <- factor(ro$statement_15, c("Total impotriva", "Impotriva", "Neutru", "De acord", "Total de acord"))
ggplot(ro, aes(x = factor(statement_15))) + geom_bar(stat = "count", fill="darkblue", colour="black") + labs(title = "O reforma teritoriala ar trebui sa includa \n crearea unei regiuni maghiare autonome", x = "", y = "Numar utilizatori")+ theme_minimal()
The state should give privileged status to the orthodox church
Statul ar trebui sa acorde un statut privilegiat Bisericii Ortodoxe
ro$statement_16[ro$statement_16=="-1"] <- NA
prop.table(table(ro$statement_16)) * 100
1 2 3 4 5
66.9 19.6 7.9 3.6 2.0
ro$statement_16[ro$statement_16=="1"] <- "Total impotriva"
ro$statement_16[ro$statement_16=="2"] <- "Impotriva"
ro$statement_16[ro$statement_16=="3"] <- "Neutru"
ro$statement_16[ro$statement_16=="4"] <- "De acord"
ro$statement_16[ro$statement_16=="5"] <- "Total de acord"
ro$statement_16 <- factor(ro$statement_16, c("Total impotriva", "Impotriva", "Neutru", "De acord", "Total de acord"))
ggplot(ro, aes(x = factor(statement_16))) + geom_bar(stat = "count", fill="darkblue", colour="black") + labs(title = "Statul ar trebui sa acorde un statut privilegiat Bisericii Ortodoxe", x = "", y = "Numar utilizatori")+ theme_minimal()
The electoral treshold should be lowered, so smaller parties can gain access to the parliament
Pragul electoral ar trebui redus pentru a permite intrarea partidelor mai mici în parlament
ro$statement_17[ro$statement_17=="-1"] <- NA
prop.table(table(ro$statement_17)) * 100
1 2 3 4 5
9.8 15.4 14.5 33.4 26.9
The electoral reform should include lowering the number of signatures needed for candidacy for all election types
Numarul de semnaturi pentru candidatura la toate tipurile de alegeri ar trebui redus
ro$statement_18[ro$statement_18=="-1"] <- NA
prop.table(table(ro$statement_18)) * 100
1 2 3 4 5
6.8 12.2 14.4 33.2 33.4
The number of polling stations for diaspora should be increased for all election types
Numarul de sectii de votare in diaspora trebuie marit pentru toate tipurile de alegeri
ro$statement_19[ro$statement_19=="-1"] <- NA
prop.table(table(ro$statement_19)) * 100
1 2 3 4 5
2.7 4.3 9.3 35.1 48.7
The postal vote should be introduced for all election types
Votul prin corespondenta ar trebui introdus pentru toate tipurile de alegeri
ro$statement_20[ro$statement_20=="-1"] <- NA
prop.table(table(ro$statement_20)) * 100
1 2 3 4 5
3.2 5.1 8.8 32.8 50.1
The digitalization of the judicial process should be continued by publishing on-line all the decisions
Digitalizarea procesului judiciar trebuie continuata prin publicarea on-line a tuturor hotararilor judecatoresti
ro$statement_21[ro$statement_21=="-1"] <- NA
prop.table(table(ro$statement_21)) * 100
1 2 3 4 5
0.63 1.16 3.84 33.49 60.89
Government’s public information must be accessible online
Informatiile publice ale guvernului ar trebui sa fie accesibile on-line
ro$statement_22[ro$statement_22=="-1"] <- NA
prop.table(table(ro$statement_22)) * 100
1 2 3 4 5
0.33 0.29 0.93 26.71 71.74
The open vote should be introduced for all decisions made in the parliament
Votul deschis trebuie introdus pentru toate deciziile luate in Parlament
ro$statement_23[ro$statement_23=="-1"] <- NA
prop.table(table(ro$statement_23)) * 100
1 2 3 4 5
1.0 4.0 7.9 29.2 57.8
Politicians prosecuted for corruption should give up any public function
Politicienii urmariti penal pentru fapte de coruptie trebuie sa renunte la orice functie publica
ro$statement_24[ro$statement_24=="-1"] <- NA
prop.table(table(ro$statement_24)) * 100
1 2 3 4 5
2.9 5.5 6.7 16.5 68.4
MPs should enjoy immunity rights only for votes and declarations
Parlamentarii ar trebui sa aiba imunitate doar pentru voturi si declaratii
ro$statement_25[ro$statement_25=="-1"] <- NA
prop.table(table(ro$statement_25)) * 100
1 2 3 4 5
3.8 5.0 8.9 30.2 52.1
Governments formed exclusivelly from non-partisan tehnocrats work better than those formed from politicians
Guvernele formate exclusiv din tehnocrati neafiliati politic functioneaza mai bine decat cele formate din politicieni
ro$statement_26[ro$statement_26=="-1"] <- NA
prop.table(table(ro$statement_26)) * 100
1 2 3 4 5
10.5 9.6 26.1 28.5 25.3
Prosecutors have too much power in prosecuting citizens
Procurorii au prea multa putere în ceea ce priveste anchetarea cetatenilor
ro$statement_27[ro$statement_27=="-1"] <- NA
prop.table(table(ro$statement_27)) * 100
1 2 3 4 5
12.3 27.2 34.8 17.0 8.7
The Mechanism of Cooperation and Verification, which tracks progress in the judiciary system reform should be maintained
Mecanismul de Cooperare si Verificare, prin care se verifica progresele in reformarea justitiei, ar trebui inlaturat
ro$statement_28[ro$statement_28=="-1"] <- NA
prop.table(table(ro$statement_28)) * 100
1 2 3 4 5
23.7 35.0 26.6 9.6 5.1
Romania should work on strengthening its diplomatic relations with Rusia
Romania ar trebui sa isi consolideze relatiile diplomatice cu Rusia
ro$statement_29[ro$statement_29=="-1"] <- NA
prop.table(table(ro$statement_29)) * 100
1 2 3 4 5
11.3 14.1 31.5 35.3 7.8
Interest in politics 0 very much, 3 not at all
ro$popup_question_2[ro$popup_question_2==4] <- NA
prop.table(table(ro$popup_question_2)) * 100
0 1 2 3
51.0 39.3 7.9 1.8
Left-right self-positioning, 0 left 10 right
ro$popup_question_3[ro$popup_question_3==11] <- NA
ro$popup_question_3[ro$popup_question_3==12] <- NA
prop.table(table(ro$popup_question_3)) * 100
0 1 2 3 4 5 6 7 8 9 10
3.3 1.9 2.4 4.9 5.4 16.4 9.9 17.5 18.0 6.5 13.7
Evaluation of Ciolos’ government performance 0 very good, 4 very bad, 5 don’t know
prop.table(table(ro$popup_question_4)) * 100
0 1 2 3 4 5
40.13 41.19 3.65 0.92 8.89 5.22
We can do stacked barplots, looking at age and positions on statements, like this example on the statement on gay marriage
toplot2 <- table(ro$age, ro$statement_11)
toplot2 <- ro[c(67, 109)]
toplot2$age[toplot2$age=="1"] <- "18-29"
toplot2$age[toplot2$age=="2"] <- "30-49"
toplot2$age[toplot2$age=="3"] <- "50-64"
toplot2$age[toplot2$age=="4"] <- "65+"
toplot2$statement_11[toplot2$statement_11=="1"] <- "Total impotriva"
toplot2$statement_11[toplot2$statement_11=="2"] <- "Impotriva"
toplot2$statement_11[toplot2$statement_11=="3"] <- "Neutru"
toplot2$statement_11[toplot2$statement_11=="4"] <- "De acord"
toplot2$statement_11[toplot2$statement_11=="5"] <- "Total de acord"
toplot2$statement_11 <- factor(toplot2$statement_11, c("Total impotriva", "Impotriva", "Neutru", "De acord", "Total de acord"))
toplot2 <- na.omit(toplot2)
library(ggplot2)
library(plyr)
library(reshape2)
library(gridExtra)
k <- ggplot(toplot2, aes(statement_11, fill=age))
k + geom_bar() + scale_fill_brewer() + labs(title = "Cuplurile homosexuale ar trebui \n sa se bucure de aceleasi drepturi ca si cuplurile heterosexuale", x = "Opinia utilizatorului", y = "Numar utilizatori") + theme_minimal()
We can have a look at the same statement, on gay marriage, by eduaction
toplot3 <- ro[c(67, 111)]
# rename factor levels age
toplot3$edu[toplot3$edu=="0"] <- "Nu am fost niciodata la scoala"
toplot3$edu[toplot3$edu=="1"] <- "Scoala generala"
toplot3$edu[toplot3$edu=="2"] <- "Liceu sau scoala profesionala"
toplot3$edu[toplot3$edu=="3"] <- "Facultate/Masterat/Doctorat"
toplot3$edu[toplot3$edu=="4"] <- "Studii postuniversitare"
toplot3$edu <- factor(toplot3$edu, c("Nu am fost niciodata la scoala", "Scoala generala", "Liceu sau Scoala profesionala", "Facultate/Masterat/Doctorat", "Studii postuniversitare"))
toplot3$statement_11[toplot3$statement_11=="1"] <- "Total impotriva"
toplot3$statement_11[toplot3$statement_11=="2"] <- "Impotriva"
toplot3$statement_11[toplot3$statement_11=="3"] <- "Neutru"
toplot3$statement_11[toplot3$statement_11=="4"] <- "De acord"
toplot3$statement_11[toplot3$statement_11=="5"] <- "Total de acord"
toplot3$statement_11 <- factor(toplot3$statement_11, c("Total impotriva", "Impotriva", "Neutru", "De acord", "Total de acord"))
toplot3 <- na.omit(toplot3)
l <- ggplot(toplot3, aes(statement_11, fill=edu))
l + geom_bar() + scale_fill_brewer() + labs(title = "Cuplurile homosexuale ar trebui \n sa se bucure de aceleasi drepturi ca si cuplurile heterosexuale", x = "Opinia utilizatorului", y = "Numar utilizatori") + theme_minimal()
And the possibilities are endless! Just tell me what you would like to see in a graph and I’ll do it.
WE can look at the opinions on statements given the user’s political preferences, more precisely the propensity to vote for the parties (I selected PTV > 7, then the party with the maximum value)
ro$PSD <- ifelse(ro$ptv_option_6_question_32 ==7, 7,
ifelse(ro$ptv_option_6_question_32 ==8, 8,
ifelse(ro$ptv_option_6_question_32 ==9, 9,
ifelse(ro$ptv_option_6_question_32 ==10, 10,
NA))))
ro$PNL <- ifelse(ro$ptv_option_7_question_32 ==7, 7,
ifelse(ro$ptv_option_7_question_32 ==8, 8,
ifelse(ro$ptv_option_7_question_32 ==9, 9,
ifelse(ro$ptv_option_7_question_32 ==10, 10,
NA))))
ro$ALDE <- ifelse(ro$ptv_option_8_question_32 ==7, 7,
ifelse(ro$ptv_option_8_question_32 ==8, 8,
ifelse(ro$ptv_option_8_question_32 ==9, 9,
ifelse(ro$ptv_option_8_question_32 ==10, 10,
NA))))
ro$UDMR <- ifelse(ro$ptv_option_9_question_32 ==7, 7,
ifelse(ro$ptv_option_9_question_32 ==8, 8,
ifelse(ro$ptv_option_9_question_32 ==9, 9,
ifelse(ro$ptv_option_9_question_32 ==10, 10,
NA))))
ro$USR <- ifelse(ro$ptv_option_10_question_32 ==7, 7,
ifelse(ro$ptv_option_10_question_32 ==8, 8,
ifelse(ro$ptv_option_10_question_32 ==9, 9,
ifelse(ro$ptv_option_10_question_32 ==10, 10,
NA))))
ro$PMP <- ifelse(ro$ptv_option_11_question_32 ==7, 7,
ifelse(ro$ptv_option_11_question_32 ==8, 8,
ifelse(ro$ptv_option_11_question_32 ==9, 9,
ifelse(ro$ptv_option_11_question_32 ==10, 10,
NA))))
ptv <- ro[c(119:124)]
ptv$ptvmax <- apply(ptv, 1, function(x) names (x) [which.max(x)])
ptv$ptvmax[ptv$ptvmax=="character(0)"] <- NA
ptv <-ptv[,7]
ptv <- data.frame(unlist(ptv))
toplotgay <- cbind(ptv, ro[c(67)])
toplotgay <- na.omit(toplotgay)
require(ggplot2)
ggplot(toplotgay, aes(x = factor(statement_11))) + geom_bar(stat = "count", fill="darkblue", colour="black") + facet_grid(~ unlist.ptv.)+ labs(title = "Cuplurile homosexuale ar trebui \n sa se bucure de aceleasi drepturi ca si cuplurile heterosexuale", x = "1 - Total impotriva, 2 - Impotriva, 3 - Neutru, 4 - De acord, 5 - Total de acord", y = "Numar utilizatori") + theme_minimal() + theme(text = element_text(size=10))
The same approach, different presentation
toplotgay$statement_11[toplotgay$statement_11=="1"] <- "Total impotriva"
toplotgay$statement_11[toplotgay$statement_11=="2"] <- "Impotriva"
toplotgay$statement_11[toplotgay$statement_11=="3"] <- "Neutru"
toplotgay$statement_11[toplotgay$statement_11=="4"] <- "De acord"
toplotgay$statement_11[toplotgay$statement_11=="5"] <- "Total de acord"
toplotgay$statement_11 <- factor(toplotgay$statement_11, c("Total impotriva", "Impotriva", "Neutru", "De acord", "Total de acord"))
p <- ggplot(toplotgay, aes(statement_11, fill=unlist.ptv.))
p + geom_bar() + scale_fill_brewer(palette="Spectral") + labs(title = "Cuplurile homosexuale ar trebui \n sa se bucure de aceleasi drepturi ca si cuplurile heterosexuale", x = "", y = "Numar utilizatori") + guides(fill=guide_legend(title=NULL)) + theme_minimal()