Ero sivun ”Venäjän vaalit 2011” versioiden välillä

Opasnet Suomista
Siirry navigaatioon Siirry hakuun
pEi muokkausyhteenvetoa
(järjestystä parannettu, selityksiä lisätty)
Rivi 120: Rivi 120:
</rcode>
</rcode>


===Data format===
=== Suoraviivaisia tilastoanalyyseja ===
 
This is an example data. The English version is translated with Google translator and may contain serious mistakes.


<pre>
Tämä analyysi muuttuu vähitellen hienosyisemmäksi kuten etenet sivua alaspäin. Tässä yksinkertaisesti suodatetaan haluttu data ja kuvataan se. Tarkoitus on ladata data Opasnet-kantaan, jolloin voit ajaa analyysit yksinkertaisesti nappia painamalla. Vielä tämä ei toimi, vaan joudut kopioimaan koodin omalle koneellesi ja ajamaan sen R:llä siellä.
The election results
Elections to the State Duma of the Federal Assembly of the Sixth Convocation
Date of vote: 12/04/2011
Name of the Election Commission Babayevskaya
Date and time of signing the protocol 5/12/2011 9:00:00
 
#Column Name Translation of topic
V5 nVoters Number of voters included in voters list
V6 nBallots The number of ballots received by the precinct election commission
V7 nBallotsEarly The number of ballots issued to voters who voted early
V8 nBallotsPolling The number of ballots issued to voters at the polling
V9 nBallotsOutside The number of ballots issued to voters outside the polling station
V10 nBallotsCanceled The number of canceled ballots
V11 nBallotsMobile The number of ballots in mobile ballot boxes
V12 nBallotsStationary The number of ballots in the stationary ballot boxes
V13 nBallotsInvalid Number of invalid ballots
V14 nBallotsValid Number of valid ballots
V15 nAbsBallots The number of absentee ballots received by the precinct election commission
V16 nAbsBallotsPolling The number of absentee ballots issued to voters at a polling station
V17 nAbsBallotsVoted The number of voters who voted with absentee ballots at a polling station
V18 nAbsBallotsUnused The number of the unused absentee ballots
V19 nAbsBallotsTerr The number of absentee ballots issued to voters of the territorial election commission
V20 nAbsBallotsLost Number of lost absentee ballots
V21 nBallotsLost The number of lost ballots
V22 nBallotsNotrec The number of ballots not recorded in obtaining
V23 nVotesJustRussia 1. Political party JUST RUSSIA
V24 nVotesLibDemocr 2. Political Party "Liberal Democratic Party of Russia"
V25 nVotesPatriots 3. Political Party "PATRIOTS OF RUSSIA"
V26 nVotesCommunist 4. Political party "Communist Party of the Russian Federation"
V27 nVotesUniDemocr 5. A political party "Russian United Democratic Party" Yabloko "
V28 nVotesUniRussia 6. All-Russian Political Party "UNITED RUSSIA"
V29 nVotesCaseRight 7. All-Russian Political Party "CASE RIGHT"
</pre>
 
Original text
 
<pre>
Версия для печати
Сводная таблица результатов выборов
Выборы депутатов Государственной Думы Федерального Собрания Российской Федерации шестого созыва
Дата голосования:  04.12.2011
Наименование Избирательной комиссии Бабаевская
Сводная таблица результатов выборов
Сумма
1 Число избирателей, внесенных в список избирателей 18947
2 Число избирательных бюллетеней, полученных участковой избирательной комиссией 17294
3 Число избирательных бюллетеней, выданных избирателям, проголосовавшим досрочно 0
4 Число избирательных бюллетеней, выданных избирателям в помещении для голосования 9001
5 Число избирательных бюллетеней, выданных избирателям вне помещения для голосования 1761
6 Число погашенных избирательных бюллетеней 6532
7 Число избирательных бюллетеней в переносных ящиках для голосования 1761
8 Число избирательных бюллетеней в стационарных ящиках для голосования 8995
9 Число недействительных избирательных бюллетеней 201
10 Число действительных избирательных бюллетеней 10555
11 Число открепительных удостоверений, полученных участковой избирательной комиссией 795
12 Число открепительных удостоверений, выданных избирателям на избирательном участке 549
13 Число избирателей, проголосовавших по открепительным удостоверениям на избирательном участке 346
14 Число погашенных неиспользованных открепительных удостоверений 246
15 Число открепительных удостоверений, выданных избирателям территориальной избирательной комиссией 94
16 Число утраченных открепительных удостоверений 0
17 Число утраченных избирательных бюллетеней 0
18 Число избирательных бюллетеней, не учтенных при получении 0
19 1. Политическая партия СПРАВЕДЛИВАЯ РОССИЯ
20 2. Политическая партия "Либерально-демократическая партия России"
21 3. Политическая партия "ПАТРИОТЫ РОССИИ"
22 4. Политическая партия "Коммунистическая партия Российской Федерации"
23 5. Политическая партия "Российская объединенная демократическая партия "ЯБЛОКО"
24 6. Всероссийская политическая партия "ЕДИНАЯ РОССИЯ"
25 7. Всероссийская политическая партия "ПРАВОЕ ДЕЛО"
</pre>
 
 
===Data handling===
 
Note! The code does not work online, because a data file is needed. This code was used to upload the result version act_id = 3437.
 
<rcode>
library(OpasnetBaseUtils)
data <- read.table("c:/temp/results.csv", sep=",", header = FALSE)
data <- data[, -c(2,3,4)]
colnames(data) <- c("Region", "nVoters", "nBallots", "nBallotsEarly", "nBallotsPolling", "nBallotsOutside",
"nBallotsCanceled", "nBallotsMobile", "nBallotsStationary", "nBallotsInvalid", "nBallotsValid",
"nAbsBallots", "nAbsBallotsPolling", "nAbsBallotsVoted", "nAbsBallotsUnused", "nAbsBallotsTerr",
"nAbsBallotsLost", "nBallotsLost", "nBallotsNotrec", "nVotesJustRussia", "nVotesLibDemocr",
"nVotesPatriots", "nVotesCommunist", "nVotesUniDemocr", "nVotesUniRussia", "nVotesCaseRight")
nVotes <- data[, 20:26]
nVoters <- data[, 2]
nParty <- 7
nComm <- nrow(data) # 95067
temp <- cbind(nVoters, nVotes)
temp$Comm <- 1:nrow(temp)
head(temp)
temp <- reshape(temp, idvar = "Comm",  times = colnames(temp)[1:(ncol(temp)-1)], timevar = "Parameter",
varying = list(colnames(temp)[1:(ncol(temp)-1)]), v.names = "Result", direction = "long")
head(temp)
op_baseWrite("opasnet_base", temp, ident = "Op_fi2768", name = "Venäjän vaalit 2011", unit = "#", objtype_id = 1, who = "Jouni", acttype = 4)
 
</rcode>
 
=== Straightforward model ===


The analysis programs get progressively more sophisticated as you scroll down the page. This is the simplest analysis model which basically allows you to filter the data and make some nice plots. You can compare the statistics of different parties in different regions of Russia. We will upload the data file into the Opasnet data base so that you can simply run the program by pressing the button below (does not work quite yet! In the meanwhile you can install R on your own computer and download the input data file from the bottom of the page manually.)
The analysis programs get progressively more sophisticated as you scroll down the page. This is the simplest analysis model which basically allows you to filter the data and make some nice plots. You can compare the statistics of different parties in different regions of Russia. We will upload the data file into the Opasnet data base so that you can simply run the program by pressing the button below (does not work quite yet! In the meanwhile you can install R on your own computer and download the input data file from the bottom of the page manually.)
Rivi 357: Rivi 255:


</rcode>
</rcode>
'''Neljän suurimman puolueen kannatusprosentit (x-akseli) eri äänestysalueilla ja äänestysalueiden määrä (y-akseli).


Here is a picture of the 4 biggest parties in Russia. The x-axis shows the percentage of votes cast at the polling station and the y-axis shows the number of polling stations corresponding to the percentage.
Here is a picture of the 4 biggest parties in Russia. The x-axis shows the percentage of votes cast at the polling station and the y-axis shows the number of polling stations corresponding to the percentage.


[[Image:comp_4_parties_all.png|center|400x240px]]
[[Image:comp_4_parties_all.png|center|400x240px]]
'''Sarja kuvia, joissa tarkastellaan kannatusprosentteja kahden suurimman puolueen (Yhtenäinen Venäjä oikealla ja Kommunistit vasemmalla) osalta Venäjän eri alueilla. Alle 50 äänestäjän alueilla kannatus on merkitty nollaksi.


A series of pictures comparing the voting activity of the Unified Russia (pictures on the right) party with the second largest Communist Party (pictures on the left). The data has been calculated in the regions of (top down) The Republic of Adygea, Republic of Bashkortostan, The Republic of Dagestan, Kabardino-Balkar Republic, Karachai-Cherkess Republic, The Republic of Komi, The Republic of Mordovia and The Republic of North Ossetia. These represent the first odd-valued region codes less than or equal to 15.
A series of pictures comparing the voting activity of the Unified Russia (pictures on the right) party with the second largest Communist Party (pictures on the left). The data has been calculated in the regions of (top down) The Republic of Adygea, Republic of Bashkortostan, The Republic of Dagestan, Kabardino-Balkar Republic, Karachai-Cherkess Republic, The Republic of Komi, The Republic of Mordovia and The Republic of North Ossetia. These represent the first odd-valued region codes less than or equal to 15.
Rivi 375: Rivi 277:




===Data format===
This is an example data. The English version is translated with Google translator and may contain serious mistakes.
<pre>
The election results
Elections to the State Duma of the Federal Assembly of the Sixth Convocation
Date of vote: 12/04/2011
Name of the Election Commission Babayevskaya
Date and time of signing the protocol 5/12/2011 9:00:00
#Column Name Translation of topic
V5 nVoters Number of voters included in voters list
V6 nBallots The number of ballots received by the precinct election commission
V7 nBallotsEarly The number of ballots issued to voters who voted early
V8 nBallotsPolling The number of ballots issued to voters at the polling
V9 nBallotsOutside The number of ballots issued to voters outside the polling station
V10 nBallotsCanceled The number of canceled ballots
V11 nBallotsMobile The number of ballots in mobile ballot boxes
V12 nBallotsStationary The number of ballots in the stationary ballot boxes
V13 nBallotsInvalid Number of invalid ballots
V14 nBallotsValid Number of valid ballots
V15 nAbsBallots The number of absentee ballots received by the precinct election commission
V16 nAbsBallotsPolling The number of absentee ballots issued to voters at a polling station
V17 nAbsBallotsVoted The number of voters who voted with absentee ballots at a polling station
V18 nAbsBallotsUnused The number of the unused absentee ballots
V19 nAbsBallotsTerr The number of absentee ballots issued to voters of the territorial election commission
V20 nAbsBallotsLost Number of lost absentee ballots
V21 nBallotsLost The number of lost ballots
V22 nBallotsNotrec The number of ballots not recorded in obtaining
V23 nVotesJustRussia 1. Political party JUST RUSSIA
V24 nVotesLibDemocr 2. Political Party "Liberal Democratic Party of Russia"
V25 nVotesPatriots 3. Political Party "PATRIOTS OF RUSSIA"
V26 nVotesCommunist 4. Political party "Communist Party of the Russian Federation"
V27 nVotesUniDemocr 5. A political party "Russian United Democratic Party" Yabloko "
V28 nVotesUniRussia 6. All-Russian Political Party "UNITED RUSSIA"
V29 nVotesCaseRight 7. All-Russian Political Party "CASE RIGHT"
</pre>
Original text
<pre>
Версия для печати
Сводная таблица результатов выборов
Выборы депутатов Государственной Думы Федерального Собрания Российской Федерации шестого созыва
Дата голосования:  04.12.2011
Наименование Избирательной комиссии Бабаевская
Сводная таблица результатов выборов
Сумма
1 Число избирателей, внесенных в список избирателей 18947
2 Число избирательных бюллетеней, полученных участковой избирательной комиссией 17294
3 Число избирательных бюллетеней, выданных избирателям, проголосовавшим досрочно 0
4 Число избирательных бюллетеней, выданных избирателям в помещении для голосования 9001
5 Число избирательных бюллетеней, выданных избирателям вне помещения для голосования 1761
6 Число погашенных избирательных бюллетеней 6532
7 Число избирательных бюллетеней в переносных ящиках для голосования 1761
8 Число избирательных бюллетеней в стационарных ящиках для голосования 8995
9 Число недействительных избирательных бюллетеней 201
10 Число действительных избирательных бюллетеней 10555
11 Число открепительных удостоверений, полученных участковой избирательной комиссией 795
12 Число открепительных удостоверений, выданных избирателям на избирательном участке 549
13 Число избирателей, проголосовавших по открепительным удостоверениям на избирательном участке 346
14 Число погашенных неиспользованных открепительных удостоверений 246
15 Число открепительных удостоверений, выданных избирателям территориальной избирательной комиссией 94
16 Число утраченных открепительных удостоверений 0
17 Число утраченных избирательных бюллетеней 0
18 Число избирательных бюллетеней, не учтенных при получении 0
19 1. Политическая партия СПРАВЕДЛИВАЯ РОССИЯ
20 2. Политическая партия "Либерально-демократическая партия России"
21 3. Политическая партия "ПАТРИОТЫ РОССИИ"
22 4. Политическая партия "Коммунистическая партия Российской Федерации"
23 5. Политическая партия "Российская объединенная демократическая партия "ЯБЛОКО"
24 6. Всероссийская политическая партия "ЕДИНАЯ РОССИЯ"
25 7. Всероссийская политическая партия "ПРАВОЕ ДЕЛО"
</pre>
===Data handling===
Note! The code does not work online, because a data file is needed. This code was used to upload the result version act_id = 3437.
<rcode>
library(OpasnetBaseUtils)
data <- read.table("c:/temp/results.csv", sep=",", header = FALSE)
data <- data[, -c(2,3,4)]
colnames(data) <- c("Region", "nVoters", "nBallots", "nBallotsEarly", "nBallotsPolling", "nBallotsOutside",
"nBallotsCanceled", "nBallotsMobile", "nBallotsStationary", "nBallotsInvalid", "nBallotsValid",
"nAbsBallots", "nAbsBallotsPolling", "nAbsBallotsVoted", "nAbsBallotsUnused", "nAbsBallotsTerr",
"nAbsBallotsLost", "nBallotsLost", "nBallotsNotrec", "nVotesJustRussia", "nVotesLibDemocr",
"nVotesPatriots", "nVotesCommunist", "nVotesUniDemocr", "nVotesUniRussia", "nVotesCaseRight")
nVotes <- data[, 20:26]
nVoters <- data[, 2]
nParty <- 7
nComm <- nrow(data) # 95067
temp <- cbind(nVoters, nVotes)
temp$Comm <- 1:nrow(temp)
head(temp)
temp <- reshape(temp, idvar = "Comm",  times = colnames(temp)[1:(ncol(temp)-1)], timevar = "Parameter",
varying = list(colnames(temp)[1:(ncol(temp)-1)]), v.names = "Result", direction = "long")
head(temp)
op_baseWrite("opasnet_base", temp, ident = "Op_fi2768", name = "Venäjän vaalit 2011", unit = "#", objtype_id = 1, who = "Jouni", acttype = 4)
</rcode>


===Hierarchial Bayesian model===
===Hierarchial Bayesian model===

Versio 20. joulukuuta 2011 kello 13.00




Venäjän vaalit 2011 käsittelee duuman vaaleja 4.12.2011.

Pääviesti
Kysymys:

Mitä päätelmiä voidaan tehdä Venäjän duuman vaalien tuloksista?

Vastaus:

Hallitsevana piirteenä tuloksissa on vaalipiirien tasolla näkyvä vahva yhteys Yhtenäisen Venäjän kannatuksen ja äänestysaktiivisuuden välillä. Vaikka pientä korrelaatiota voi olla rehellisissäkin vaaleissa, näyttää näissä vaaleissa korrelaatio niin vahvalta, ettei sitä voi selittää muuten kuin sillä, että uurniin on lisätty ylimääräisiä äänestyslippuja Yhtenäisen Venäjän hyväksi. Vaikutus näyttää huomattavan suurelta ja on se on lisännyt Yhtenäisen Venäjän kannatusta vaalien lopputuloksessa mahdollisesti jopa 10 - 15 prosenttiyksikköä todelliseen tilanteeseen nähden. Tarkkaa arviota vaikutuksesta ei tällä hetkellä ole.


Kysymys

Mitä päätelmiä voi tehdä Venäjän duuman vaalien (4.12.2011) tuloksista?

Tulos

Hallitsevana piirteenä tuloksissa on vaalipiirien tasolla näkyvä vahva yhteys Yhtenäisen Venäjän kannatuksen ja äänestysaktiivisuuden välillä. Vaikka pientä korrelaatiota voi olla rehellisissäkin vaaleissa, näyttää näissä vaaleissa korrelaatio niin vahvalta, ettei sitä voi selittää muuten kuin sillä, että uurniin on lisätty ylimääräisiä äänestyslippuja Yhtenäisen Venäjän hyväksi. Vaikutus näyttää huomattavan suurelta ja on se on lisännyt Yhtenäisen Venäjän kannatusta vaalien lopputuloksessa mahdollisesti jopa 10 - 15 prosenttiyksikköä todelliseen tilanteeseen nähden. Tarkkaa arviota vaikutuksesta ei tällä hetkellä ole.

Vaalien tulokset löytyvät Opasnet-kannasta: {{#opasnet_base_link:Op_fi2768}}


Tulokset ovat myös eri muodoissa sivun lopussa olevassa tiedostotaulukossa.

Vaalituloksista tehtyjä tilastoanalyysejä, joiden perusteella päätelmät on tehty: [1]

Perustelut

Blogikirjoituksia vaalien tilastoanalyyseistä


Vaalidataa eri lähteistä


Tilastoanalyyseja

Tässä on vaalidatasta tehtyjä tilastoajoja ja regressioanalyysiä. Sinun ei tarvitse ajaa mallia uudestaan (se kestää muutamia minuutteja), koska tulokset löytyvät valmiiksi laskettuna tästä: [2]

You don't need to run the model (it will take a few minutes); see a pre-run result: [3]

+ Näytä koodi

Suoraviivaisia tilastoanalyyseja

Tämä analyysi muuttuu vähitellen hienosyisemmäksi kuten etenet sivua alaspäin. Tässä yksinkertaisesti suodatetaan haluttu data ja kuvataan se. Tarkoitus on ladata data Opasnet-kantaan, jolloin voit ajaa analyysit yksinkertaisesti nappia painamalla. Vielä tämä ei toimi, vaan joudut kopioimaan koodin omalle koneellesi ja ajamaan sen R:llä siellä.

The analysis programs get progressively more sophisticated as you scroll down the page. This is the simplest analysis model which basically allows you to filter the data and make some nice plots. You can compare the statistics of different parties in different regions of Russia. We will upload the data file into the Opasnet data base so that you can simply run the program by pressing the button below (does not work quite yet! In the meanwhile you can install R on your own computer and download the input data file from the bottom of the page manually.)

+ Näytä koodi

Neljän suurimman puolueen kannatusprosentit (x-akseli) eri äänestysalueilla ja äänestysalueiden määrä (y-akseli).

Here is a picture of the 4 biggest parties in Russia. The x-axis shows the percentage of votes cast at the polling station and the y-axis shows the number of polling stations corresponding to the percentage.

Sarja kuvia, joissa tarkastellaan kannatusprosentteja kahden suurimman puolueen (Yhtenäinen Venäjä oikealla ja Kommunistit vasemmalla) osalta Venäjän eri alueilla. Alle 50 äänestäjän alueilla kannatus on merkitty nollaksi.

A series of pictures comparing the voting activity of the Unified Russia (pictures on the right) party with the second largest Communist Party (pictures on the left). The data has been calculated in the regions of (top down) The Republic of Adygea, Republic of Bashkortostan, The Republic of Dagestan, Kabardino-Balkar Republic, Karachai-Cherkess Republic, The Republic of Komi, The Republic of Mordovia and The Republic of North Ossetia. These represent the first odd-valued region codes less than or equal to 15.



Data format

This is an example data. The English version is translated with Google translator and may contain serious mistakes.

 The election results
 Elections to the State Duma of the Federal Assembly of the Sixth Convocation
 Date of vote: 12/04/2011
 Name of the Election Commission 	Babayevskaya
 Date and time of signing the protocol 5/12/2011 9:00:00

#Column	Name	Translation of topic
V5 	nVoters	Number of voters included in voters list 
V6 	nBallots	The number of ballots received by the precinct election commission 
V7 	nBallotsEarly	The number of ballots issued to voters who voted early 
V8	nBallotsPolling	The number of ballots issued to voters at the polling 
V9	nBallotsOutside	The number of ballots issued to voters outside the polling station 
V10	nBallotsCanceled	The number of canceled ballots 
V11	nBallotsMobile	The number of ballots in mobile ballot boxes 
V12	nBallotsStationary	The number of ballots in the stationary ballot boxes 
V13	nBallotsInvalid	Number of invalid ballots 
V14	nBallotsValid	Number of valid ballots 
V15	nAbsBallots	The number of absentee ballots received by the precinct election commission 
V16	nAbsBallotsPolling	The number of absentee ballots issued to voters at a polling station 
V17	nAbsBallotsVoted	The number of voters who voted with absentee ballots at a polling station 
V18	nAbsBallotsUnused	The number of the unused absentee ballots 
V19	nAbsBallotsTerr	The number of absentee ballots issued to voters of the territorial election commission 
V20	nAbsBallotsLost	Number of lost absentee ballots 
V21	nBallotsLost	The number of lost ballots 
V22	nBallotsNotrec	The number of ballots not recorded in obtaining 
V23 	nVotesJustRussia	1. Political party JUST RUSSIA 
V24	nVotesLibDemocr	2. Political Party "Liberal Democratic Party of Russia" 
V25	nVotesPatriots	3. Political Party "PATRIOTS OF RUSSIA" 
V26	nVotesCommunist	4. Political party "Communist Party of the Russian Federation" 
V27	nVotesUniDemocr	5. A political party "Russian United Democratic Party" Yabloko " 
V28	nVotesUniRussia	6. All-Russian Political Party "UNITED RUSSIA" 
V29	nVotesCaseRight	7. All-Russian Political Party "CASE RIGHT" 

Original text

Версия для печати
Сводная таблица результатов выборов
Выборы депутатов Государственной Думы Федерального Собрания Российской Федерации шестого созыва
Дата голосования:  04.12.2011
Наименование Избирательной комиссии 	Бабаевская
 Сводная таблица результатов выборов 	 
	Сумма
1 	Число избирателей, внесенных в список избирателей 	18947
2 	Число избирательных бюллетеней, полученных участковой избирательной комиссией 	17294
3 	Число избирательных бюллетеней, выданных избирателям, проголосовавшим досрочно 	0
4 	Число избирательных бюллетеней, выданных избирателям в помещении для голосования 	9001
5 	Число избирательных бюллетеней, выданных избирателям вне помещения для голосования 	1761
6 	Число погашенных избирательных бюллетеней 	6532
7 	Число избирательных бюллетеней в переносных ящиках для голосования 	1761
8 	Число избирательных бюллетеней в стационарных ящиках для голосования 	8995
9 	Число недействительных избирательных бюллетеней 	201
10 	Число действительных избирательных бюллетеней 	10555
11 	Число открепительных удостоверений, полученных участковой избирательной комиссией 	795
12 	Число открепительных удостоверений, выданных избирателям на избирательном участке 	549
13 	Число избирателей, проголосовавших по открепительным удостоверениям на избирательном участке 	346
14 	Число погашенных неиспользованных открепительных удостоверений 	246
15 	Число открепительных удостоверений, выданных избирателям территориальной избирательной комиссией 	94
16 	Число утраченных открепительных удостоверений 	0
17 	Число утраченных избирательных бюллетеней 	0
18 	Число избирательных бюллетеней, не учтенных при получении 	0
19 	1. Политическая партия СПРАВЕДЛИВАЯ РОССИЯ
20 	2. Политическая партия "Либерально-демократическая партия России"
21 	3. Политическая партия "ПАТРИОТЫ РОССИИ"
22 	4. Политическая партия "Коммунистическая партия Российской Федерации"
23 	5. Политическая партия "Российская объединенная демократическая партия "ЯБЛОКО"
24 	6. Всероссийская политическая партия "ЕДИНАЯ РОССИЯ"
25 	7. Всероссийская политическая партия "ПРАВОЕ ДЕЛО"


Data handling

Note! The code does not work online, because a data file is needed. This code was used to upload the result version act_id = 3437.

+ Näytä koodi

Hierarchial Bayesian model

The model does not work yet.

Model file: file:RussianElections2011.ods.
The model file: file:RussianElections2011.ods.
Constants:
   nComm = number of electoral commissions (97000)
   nParty = number of political parties in the election (7)
   nVoters[i] = number of eligible votes in each electoral commission.
Activity[i] = voting activity for each electoral commission. Described as
    Beta distribution with parameters ActA (alpha) and ActB (beta).
nHonest[i] = number of honest votes in electoral commission i. Described as
    binomial distribution with parameters nVoters[i] (n) and Activity[i] (p).
support[j] = True nation-wide support of party j. Described as 
    Dirichlet distribution with parameter alpha[j] (alpha)
nTotal[i,j] = Number of votes for party j in electoral commission i. This is observed and based on election data.
nHonest[i,j] = Number of honest votes to a party j in an electoral commission j. Described as
    multinomial distribution using parameter support[i] (Dirichlet).
pFabr[i,j] = Probability that there are fabricated votes for party j in electoral commission i. Described as
    beta distribution with parameters 0.01 (alpha) and 10 (beta).
Fabr[i,j] Bernoulli distribution as a realisation whether there was fabrication or not.
nFabr[i,j] = Number of fabricated votes for party j in electoral commission i. 
    If Fabr[i,j] is 1, then nTotal[i,j] - nHonest[i,j], else 0.

model{
	for( j in 1 : nParty ) {
		for( i in 1 : nComm ) {
			Fabr[j , i] ~ dbern(pFabr[j , i])
			nVotes[j , i] ~ dbin(0.0, 1.0E-6)
			pFabr[j , i] ~ dbeta(0.01, 10)
			nFabr[j , i] <- Fabr[j , i] * (nVotes[j , i] - nHonest2[j , i])
		}
	}
	for( i in 1 : nComm ) {
		Activity[i] ~ dbeta(ActA, ActB)C(0,1)
		nHonest2[1:nParty, i] ~ dmulti(support[1:nParty], nHonest[i])
		nHonest[i] ~ dbin(Activity[i], nVoters[i])
	}
	for( j in 1 : nParty ) {
		alpha[j] ~ dunif(0.001, 10000)
		support[j] ~ ddirich(alpha[j])
	}
	ActA ~ dunif(1, 1000)
	ActB ~ dunif(1, 1000)
}

#: The compilation of the model produces this error message: "vector-valued relation nHonest2 must involve consecutive elements of variable." Who can help to sort this out? --Jouni Tuomisto 19. joulukuuta 2011 kello 15.30 (EET)


Preliminary code for running the model using BRugs.

+ Näytä koodi

Katso myös

Aiheeseen liittyviä tiedostoja

Vaalien tulokset äänestysalueittain.

<mfanonymousfilelist></mfanonymousfilelist>