Computes a Z confidence interval of the difference between two proportions.

2-PropZInt(*x _{1}*,

*n*,

_{1}*x*,

_{2}*n*, level//

_{2}When editing a program, press:

- STAT to access the statistics menu
- LEFT to access the TESTS submenu
- ALPHA B to select 2-PropZInt(, or use arrows

(this key sequence will give you the 2-PropZInt… screen outside a program)

TI-83/84/+/SE

2 bytes

The 2-PropZInt( command calculates a confidence interval for the difference between two proportions, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the difference lies within the interval you get. The command assumes that the sample is large enough that the normal approximation to binomial distributions is valid: this is true if, in both samples involved, the positive and negative counts are both >5.

The 1-PropZInt( command takes 5 arguments. The first two, *x _{1}* and

*n*are the positive count and total count in the first sample (so the estimated value of the first proportion is

_{1}*x*out of

_{1}*n*. The next two arguments,

_{1}*x*and

_{2}*n*, are the positive count and total count in the second sample.

_{2}The output gives you a confidence interval of the form (a,b), which is the range of values for the difference π_{1}-π_{2} (where π_{1} and π_{2} are the first and second proportions respectively). If you were looking for the difference π_{2}-π_{1} all you have to do is switch two sides and negate the numbers in the interval.

# Sample Problem

You want to compare the proportion of students at your school and at a friend's school. that support a particular political candidate. You take a random sample of 50 students, and find that 22 of them support that candidate. Your friend took a random sample of 75 students at his school, and found that 28 supported the candidate.

The first proportion is the proportion of supporters at your school. 22 out of 50 students support the candidate, so *x _{1}*=22 and

*n*=50.

_{1}The second proportion is the proportion of supporters at your friend's school. 28 out of 75 students support the candidate, so

*x*=28 and

_{2}*n*=75.

_{2}If you decided to do a 95% confidence interval, you would add the argument 95 after all these, so the syntax would be as follows:

```
:2-PropZInt(22,50,28,75,95
which can also be
:2-PropZInt(22,50,28,75,.95
```

The output if you run the above code will look approximately like this:

```
1-PropZInt
(-.1092,.24249)
p1=.44
p2=.3733333333
n1=50
n2=75
```

This tells you that between about the difference betwen the proportions is between about -0.11 (your school's proportion being about 0.11 less than your friend's school's proportion) to about 0.24 (your school's proportion being about 0.24 greater than your friend's school's proportion).

# Optimization

If the confidence level is 95%, you can omit the final 95, since that is the default value:

```
:2-PropZInt(22,50,28,75,95
can be
:2-PropZInt(22,50,28,75
```

# Error Conditions

**ERR:DOMAIN**is thrown if either proportion is not between 0 and 1, or*x*is negative or greater than_{i}*n*, or the confidence level is negative or at least 100._{i}

# Related Commands

.