# Single Proportion Hypothesis Test Calculator

## Calculate the results of a z-test for a proportion.

Use the calculator below to analyze the results of a single proportion hypothesis test. Enter your null hypothesis's proportion, sample proportion, sample size, test type, and significance level.

You will find a description of how to conduct a hypothesis test of a proportion below the calculator.

#### Define the z-test

#### Result

Significance Level | Sample Proportion | |
---|---|---|

z-score | ||

Probability |

#### Sample Proportion Under the Null Distribution

### Conducting Single Proportion Hypothesis Tests

A hypothesis test of a sample proportion can help you make inferences about the population from which you drew it. It is a tool to determine what is probably true about an event or phenomena.

#### Testing a Proportion

For the results of a hypothesis test to be valid, you should follow these steps:

- Check Your Conditions
- State Your Hypothesis
- Determine Your Analysis Plan
- Analyze Your Sample
- Interpret Your Results

##### Check Your Conditions

To use the testing procedure described below, you should check the following conditions:

**Binary Outcomes**- When conducting a hypothesis test for a proportion, each sample point should consist of only one of two outcomes. We often label one outcome a “success” and one outcome a “failure,” but it does not matter which of the two outcomes gets which label.**Success-Failure Rate**- Your sample size should be large enough that under the null hypothesis proportion you are likely to see at least 10 “success” and 10 “failures.” For example, if you have null hypothesis proportion with a 10% or 0.1 “success” rate, then you would need a sample of 100 [10 = 100 * 10%] to have a large enough sample to meet this condition. This condition helps ensure that the sampling distribution from which you collect your sample reasonably follows the Normal Distribution.**Simple Random Sampling**- You should collect your sample with simple random sampling. This type of sampling requires that every occurrence of a category or event in a population has an equal chance of being selected when taking a sample.**Sample-to-Population Ratio**- The population should be much larger than the sample you collect. As a rule-of-thumb, the sample size should represent no more than 5% of the population.

##### State Your Hypothesis

You must state a null hypothesis and an alternative hypothesis to conduct a hypothesis test for a proportion.

The null hypothesis, is a skeptical claim that you would like to test. It is defined by a hypothesized proportion,
which is often labeled P_{0}.

The alternative hypothesis represents an alternative claim to the null hypothesis.

Your null hypothesis and alternative hypothesis should be stated in one of three mutually exclusive ways listed in the table below.

Null Hypothesis | Alternative Hypothesis | Number of Tails | Description |
---|---|---|---|

P = P_{0} |
P ≠ P_{0} |
Two |
Tests whether the population defined by the proportion, P, from which you drew your sample is different from
the population defined by the null hypothesis's proportion, P_{0}. |

P ≤ P_{0} |
P > P_{0} |
One (right) |
Tests whether the population defined by the proportion, P, from which you drew your sample is greater
than the population defined by the null hypothesis's proportion, P_{0}. |

P ≥ P_{0} |
P < P_{0} |
One (left) |
Tests whether the population defined by the proportion, P, from which you drew your sample is less than
the population defined by null hypothesis's proportion, P_{0}. |

##### Determine Your Analysis Plan

Before conducting a hypothesis test, you must determine a reasonable *significance level*, α, or the probability
of rejecting the null hypothesis assuming it is true. The lower your significance level, the more confident you can be of the conclusion of your hypothesis test. Common significance levels are 10%, 5%, and 1%.

To evaluate your hypothesis test at the significance level that you set, consider if you are conducting a one or two tail test:

**Two-tail tests**divide the rejection region, or critical region, evenly above and below the null distribution, i.e. to the tails of the null sampling distribution. For example, in a two-tail test with a 5% significance level, your rejection region would be the upper and lower 2.5% of the null distribution. An alternative hypothesis of P ≠ P_{0}requires a two-tail test.**One-tail tests**place the rejection region entirely on one side of the null distribution i.e. to the right or left tail of the null sampling distribution. For example, in a one-tail test evaluating if the sampling distribution is above the null sampling distribution with a 5% significance level, your rejection region would be the upper 5% of the null distribution. P > P_{0}and P < P_{0}alternative hypotheses require one-tail tests.

The graphical results section of the calculator above shades rejection regions blue.

##### Analyze Your Sample

After checking your conditions, stating your hypothesis, determining your significance level, α, and collecting your sample, you are ready to analyze your hypothesis.

Sample proportions follow the Normal Distribution with the following parameters (i.e. numbers that define the distribution):

**The Population Proportion, P**- The population proportion is assumed to be the proportion given by the null hypothesis in a single proportion hypothesis test.**The Standard Error, SE**- The standard error can be computed as follows: SE = sqrt((P x (1 - P))/ n), with n being the sample size. It defines how sample proportions are expected to vary around the null hypothesis's proportion given the sample size and under the assumption that the null hypothesis is true.

In a single proportion hypothesis test, we calculate the probability that we would observe the sample proportion, p,
assuming the null hypothesis is true, also known as the *p-value*. If the p-value is less than the significance level,
then we can reject the null hypothesis.

You can determine a precise p-value using the calculator above, but we can find an estimate of the p-value manually by calculating the *z-score* as follows: z = (p - P) / SE

The z-score is a test statistic that tells us how far our observation is from the null hypothesis's proportion under the null distribution. Using any z-score table, we can look up the probability of observing the results under the null distribution. You will need to look up the z-score for the type of test you are conducting, i.e. one or two tail. A hypothesis test for a proportion is sometimes known as a z-test because of the use of a z-score in analyzing results.

If we find the probability is below the significance level, we reject the null hypothesis.

##### Interpret Your Results

The conclusion of a hypothesis test for a proportion is always either:

- Reject the null hypothesis
- Do not reject the null hypothesis

If you reject the null hypothesis, you cannot say that your sample proportion is the true population proportion. If you do not reject the null hypothesis, you cannot say that the null hypothesis is true.

A hypothesis test is simply a way to look at a sample and conclude if it provides sufficient evidence to reject the null hypothesis.

### Example: Hypothesis Test for a Proportion

Let’s say you are the Marketing Director of a software company. You have set up a demo request page on your website, and you believe that 40% of visitors to that page will request a demo.

You decide to test your claim that 40% of visitors to the demo page will request a demo. So, you decide to run a hypothesis test for a proportion with a sample size of 500 visitors. Let’s go through the steps you would take to run the test.

**Check the conditions**- Your test consists of*binary outcomes*(i.e. request demo and not request demo), your sample size is large enough to meet the*success-failure*condition but not too large to violate the*sample-to-population ratio*condition, and you collect your sample using*simple random sampling*. So, your test satisfies the conditions for a z-test of a single proportion.**State Your Hypothesis**- Your null hypothesis is that the true proportion of visitors requesting a demo equals 40%, formally stated P = 40%. Your alternate hypothesis is that the true proportion of vistors requesting a demo does not equal 40%, formally stated P ≠ 40%.**Determine Your Analysis Plan**- You believe that a 5% significance level is reasonable. As your test is two-tail test, you will evaluate if your sample proportion would occur at the upper or lower 2.5% [2.5% = 5%/2] of the null distribution.**Analyze Your Sample**- You collect your samle (which you do after steps 1-3). You find that the proportion of visitors request a demo in your sample is 44%. Using the calculator above, you find that a sample proportion of 44% would results in a z-score of 1.83 under the null distribution, which translates to a p-value of 6.79%.**Interpret Your Results**- Since your p-value of 6.79% is greater than the significance level of 5%, you do not have sufficient evidence to reject the null hypothesis.

In this example, you found that you cannot reject your original claim that 40% of your demo webpage vistors request demos. The test does not guarantee that your 40% figure is correct, but it does give you confidence that you do not have sufficient evidence to say otherwise.