Dataplot Vol 2 Vol 1

# BINOMIAL PRODUCT CONFIDENCE LIMITS

Name:
BINOMIAL PRODUCT CONFIDENCE LIMITS (LET)
Type:
Let Subcommand
Purpose:
Compute the standard error and confidence limits for the product of two binomial proportions.
Description:
Given two binomial proportions, p1 and p2, with associated sample sizes, n1 and n2, the formula for the confidence interval for the product p1*p2 is

-1 denoting the normal percent point function and SE denoting the standard error of p1*p2.

In the above formula, we actually use the Bayes estimators of p1 and p2:

with V and U denoting the number of successes in the binomial trials.

Syntax:
LET <se> <lowlim> <upplim> = BINOMIAL PRODUCT CONFIDENCE LIMITS
<p1> <n1> <p2> <n2> <alpha>
<SUBSET/EXCEPT/FOR qualification>
where <p1> is constant, parameter, or variable that contains the proportion of successes for the first sample;
<n1> is constant, parameter, or variable that contains the number of trials for the first sample;
<p2> is constant, parameter, or variable that contains the proportion of successes for the second sample;
<n2> is constant, parameter, or variable that contains the number of trials for the second sample;
<alpha> is constant or parameter that contains the significance level;
<se> is a variable that contains the standard error of the computed product (p1*p2);
<lowlim> is a variable that contains the computed lower confidence limit;
<upplim> is a variable that contains the computed upper confidence limit;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

The <p1> <n1> <p2> and <n2> arguments can be either parameters or variables. If they are variables, then the variables must have the same number of elements. The <alpha> argument is always assumed to be either a constant or a parameter.

If <p1> <n1> <p2> and <n2> are all parameters, then <se>, <lowlim>, and <upplim> will be parameters. Otherwise, they will be variables.

Examples:
LET SE AL AU = BINOMIAL PRODUCT CONFIDENCE LIMITS ...
P1 N1 P2 N2 ALPHA
Note:
If you would like to use this command on raw data (i.e., you have variables containing a sequence of 0's and 1's), do something like the following

LET YSUM1 = SUM Y1
LET N1 = SIZE Y1
LET P1 = YSUM1/N1
LET YSUM2 = SUM Y2
LET N2 = SIZE Y2
LET P2 = YSUM2/N2
LET SE AL AU = BINOMIAL PRODUCT CONFIDENCE LIMITS ...
P1 N1 P2 N2 ALPHA

If you have group-id variables (X1 and X2), you would do something like

SET LET CROSS TABULATE COLLAPSE
LET YSUM1 = CROSS TABULATE SUM Y1 X1
LET N1 = CROSS TABULATE SIZE Y1 X1
LET P1 = YSUM1/N1
LET YSUM2 = CROSS TABULATE SUM Y2 X2
LET N2 = CROSS TABULATE SIZE Y2 X2
LET P2 = YSUM2/N2
LET SE AL AU = BINOMIAL PRODUCT CONFIDENCE LIMITS ...
P1 N1 P2 N2 ALPHA

In this case, P1, N1, P2, and N2 are now variables rather than parameters.

Default:
None
Synonyms:
None
Related Commands:
 BINOMIAL RATIO CONF LIMITS = Compute confidence limits for the ratio of two binomial proportions. AGRESTI-COULL CONFIDENCE LIMITS = Compute Agresti-Coull confidence limits for binomial proportions. EXACT BINOMIAL CONFIDENCE LIMITS = Compute exact binomial confidence limits for binomial proportions. AGRESTI-COULL = Compute Agresti-Coull confidence limits statistic for binomial proportions. EXACT BINOMIAL = Compute the "exact" confidence limits statistic for binomial proportions. BINOMIAL PROPORTION = Compute the binomial proportion statistic. BINOMIAL PROPORTION TEST = Perform a binomial proportions test. CROSS TABULATE = Perform a cross-tabulation for a specified statistic.
Reference:
Private communication with Andrew Ruhkin and Bill Strawderman.
Applications:
Statistics
Implementation Date:
2010/07
Program:
```
LET P1 = 8/12
LET N1 = 12
LET P2 = 7/8
LET N2 = 8
LET ALPHA = 0.95
.
LET BPROD = P1*P2
LET SE LOWLIM UPPLIM = BINOMIAL PRODUCT CONFIDENCE LIMIT ...
P1 N1 P2 N2 ALPHA
```
The values of SE, LOWLIM, and UPPLIM are 0.14325, 0.26411, and 0.8256, respectively.

Date created: 10/5/2010
Last updated: 10/5/2010