LEGACY CONTENT. If you are looking for Voteview.com, PLEASE CLICK HERE

This site is an archived version of Voteview.com archived from University of Georgia on May 23, 2017. This point-in-time capture includes all files publicly linked on Voteview.com at that time. We provide access to this content as a service to ensure that past users of Voteview.com have access to historical files. This content will remain online until at least January 1st, 2018. UCLA provides no warranty or guarantee of access to these files.

Bayes by the Beach -- How to Use WINBUGS on Gary King's U.K. Elections Data




WINBUGS is not user friendly! Accordingly, I will go through the U.K. Elections data application step-by-step. First and overview and then step by step screen shots. Overview:

 1. Model ® Specification ® 
 2.                              double-click "model"
                                 in Document Window
 3.                                                   ® Check Model
 4.                              double-click "list"
                                 under "data' in
                                 Document Window      
 5.                                                   ® Load Data
 6.                                                   ® Compile
 7.                              double-click "list"
                                 under "inits" in
                                 Document Window
 8.                                                   ® Load Inits
 9. Inference ® Samples ® type "rho" ® set
10. Inference ® Samples ® type "bias" ® set
11. Inference ® Samples ® type "rho" ® trace
12. Inference ® Samples ® type "bias" ® trace
13. Model ® Update ® type number in box ® update
14. [Bring "Sample Monitoring Tool" to front] ® select "rho" ® stats
15.                                           ® select "bias" ® stats
  1. After starting WINBUGS use the normal Windows file-open drop-down to grab the king_england_royce.odc document (actually, it is a binary file) file:



  2. This is what you see after king_england_royce.odc loads. The file contains the model, the data, and the intial values.



  3. The first step is to select "Specification" from the drop-down "Model" Menu:



  4. The "Specification Tool" dialog box appears. This is used to check the model.



  5. Double-Click on "model" in king_england_royce.odc and it highlights the word:



  6. Click the "check model" button to check the model:



  7. Because the model is OK (this may not always be true!) a dialog box pops up telling you that it will replace the old model. Click OK.



  8. Double-Click on "list" below the word "data" to load the data:



  9. Click "load data" to load the data into the program.



  10. Click "compile" to make the program ready to run.



  11. Double-Click on "list" below the word "Inits" to load the intial values:



  12. Click "load inits".



  13. Now you have to set up your sample monitoring. Click the "Inferences" drop-down box and select "Samples":



  14. This brings up the Sample Monitoring Tool:



  15. The parameters are rho, and the 3-length vector bias. (One value of bias is held constant.) In the "node" window type "rho" and then click set:



  16. Now type "bias" and click "set:



  17. Go back and select "rho"



  18. and click "trace". This brings up a window that will show the MCMC iterations for rho.



  19. Select "bias" and click "trace" and it brings up a two panel window that will show the MCMC iterations for the two bias variables.



  20. The Model is almost ready to run! Click the "model" drop-down box and select "Update":



  21. This brings up the "Update Tool". Set the updates to 10000 (you can do more but 10000 is safe)



  22. and click "update" and the model runs!



  23. Note the appearance of "10000" in the gray "iteration" box and the red tracelines in the parameter windows.



  24. Bring the "Sample Monitoring Tool" back to the foreground (its been there the whole time) and click "stats":



  25. This brings up the usual descriptive statistics (with a Bayesian twist!) for the two "bias" parameters.



  26. Select "rho" in the "Sample Monitoring Tool" and click "stats":



  27. and you get the usual descriptive statistics (with a Bayesian twist!) for the rho parameter. Note that this window popped up over the bias statistics window. You can move these around any way you want.



  28. Here is everything rearranged so you can see it.



  29. In this final screen shot the results of classical Maximum-Likelihood run in R can be seen in the background with the final results from the Bayesian posterior. The two are essentially the same.