How to use statistics to learn about voting? I have a data set with 1500 individuals who were surveyed about many things including demographics, attitudes and opinions about politics and economic status. The most important question in the survey was about vote intention on the next election for president. The question had the four candidate options, plus options for 'I don't know yet', and for 'I'm not going to vote'. Among the 4 candidates, 2 are strong, and 2 are very weak. 
The question I'm trying to answer is: among the undecided (the ones who say I don't know yet), what are the characteristics of the voters who are more likely to vote for each of the candidates? For example, are male or female among the undecided more likely to vote for candidate A?
How can I do that in R?
 A: This is a pretty broad question, and hard to answer.
Election prediction itself is a science, which requires a lot of experience.
The most important thing is to control for bias. Step out of your way, and control the heck for bias. It's not fun. It's as boring as it can get. But unless you have a representative sample, your results will be badly off. If you asked only Twitter users, the results will be completely useless.
With elections, even with a representative sample, it's apparently hard to get the prediction error below 1%. Because people don't answer truthfully. Because people are undecided. Because people change their mind suddenly. Because the brain says A, but the gut says B.
The prediction error you can't get rid consists of many factors. If you have a very good representative sample (carefully chosen telephone interviews) it will be lower than by doing exit polls (where you can only roughly control demographics by choosing representative locations). If your poll has many options, the error will be higher than if it is a A/B election. Here are some sources:


*

*"The margin of error for a 95% confidence interval is about +/- 3% for a typical characteristic from the national Exit Poll and +/-4% for a typical state Exit Poll." http://www.edisonresearch.com/exit_poll_faq.php

*"That's why the final (not preliminary) exit polls in Wisconsin had a theoretical margin of error of ±4 points, while a telephone poll of the same sample size would have a margin of error of only about ±2 points." http://www.theguardian.com/commentisfree/2012/jun/06/outraged-wisconsin-exit-polls-so-wrong

*"the sample size needed to construct a 95% confidence interval with a 1% margin of error. If the planned proportion is estimated to be 0.51 with a margin of error of 0.01 (under Options set it to estimate a Lower Bound confidence interval), the sample size needed is approximately 7,000." (if representative) http://blog.minitab.com/blog/understanding-statistics-and-its-application/how-large-should-the-sample-size-be
A: To truly assess the characteristics of the undecided voters who are more likely to vote for each of the candidates, you would need a dataset with known outcomes. More specifically, if you had this current data with their actual votes in the next election appended to it, you be able to compare undecided voters who voted for candidate A vs. candidate B across variables such as gender, economic status, etc.
Since you do not possess these known outcomes (next election voting results), you could look into unsupervised learning techniques such as neural networks or clustering. My expertise does not lie in these areas, but I bet someone reading this can provide more sufficient detail! I hope this helps!
