A z-test is an inferential technique to assess two competing hypotheses about the population proportion(s) across one or two samples. We can use the z-test for three specific purposes:
One-Sample: tests whether the population proportion is lesser, greater than, or not equal to a prespecified value. The z statistic compares the observed data with what we expect under the null hypothesis, which states that the population proportion equals the testing value. The resulting p-value tells us how likely observing the evidence we have for the alternative hypothesis or more when the null hypothesis is true. If the p-value is less than the specified significance level (e.g., less than 0.05), we reject the null hypothesis in favor of the alternate hypothesis, which states that the population proportion is less than, greater than, or not equal to the testing value. Otherwise, we fail to reject the null hypothesis, indicating we do not have significant evidence for the alternative hypothesis.
Two-Sample: tests whether the difference of two population proportions is lesser, greater than, or not equal to a prespecified value, which we frequently take to be zero. The z statistic compares the observed data with what we expect under the null hypothesis, which states that the difference in population proportions equals the testing value; usually, we take the testing value to be zero (e.g., the proportions are the same). The resulting p-value tells us how likely observing the evidence we have for the alternative hypothesis or more when the null hypothesis is true. If the p-value is less than the specified significance level (e.g., less than 0.05), we reject the null hypothesis in favor of the alternate hypothesis, which states that the difference of population proportions is less than, greater than, or not equal to the testing value. Otherwise, we fail to reject the null hypothesis, indicating we do not have significant evidence for the alternative hypothesis.
The z-test can be used under the following conditions.
1. The observations are representative of the population of interest and independent. The samples are mutually independent.
2. The observations within each sample are Bernoulli distributed.
3. The Central Limit Theorem sample size conditions are met.
Note: When (3.) above is not met, we can use an exact test (e.g., a binomial test in the one-sample case and Fisher's test in the two-sample test).
Step 1: To use this app, go to the Dataset and Hypothesis Tab and upload your .csv type dataset, or select a sample dataset.
Step 2: Next, you must select the type of z-test (One-Sample, Two Independent Samples, or Paired Sample).
Step 3: You can check the assumptions in the 'Assumptions' tab. This tab will provide information about which approach is most appropriate given your input.
Step 4: You can check the result of the z-test procedure (test statistics, decision making, and test visualization) in the 'Hypothesis Test' and 'Confidence Interval' tabs.
Step 5 (Optional): We also provide the results of a bootstrap approach for computing a confidence interval and a randomization test. These are nonparametric alternatives to the z-test that can be used when z-test assumptions are not met or to evaluate whether the results of the z-test procedure depend on its assumptions.
Please contact us if you have any questions at datascience@colgate.edu.
Coming soon.