The 2-PropZTest( Command

Command Summary

Performs a z-test to compare two proportions.

Command Syntax

2-PropZTest(x1, n1, x2, n2, //draw?//

Menu Location

While editing a program, press:

  1. STAT to access the statistics menu
  2. LEFT to access the TESTS submenu
  3. 6 to select 2-PropZTest, or use arrows

(outside the program editor, this will select the 2-PropZTest… interactive solver)

Calculator Compatibility


Token Size

2 bytes

2-PropZTest( performs az-test to compare two population proportions. This test is valid for sufficiently large samples: only when the number of successes (x in the command syntax) and the number of failures (n-x) are both >5, for both populations.

The logic behind the test is as follows: we want to test the hypothesis that the proportions are equal (the null hypothesis). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the differences between the two proportions occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the proportions are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it.

Commonly used notation has the letters π1 and π2 being used for the true population proportions (making the null hypothesis be π12). TI must have been afraid that this would be confused with the real number π, so on the calculator, "p1" and "p2" are used everywhere instead.

In addition to the null hypothesis, we must have an alternative hypothesis as well - usually, this is simply that the proportions are not equal. However, in certain cases, our alternative hypothesis may be that one proportion is greater or less than the other.

The arguments to 2-PropZTest( (which must be integers, or the calculator will generate a domain error) are as follows:

  • x1 - the success count in the first sample
  • n1 - the total size of the first sample (so the sample proportion would be x1/n1)
  • x2 - the success count in the second sample
  • n2 - the total size of the second sample (so the sample proportion would be x2/n2)
  • alternative (optional if you don't include draw?) - determines the alternative hypothesis
    • 0 (default value) - p1≠p2
    • -1 (or any negative value) - p1<p2
    • 1 (or any positive value) - p1>p2
  • draw? (optional) set this to 1 if you want a graphical rather than numeric result

Although you can access the 2-PropZTest( command on the home screen, via the catalog, there's no need: the 2-PropZTest(… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax.

In either case, it's important to understand the output of 2-PropZTest(. Here are the meanings of each line:

  • The first line, involving p1 and p2, is the alternative hypothesis.
  • z is the test statistic. If the null hypothesis is true, it should be close to 0.
  • p is the probability that the difference between the two proportions would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms.
  • p-hat1 is the sample proportion x1/n1.
  • p-hat2 is the sample proportion x2/n2.
  • p-hat is the total sample proportion
  • n1 is the first sample size.
  • n2 is the second sample size.

Advanced Uses

The final optional argument of 2-PropZTest(, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of z and the value of p will be displayed. You would make your conclusions in the same way as for the regular output.


Some of the arguments of the 2-PropZTest( command have default values, and the argument can be omitted if this value is used.

  • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well.
  • If the above argument is omitted, and you're doing a two-sided test, you may omit the alternative argument.


can be

Error Conditions

  • ERR:DOMAIN is thrown if the values of the arguments entered are not integers.

Related Commands


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.