Ok so I got asked a statistics problem the other day, and this is the problem:
Suppose that we survey $489$ randomly selected Country $X$ voters about whether or not they think Mr.A should leave the race, and $254$ of the $489$ voters say "yes". Test the hypothesis that greater than $49$% of Country $X$ voters believe that Mr.A should quit the race. Find the $p$-value for this test. What does the value indicate, or mean?
- I know that $H_0: \mu >0.49$, $ H_1:\mu \le 0.49$. How do I find the s.d and the $p$ value?, and how do I interpret the result of the $p$-value? I will appreciate the help.
OK, I'll answer a similar question that does not have the difficulties mentioned in the Comments.
Question. In a survey of 489 randomly chosen voters, 254 say the candidate should drop out of the race. What can we say about the proportion $p$ of all voters who share this view?
Confidence interval. A straightforward method is to use the data to make a 95% confidence interval (CI) for $p.$ We estimate $p$ by $\hat p = 254/489 = 0.517.$ Then a 95% CI is of the form
$$ \hat p \pm 1.96\sqrt{\frac{\hat p(1-\hat p)}{n}}.$$
For your data, this gives $(0.475, 0.564).$ So the relatively small sample from the poll is not enough to settle whether more than half of the voters feed the candidate should withdraw.
Notes: (1) Technically, this CI assumes there are more than about 5000 voters in the county. If there were fewer, the CI would be somewhat shorter. (2) This CI uses a normal approximation to the binomial distribution, which should be reasonably good. (3) There is another formula, slightly more complicated than this one, that might be considered more accurate, but it gives $(0.475, 0.563),$ which is not different for practical purposes.
Test of Hypothesis. Now, you wonder if we can be reasonably sure that the population percentage in favor of the candidate's withdrawal exceeds 49%. We know that $\hat p = 0.517 > 0.49,$ but the issue is whether $\hat p$ is significantly greater than 0.49.
We test the hypothesis $H_0: p \le 0.49$ against the alternative $H_a: p > 0.49.$ We use the $=$-sign in $H_0$ to say that the observed number in favor of his withdrawal is $X \sim \mathsf{Binom}(n = 489, p = .49)$ and ask for $P(X \ge 254),$ which is called the P-value of the test. The P-value is the probability of a number greater than or equal to the observed number.
One can use software to compute $P(X \ge 254) = 1 - P(X \le 253) = 0.1045$. In R statistical software the computation is as follows:
So there is more than one chance in 10 of getting a value as large as 254 (hence $\hat p$ as large as 0.517), even if only 49% of the population favors withdrawal. Obviously, $\hat p = 0.17 > 0.49,$ but we have shown that this difference could have been due to sampling error in a sample as small as 489. [Note: You could also use a normal approximation to evaluate $P(X \le 254).$ The result would be about the same, but perhaps only accurate to two decimal places.]
Usually one does not reject a null hypothesis unless the P-value is smaller than 5% and here it is larger than 10%, so we do not have statistically significant evidence that the true population proportion exceeds 0.49. In view of the CI computed earlier, this is hardly a surprise because the CI includes 0.49 as a 'believable' value of $p.$ [Note: If you had tested $H_0: p \le .50$ agains $H_a: p > .50$ as suggested in one of the Comments, then the P-value would have been about 0.21-- even larger.]