Introduction

The hypothesis being tested in this analysis is whether politicians who smile in election posters receive more votes than those who do not smile. For the purposes of this analysis, smile is defined as both the corners of the mouth turned up and the teeth showing, which is consistent with the Oxford Dictionary definition. The analysis collected data drawn from www.whichcandidate.ie, the Irish Times website, as well as in person sampling of election posters. The ‘votes’ variable counts only those votes achieved during count 1, as this is the most simple weighting possible and gives the best indication of people’s initial impression.

Exploratory Data Analysis

library(ggplot2)
boxplot(pctVotes ~ smile, data=politicalPosters, col="green")

Initially, the boxplot comparing smiling vs non-smiling election posters shows a higher median for smiling politicians compared to their non-smiling counterparts. Moreover, the 1st quartile of smiling politicians recevied more votes than the 2nd quartile of non-smiling politicians. From the graph above, we can infer that there is a difference in the number of votes received for smiling vs non-smiling politicians.

#Non-smiling
summary(politicalPosters %>%
       subset(smile == 0) %>%
       .$pctVotes,)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## 0.001586 0.014019 0.028384 0.054175 0.075121 0.232630
#Smiling
summary(politicalPosters %>%
       subset(smile == 1) %>%
       .$pctVotes,)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## 0.000332 0.038835 0.075206 0.091290 0.127813 0.234993

The tables above provide further confirmation that, on average, smiling politicians receive more votes than non-smiling politicians as smiling politicians have both a higher mean and median.

par(mfrow= c(1, 2))
hist(politicalPosters %>%
       subset(smile == 0) %>%
       .$pctVotes, main ="Non-smiling politicians", xlab="votes", breaks=20)
hist(politicalPosters %>%
       subset(smile == 1) %>%
       .$pctVotes, main ="Smiling politicians", xlab="votes", breaks=20)

Here are the hypothesis’ being tested

Ho: The distribution of total percentage of votes for smiling politicians = the total percentage of votes for non-smiling politicians

Ha: The distribution of total percentage of votes for smiling politicians /= the total percentage of votes for non-smiling politicians

two-sided test at a 0.95% confidence level

wilcox.test(politicalPosters$pctVotes ~ politicalPosters$smile, mu=0, alt="two.sided", conf.int=T, conf.level=0.95, paired=F, exact=F, correct=T)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  politicalPosters$pctVotes by politicalPosters$smile
## W = 784.5, p-value = 0.001348
## alternative hypothesis: true location shift is not equal to 0
## 95 percent confidence interval:
##  -0.05743027 -0.01244418
## sample estimates:
## difference in location 
##            -0.03144966

Conclusion: Since the p-value of 0.001348 is less than the significant level (0.05), the null hypothesis is rejected. There is evidence that the distributions for smiling politicians and non-smiling politicians is statistically significant difference beyond random chance. Because the confidence interval does not contain zero, this lends further support to the rejection of the null hypothesis at a 95% confidence level. Because the report shows that numerically the median and mean of ‘pctVotes’ for smiling (‘smile = 1’) politicians is higher than the non-smiling (‘smile = 0’) politicians, as well as the rank-sum test lending support to the alternative hypothesis, it can be concluded that there is statistically significant evidence that smiling politicians receive a greater percentage of votes than non-smiling politicians.