Robert W. Walker
load("C:/Users/Robert/Documents/PPP.RData")
local({ .Table <- xtabs(~M.F+Winner, data=Data)
cat("\nPercentage table:\n")
print(rowPercents(.Table))
prop.test(.Table, alternative='two.sided', conf.level=.95, correct=FALSE)
})
Percentage table:
Winner
M.F Clinton Trump Total Count
Female 60.0 40.0 100 478
Male 52.2 47.8 100 433
2-sample test for equality of proportions without continuity
correction
data: .Table
X-squared = 5.6877, df = 1, p-value = 0.01708
alternative hypothesis: two.sided
95 percent confidence interval:
0.0141220 0.1428349
sample estimates:
prop 1 prop 2
0.6004184 0.5219400
With 95% confidence, Clinton had a higher probability of winning the debate among women than men. The difference in probability ranges from 0.014 to 0.143.