SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Contacts SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Chapter 2

AGRESTI COULL

Name:
    AGRESTI COULL (LET)
Type:
    Let Subcommand
Purpose:
    Compute either the lower or upper Agresti-Coull 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 a method recommended by Agresti and Coull and also by Brown, Cai and DasGupta (the methodology was originally developed by Wilson in 1927). This method solves for the two values of p0 (say, pupper and plower)) that result from setting z = z(alpha/2) and solving for p0 = pupper, and then setting z = -z(alpha/2 and solving for p0 = plower where z(alpha/2) denotes the variate value from the standard normal distribution such that the area to the right of the value is alpha/2. The solution for the two values of p0 results in the following confidence intervals:

      $

      $

    This approach can be substantiated on the grounds that it is the exact algebraic counterpart to the (large-sample) hypothesis test and is also supported by the research of Agresti and Coull. One advantage of this procedure is that its worth does not strongly depend upon the value of n and/or p, and indeed was recommended by Agresti and Coull for virtually all combinations of n and p.

    Another advantage is that the limits are in the (0,1) interval. This is not true for the frequently used normal approximation:

      phat +/- z(alpha/2)*SQRT[(phat*(1-phat))/n]

    A one-sided confidence interval can also be constructed simply by replacing each z(alpha/2) by z(alpha) in the expression for the lower or upper limit, whichever is desired.

Syntax 1:
    LET <par> = TWO-SIDED LOWER AGRESTI COULL <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 Agresti-Coull interval.

Syntax 2:
    LET <par> = TWO-SIDED UPPER AGRESTI COULL <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 Agresti-Coull interval.

Syntax 3:
    LET <par> = ONE-SIDED LOWER AGRESTI COULL <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 one-sided lower tailed Agresti-Coull interval.

Syntax 4:
    LET <par> = ONE-SIDED UPPER AGRESTI COULL <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 Agresti-Coull interval.

Examples:
    LET A = TWO-SIDED LOWER AGRESTI COULL Y1
    LET A = TWO-SIDED UPPER AGRESTI COULL Y1
    LET A = ONE-SIDED LOWER AGRESTI COULL Y1
    LET A = ONE-SIDED UPPER AGRESTI COULL Y1
    LET A = TWO-SIDED LOWER AGRESTI COULL Y1 SUBSET TAG > 2
Note:
    To specify the signficance level to use for the Agresti-Coull 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

      HELP STATISTICS

    These various commands are actually where the AGRESTI COULL statistics are most commonly used.

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

      LET AL AU = AGRESTI COULL 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 command, enter

      HELP AGRESTI COULL CONFIDENCE LIMITS
Default:
    None
Synonyms:
    None
Related Commands: References:
    Agresti, A. and Coull, B. A. (1998), "Approximate is better than "exact" for interval estimation of binomial proportions", The American Statistician, 52(2), 119-126.

    Brown, L. D. Cai, T. T. and DasGupta, A. (2001), "Interval estimation for a binomial proportion," Statistical Science, 16(2), 101-133.

Applications:
    Statistics
Implementation Date:
    2010/3
Program:
     
    LET N = 1
    LET P = 0.8
    LET ALPHA = 0.95
    LET Y = BINOMIAL RANDOM NUMBERS FOR I = 1 1 50
    LET AL = ONE SIDED LOWER AGRESTI COULL Y
    LET AU = ONE SIDED LOWER AGRESTI COULL Y
    LET BL = TWO SIDED LOWER AGRESTI COULL Y
    LET BU = TWO SIDED LOWER AGRESTI COULL Y
    PRINT AL AU BL BU
        
    The following output is generated.
    AL      --  0.6706774E+00
    AU      --  0.8605760E+00
    BL      --  0.6475845E+00
    BU      --  0.8724608E+00
        

Date created: 10/5/2010
Last updated: 10/5/2010
Please email comments on this WWW page to alan.heckert@nist.gov.