In hypothesis testing the difference between population proportions p1 and p2, we use samples to calculate a standardized test statistic and reject or fail to reject a null
hypothesis depending on whether that test statistic falls in a rejection region. The usual pairing of hypotheses are listed here, and we always assume there is no
difference between the population proportions, so p1 equals p2. When testing the difference between population proportions we use a z-test and there are 3 conditions
that must be met, the samples must be random, the samples must be independent or not related, and n1 times p1, n1 times q1, n2 times p2, and n2 times q2 must all
be greater than or equal to 5. And since we will not know the values of p1 or p2, this condition is going to slightly change after we go through the formula.
And, the formula for calculating the standardized test statistic is z equals phat1 minus phat2, minus p1, minus p2, divided by the square root of pbar times qbar,
times 1 over n1, plus 1 over n2. In this formula, z is the standardized test statistic, phat1 is the proportion for sample 1, phat2 is the proportion for sample 2,
p1 and p2 are the population proportions, which we always assume are equal. pbar is a weighted estimate of p1 and p2. The formula for pbar is n1, times phat1,
plus n2, times phat2, divided by n1 plus n2. And this formula is often times shortened to pbar equals, x1 plus x2, divided by n1 plus n2. These are equal to one another,
because the formulas for calculating phat1 and phat2 is x1 over n1, and x2 over n2. As an example, if I said in a random sample of 122 people, 44 of them were wearing a
necklace, the sample proportion would be 44 divided by 122, which is 0.361, so x equals 44, n equals 122, and p hat equals 0.361. Back to our main formula,
q bar is equal to 1 minus pbar , and n1 and n2 are the sizes of the samples. Now, in the conditions, for number 3, it is going to be n1 times pbar, n1 times qbar, n2 times
pbar, and n2 times qbar, that must all be greater than or equal to 5. Alright, let’s go through a full example step by step.
A recent study of 132 randomly selected females and 120 males showed 33% of females and 45% of males had a dessert after dinner. At a level of significance of 0.10,
can you reject the claim that the proportion of people who eat dessert after dinner is the same for females and males. Step 1 is to make sure the first 2 conditions are met.
And it is a random sample, and the samples are independent, females and males. Step 2 is to find the weighted estimate of p1 and p2, find pbar. We first need to
calculate x1 and x2, which I have done here, then we plug those into our pbar formula and get approximately 0.3889. And then for qbar we get approximately 0.6111.
Step 3 is to make sure condition 3 is met, which I have done here, so this condition is also met. Step 4 is to write the claim out and identify the null and alternative
hypotheses. The claim is that the proportion of people who eat dessert after dinner is the same for females and males. So, the claim is that p1 equals p2.
And we know the null hypothesis contains a statement of equality, so h sub 0 is p1 equals p2. The alternative hypothesis is the complement of the null hypothesis
and contains a statement of inequality, so h sub a is p1 does not equal p2. Step 5 is to identify the level of significance, which was given, alpha equals 0.10.
Step 6, is to determine the test to use, left tailed, right tailed or 2 tailed, and because the alternative hypothesis contains the does not equals inequality, this will be a 2
tailed test. Step 7 is to determine the critical values. Graphically this looks like this, with our critical values, negative z naught and positive z naught, here and the shaded
areas in the tails being the rejection regions. Since the level of significance is alpha equals 0.10, and this is a 2 tailed test, the rejection regions will equal one half of alpha,
which is 0.05. And in the z distribution table that value is -1.645 and positive 1.645, so those are our critical values. Step 8 is to identify the rejection region,
which is any standardized test statistic value that falls in the shaded area, that is any value that is less than -1.645 or greater than positive 1.645. Step 9 is to use the
formula and calculate the z value, or the value of the standardized test statistic. And in our example, we have 0.333 minus 0.45 minus 0, as we assume p1 minus p2
equals 0, divided by the square root of 0.3889 times 0.6111, times 1 over 132, plus 1 over 120. And this calculates out to -1.8974. Step 10 is to make a decision
to reject or fail to reject the null hypothesis. On our graph, you can see that the standardized test statistic does fall in the rejection region to the left,
as z, the standardized test statistic is less than negative z naught, the critical value. So, in this case we would reject the null hypothesis. Step 11 is to interpret the decision.
There is enough evidence at the 10% level of significance to reject the claim that the proportion of people who eat dessert after dinner is the same for females and males.
Alright my friends, that be the basics on hypothesis testing the difference between proportions.
Hopefully this video helped you out, I do have more statistical videos right there for you, till next time, I am outta here.