Difference in Proportions

Example In a survey of 1000 likely voters 523 said they will vote for party A, the other 477 for party B. Find a 95% CI for the lead of one party over the other.

First we need a probability model for this experiment. Here this is clearly as follows: let Xi=1 if vote is for A, 0 if it is for B, then Xi~Ber(p). We can assume that X1, .., Xn are independent. The parameter of interest is the difference in proportions θ=p-(1-p)= 2p-1.

Frequentist Analysis: we already know that the mle of p isX̅, so the mle of θ is 2X̅-1 , here 2·0.523-1= 0.046.

Of course if θ=2p-1 we have p=[1+θ]/2, so


and for our numbers we get the interval (-0.016, 0.108), see diffprop().

Bayesian Analysis: Our parameter is θ with values in [-1,1], so we need a prior with values in this interval. For p we usually use Beta(α,β), and then we have

which yields the interval (-0.016, 0.108) using α=β=1