 Dataplot Vol 2 Vol 1

# BINOMIAL PROPORTION

Name:
BINOMIAL PROPORTION (LET)
Type:
Let Subcommand
Purpose:
Compute the 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 case where the data consists of a sequence of 0's and 1's is referred to as the raw data case.

There may be times where we only have summary data. This case is referred to as the summary data case. The two response variables are the number of successes and the number of trials and we use the BINOMIAL RATIO command instead of the BINOMIAL PROPORTION command.

We may also sometimes be interested in the difference of two binomial proportions. The DIFFERENCE OF BINOMIAL PROPORTIONS command can be used for this case.

Syntax 1:
LET <par> = BINOMIAL PROPORTION <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed binomial proportion 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.

Syntax 2:
LET <par> = DIFFERENCE OF BINOMIAL PROPORTIONS <y1> <y2>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the first response variable;
<y2> is the second response variable;
<par> is a parameter where the computed difference of binomial proportions is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax computes the binomial proportions of <y1> and <y2> and then computes their difference. The <y1> and <y2> variables do not need to be the same length.

This is for raw data case and <y1> and <y2> should both contain a sequence of 0's and 1's.

Syntax 3:
LET <par> = BINOMIAL RATIO <ysucc> <ytrial>
<SUBSET/EXCEPT/FOR qualification>
where <ysucc> is a variable that contains the number of successes;
<ytrial> is a variable that contains the number of trials;
<par> is a parameter where the computed binomial proportion is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This is for summary data case. The and variables must contain non-negative (they will be rounded to the closest integer) values and should be of the same length.

The elements in <ysucc> and <ytrial> are summed if they have length greater than one and a single binomial proportion is returned. If they have only a single element, they must still be defined as variables rather than parameters. For example,

LET YSUCC = DATA 12
LET YTRIAL = DATA 20

defines YSUCC and YTRIAL as variables with a single row. However

LET YSUCC = 12
LET YTRIAL = 20

defines them as parameters and they cannot be used with this command.

Examples:
LET A = BINOMIAL PROPORTION Y1
LET A = BINOMIAL PROPORTION Y1 SUBSET TAG > 2
LET A = DIFFERENCE OF BINOMIAL PROPORTION Y1 Y2
Note:
Dataplot statistics can be used in a number of commands. For details, enter

These various commands are actually where the BINOMIAL PROPORTION and BINOMIAL RATIO statistics are most commonly used.

For the BINOMIAL PROPORTION and BINOMIAL RATIO statistics, the TABULATE/CROSS TABULATE commands will return the number of trials and the Agresti-Coull lower and upper confidence limits in addition to the binomial proportion.

For the BINOMIAL PROPORTION and BINOMIAL RATIO statistics, the FLUCTUATION PLOT command supports an uncertainty option based on the Agresti-Coull interval. Enter HELP FLUCTUATION PLOT for details.

Default:
None
Synonyms:
BINOMIAL PROBABILITY is a synonym for BINOMIAL PROPORTION
Related Commands:
 AGRESTI-COULL = Compute Agresti-Coull confidence limits for binomial proportions. EXACT BINOMIAL = Compute "exact" confidence limits for binomial proportions. BINOMIAL PROPORTION TEST = Perform a binomial proportions test. CROSS TABULATE = Perform a cross-tabulation for a specified statistic. FLUCTUATION PLOT = Generate a fluctuation plot.
References:
Applications:
Statistics
Implementation Date:
2008/9: DIFFERENCE OF BINOMIAL PROPORTIONS added
Program:
```
LET N = 1
LET P = 0.8
LET Y = BINOMIAL RANDOM NUMBERS FOR I = 1 1 50
LET A = BINOMIAL PROPORTION Y
```
A result of 0.78 is returned (this may vary if you have modified the seed, specified a difference random number generator or have generated random numbers earlier in your Dataplot session.

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

Date created: 10/05/2010
Last updated: 10/07/2016