8. Testing for Differences in Means and Proportions: Independent Proportions Z-test
Independent Proportions Z-test: Test Statistic and p-value
Independent proportions Z-test: Test Statistic
Let denote the number of successes in the first sample and the number of successes in the second sample. Then and are the sample proportions:
Besides the individual sample proportions, we will also need the pooled sample proportion in order to calculate the test statistic:
The test statistic of a independent proportions -test is denoted and is computed with the following formula:
where is the standard error of the proportion difference.
When both samples are large , the -statistic follows the Standard Normal Distribution under the null hypothesis of the test:
Calculating the p-value of an independent proportions Z-test with Statistical Software
The calculation of the -value of an independent proportions -test is dependent on the direction of the test and can be performed using either Excel or R.
To calculate the -value of an independent proportions -test for in Excel, make use of one of the following commands:
To calculate the -value of an independent proportions -test for in R, make use of one of the following commands:
If , reject and conclude . Otherwise, do not reject .
The researcher plans on using an independent proportions -test to determine whether or not there is a significant difference between the morning and evening on-time arrival rate, at the level of significance.
Out of the morning trains, arrived on time. Out of the evening trains, arrived on time.
Calculate the -value of the test and make a decision regarding . Round your answer to decimal places.
On the basis of this -value, should not be rejected, because .
There are a number of different ways we can calculate the -value of the test. Click on one of the panels to toggle a specific solution.
Compute the sample proportions and :
Compute the pooled sample proportion :
Compute the -statistic:
Since both and are considered large (), the Central Limit Theorem applies and we know that the test statistic
approximately has the Standard Normal Distribution, under the assumption that is true.
For a two-tailed -test, the -value is defined as . To calculate this value in Excel, make use of the following function:
NORM.DIST(x, mean, standard_dev, cumulative)
- x: The value at which you wish to evaluate the distribution function.
- mean: The mean of the distribution.
- standard_dev: The standard deviation of the distribution.
- cumulative: A logical value that determines the form of the function.
- TRUE - uses the cumulative distribution function,
- FALSE - uses the probability density function
Thus, to calculate , run the following command:
This gives:
Since , should not be rejected.
Compute the sample proportions and :
Compute the pooled sample proportion :
Compute the -statistic:
Since both and are considered large (), the Central Limit Theorem applies and we know that the test statistic
approximately has the Standard Normal Distribution, under the assumption that is true.
For a two-tailed -test, the -value is defined as . To calculate this value in R, make use of the following function:
pnorm(q, mean, sd, lower.tail)
- q: The value at which you wish to evaluate the distribution function.
- mean: The mean of the distribution.
- sd: The standard deviation of the distribution.
- lower.tail: If TRUE (default), probabilities are , otherwise, .
Thus, to calculate , run the following command:
This gives:
Since , should not be rejected.