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 Auxillary Chapter

BINOMIAL PROPORTION TEST

Name:
    BINOMIAL PROPORTION TEST
Type:
    Analysis Command
Purpose:
    Perform a large sample hypothesis test for the equality of two binomial proportions.
Description:
    Given a set of N1 observations in a variable X1 and a set of N2 observations in a variable X2, we can compute a normal approximation test that the two proportions are equal (or alternatively, that the difference of the two proportions is equal to 0). In the following, let p1 and p2 be the population proportion of successes for samples one and two, respectively.

    The hypothesis test that the two binomial proportions are equal is

      H0: p1 = p2
      Ha: p1p2
      Test Statistic: Z = (p1hat - p2hat)/SQRT(phat*(1-phat)*((1/n1) + (1/n2)))

      where phat is the proportion of successes for the combined sample and

      phat = (n1*p1hat + n2*phat2)/(n1 + n2) = (x1 + x2)/(n1 + n2)

      Significance Level: alpha
      Critical Region: For a two-tailed test

      Z > NORPPF(1 - alpha/2)
      Z < NORPPF(alpha/2)

      For a lower tailed test

      Z < NORPPF(alpha)

      For an upper tailed test

      Z > NORPPF(1 - alpha)

      Conclusion: Reject the null hypothesis if Z is in the critical region

    Dataplot computes this test for a number of different significance levels.

Syntax 1:
    BINOMIAL PROPORTION TEST <y1> <y2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the case where you have raw data and want to perform a two-tailed test.

Syntax 2:
    BINOMIAL PROPORTION LOWER TAILED TEST <y1> <y2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the case where you have raw data and want to perform a lower tailed test.

Syntax 3:
    BINOMIAL PROPORTION UPPER TAILED TEST <y1> <y2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the case where you have raw data and want to perform a upper tailed test.

Syntax 4:
    BINOMIAL PROPORTION TEST <p1> <n1> <p2> <n2>
    where <p1> is a parameter that specifies the proportion of successes for sample 1;
                <n1> is a parameter that specifies the sample size for sample 1;
                <p2> is a parameter that specifies the proportion of successes for sample 2;
    and      <n2> is a parameter that specifies the sample size for sample 2.

    This syntax is used for the case where you have summary data and want to perform a two-tailed test.

Syntax 5:
    BINOMIAL PROPORTION LOWER TAILED TEST <p1> <n1> <p2> <n2>
    where <p1> is a parameter that specifies the proportion of successes for sample 1;
                <n1> is a parameter that specifies the sample size for sample 1;
                <p2> is a parameter that specifies the proportion of successes for sample 2;
    and      <n2> is a parameter that specifies the sample size for sample 2.

    This syntax is used for the case where you have summary data and want to perform a lower tailed test.

Syntax 6:
    BINOMIAL PROPORTION UPPER TAILED TEST <p1> <n1> <p2> <n2>
    where <p1> is a parameter that specifies the proportion of successes for sample 1;
                <n1> is a parameter that specifies the sample size for sample 1;
                <p2> is a parameter that specifies the proportion of successes for sample 2;
    and      <n2> is a parameter that specifies the sample size for sample 2.

    This syntax is used for the case where you have summary data and want to perform an upper tailed test.

Examples:
    BINOMIAL PROPORTION TEST Y1 Y2
    BINOMIAL PROPORTION TEST P1 N1 P2 N2
Note:
    For small samples, it is recommended that the Fisher exact test be used instead of this test.
Note:
    The value of the test statistic and the CDF value are saved in the internal parameters STATVAL and STATCDF, respectively. The CDF value is (Z) where is the cumulative distribution function for the standard normal distribution.

    For a lower tailed test, the p-value is equal to STATCDF. For an upper tailed test, the p-value is equal to 1 - STATCDF. For a two-tailed test, the p-value is equal to 2*(1 - STATCDF).

Default:
    None
Synonyms:
    None
Related Commands: References:
    NIST/SEMATECH e-Handbook of Statistical Methods, http://www.itl.nist.gov/div898/handbook/prc/section3/prc33.htm.

    Ryan (2008), "Modern Engineering Statistics", Wiley, pp. 124-126.

Applications:
    Categorical Data Analysis
Implementation Date:
    2008/8
Program 1:
    LET X1 = 32
    LET N1 = 38
    LET P1 = X1/N1
    LET X2 = 39
    LET N2 = 44
    LET P2 = X1/N1
    BINOMIAL PROPORTION TEST P1 N1 P2 N2
        
    The following output is generated.
               BINOMIAL TEST FOR EQUAL PROPORTIONS
                       (LARGE SAMPLE CASE)
      
     NULL HYPOTHESIS:        P1 = P2
     ALTERNATIVE HYPOTHESIS: P1 <> P2
      
     SAMPLE 1:
     NUMBER OF OBSERVATIONS                    =       38
     PROBABILITY OF SUCCESS                    =   0.8421053
      
     SAMPLE 2:
     NUMBER OF OBSERVATIONS                    =       44
     PROBABILITY OF SUCCESS                    =   0.8421053
      
     POOLED PROBABILITY OF SUCCESS            =   0.8414634
     POOLED STANDARD DEVIATION                =   0.8088560E-01
      
     TEST STATISTIC                           =    0.000000
     CDF (P-VALUE) OF TEST STATISTIC          =    1.000000
      
      
                                           NULL HYPOTHESIS   NULL
     NULL          CONFIDENCE    CRITICAL  REJECTION         HYPOTHESIS
     HYPOTHESIS    LEVEL         VALUE     INTERVAL          CONCLUSION
     ===================================================================
     P1 = P2          50.0%    +/- 0.67     (0.500,1)        REJECT
     P1 = P2          80.0%    +/- 1.28     (0.200,1)        REJECT
     P1 = P2          90.0%    +/- 1.64     (0.100,1)        REJECT
     P1 = P2          95.0%    +/- 1.96     (0.050,1)        REJECT
     P1 = P2          97.5%    +/- 2.24     (0.025,1)        REJECT
     P1 = P2          99.0%    +/- 2.58     (0.010,1)        REJECT
        

Date created: 1/23/2009
Last updated: 1/23/2009
Please email comments on this WWW page to alan.heckert@nist.gov.