Dataplot Vol 2 Vol 1

# EXACT BINOMIAL

Name:
EXACT BINOMIAL (LET)
Type:
Let Subcommand
Purpose:
Compute either the lower or upper exact binomial confidence limit for either a one-sided or a two-sided binomial proportion of a variable.
Description:
The binomial proportion is defined as the number of successes divided by the number of trials.

In this context, we define success as "1" and failure as "0". Dataplot actually allows any two distinct values to be used. However, the larger value will always be considered "success" and the smaller value will always be considered "failure". If the variable contains more than two distinct values, an error is reported.

The BINOMIAL PROPORTION command is used to compute a point estimate of the probability of success. Confidence intervals for the binomial proportion can be computed using one of the following methods:

1. the most common method is based on the normal approximation

$$\hat{p} \pm z_{\alpha/2}\sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$

2. the Agresti-Coull method (HELP AGRESTI COULL for details) In most cases, this is the recommended method to use.

3. an exact method based on the binomial distribution. This is the method discussed here.

If either the number of failures or the sample size is small, the commonly used symmetrical confidence limits based on the normal approximation may not be accurate enough. In that case, the following exact method can be used.

1. Solve the equation

$$\mbox{BINCDF}(x;p_{u},n) = \alpha/2$$

for pu to obtain the upper 100(1 - $$\alpha$$ )% limit for p where BINCDF is the cumulative distribution function of the binomial distribution, x is the number of successes, and n is the number of trials.

2. Next solve the equation

$$\mbox{BINCDF}(x-1;p_{l},n) = 1 - \alpha/2$$

for pl to obtain the lower 100(1 - $$\alpha$$ )% limit for p.

Note that these intervals are not symetric about p.

One-sided intervals can be computed by replacing $$z_{\alpha/2}$$ by $$z_{\alpha}$$ in the above equations.

Syntax 1:
LET <par> = TWO-SIDED LOWER EXACT BINOMIAL <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is for raw data case and <y> should contain a sequence of 0's and 1's. This returns the lower confidence limit for the two-sided exact binomial interval.

Syntax 2:
LET <par> = TWO-SIDED UPPER EXACT BINOMIAL <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is for raw data case and <y> should contain a sequence of 0's and 1's. This returns the upper confidence limit for the two-sided exact binomial interval.

Syntax 3:
LET <par> = ONE-SIDED LOWER EXACT BINOMIAL <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is for raw data case and should contain a sequence of 0's and 1's. This returns the lower confidence limit for the one-sided lower tailed exact binomial interval.

Syntax 4:
LET <par> = ONE-SIDED UPPER EXACT BINOMIAL <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is for raw data case and <y> should contain a sequence of 0's and 1's. This returns the upper confidence limit for the one-sided upper tailed exact binomial interval.

Examples:
LET A = TWO-SIDED LOWER EXACT BINOMIAL Y1
LET A = TWO-SIDED UPPER EXACT BINOMIAL Y1
LET A = ONE-SIDED LOWER EXACT BINOMIAL Y1
LET A = ONE-SIDED UPPER EXACT BINOMIAL Y1
LET A = TWO-SIDED LOWER EXACT BINOMIAL Y1 SUBSET TAG > 2
Note:
To specify the signficance level to use for the exact binomial limits, enter the command

LET ALPHA = <value>

The default value of alpha is 0.95.

Note:
Dataplot statistics can be used in a number of commands. For details, enter

These various commands are actually where the EXACT BINOMIAL statistics are most commonly used.

Note:
In addition to the commands given here, the following commands are also available:

LET AL = EXACT BINOMIAL CONFIDENCE LIMITS P N ALPHA
LET AL = EXACT BINOMIAL LOWER LIMITS P N ALPHA
LET AU = EXACT BINOMIAL UPPER LIMITS P N ALPHA

This command is a Math Let Subcommand rather than a Statistics LET Subcommand. The distinctions are:

1. The "Statistics" version of the command returns a single parameter value while the "Math" version of the command returns two variables.

2. The "Statistics" version of the command can be used with a number of other commands (see the Note above) while the "Math" version of the command cannot.

For example, the "Statistics" version of the command is most typically used with the FLUCTUATION PLOT, CROSS TABULATE, and STATISTIC PLOT commands.

3. The "Statistics" version of the command expects a single variable (containing a sequence of 1's and 0's). The "Math" version expects summary data (i.e., P and N). The P and N can be either constants, parameters, or variables (or even a mix of these).

Which form of the command to use is determined by the context of what you are trying to do.

For details on the "Math" version of the commands, enter

Default:
None
Synonyms:
None
Related Commands:
 EXACT BINOMIAL CONFIDENCE LIMITS = Compute exact binomial confidence limits for binomial proportions. AGRESTI COULL = Compute the Agresti Coull confidence limits statistic for binomial proportions. AGRESTI COULL CONFIDENCE LIMITS = Compute Agresti-Coull confidence limits 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. FLUCTUATION PLOT = Generate a fluctuation plot. STATISTIC PLOT = Generate a statistic versus subset plot.
Reference:
Applications:
Statistics
Implementation Date:
2008/3
Program:

LET N = 1
LET P = 0.8
LET ALPHA = 0.95
LET Y = BINOMIAL RANDOM NUMBERS FOR I = 1 1 50
LET EL = ONE SIDED LOWER EXACT BINOMIAL Y
LET EU = ONE SIDED LOWER EXACT BINOMIAL Y
LET EL = TWO SIDED LOWER EXACT BINOMIAL Y
LET EU = TWO SIDED LOWER EXACT BINOMIAL Y

The following output is generated.
AL      --  0.6622259E+00
AU      --  0.8714431E+00
BL      --  0.7718925E+00
BU      --  0.7844336E+00


NIST is an agency of the U.S. Commerce Department.

Date created: 10/05/2010
Last updated: 11/16/2015