Introduction to Research Design and Statistics

Testing Proportions


Inference for a Single Proportion

  • Sample Proportion

    also

  • Population Proportion

  • Standard Error of a Proportion

    z-test for a Single Proportion

    Margin of Error for a Proportion

    margin of error = sp*CVz

    For example, the margin of error for a 95% confidence interval for p = .5 with 1000 observations is,

    sqrt(.5*(1-.5)/1000)*1.96 = .031

    That is, the margin of error is about 3%. This is how the margin of error you read about in the newspapers for public opinion polling is calculated.

    Confidence Interval for a Single Proportion

    Single Sample z-test Example

    A coin is tossed 4040 times with 2048 heads. Is it a fair coin?

    Stata Example

    prtesti 4040 .5069 .5
    
    One-sample test of proportion                      x: Number of obs =     4040
    ------------------------------------------------------------------------------
        Variable |       Mean   Std. Err.                     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               x |      .5069   .0078657                      .4914835    .5223165
    ------------------------------------------------------------------------------
        p = proportion(x)                                             z =   0.8771
    Ho: p = 0.5
    
         Ha: p < 0.5                 Ha: p != 0.5                   Ha: p > 0.5
     Pr(Z < z) = 0.8098         Pr(|Z| > |z|) = 0.3804          Pr(Z > z) = 0.1902
    Confidence Interval Example

    Construct a 95% confidence interval on the preceding example.

    Stata Example

    cii 4040 2048
    
                                                       -- Binomial Exact --
    Variable |     Obs         Mean    Std. Err.       [95% Conf. Interval]
    ---------+-------------------------------------------------------------
             |    4040     .5069307    .0078657        .4913908    .5224614
    
    Comparing Two Independent Proportions

  • Pooled Proportions

  • Standard Error for Pooled Proportions

    z-test for Comparing Two Independent Proportions

    Two Independent Sample z-test Example

    In a survey of high school seniors, how many have taken any AP math classes.

    GroupnFrequencyp
    Urban261
    127
    0.487
    Rural160
    65
    0.400

    Is the proportion of urban seniors significantly different from rural seniors?

    Stata Example

    prtesti 261 .487 160 .4
    
    Two-sample test of proportion                      x: Number of obs =      261
                                                       y: Number of obs =      160
    ------------------------------------------------------------------------------
        Variable |       Mean   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               x |       .487   .0309388                      .4263611    .5476389
               y |         .4   .0387298                      .3240909    .4759091
    -------------+----------------------------------------------------------------
            diff |       .087   .0495702                     -.0101558    .1841558
                 |  under Ho:   .0499896     1.74   0.082
    ------------------------------------------------------------------------------
            diff = prop(x) - prop(y)                                  z =   1.7404
        Ho: diff = 0
    
        Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
     Pr(Z < z) = 0.9591         Pr(|Z| < |z|) = 0.0818          Pr(Z > z) = 0.0409
    Confidence Interval for Differences in Two Independent Proportions

  • Difference in Proportions

  • Standard Error of Differences

  • Confidence Interval Formula

    Confidence Interval Example

    In a survey of high school seniors, how many have taken any AP math classes.

    GroupnFrequencyp
    Urban261
    127
    0.487
    Rural160
    65
    0.400

    Construct a 95% confidence interval for the difference in these two independent proportions.

    Stata Example (same as above)

    prtesti 261 .487 160 .4
    
    Two-sample test of proportion                      x: Number of obs =      261
                                                       y: Number of obs =      160
    ------------------------------------------------------------------------------
        Variable |       Mean   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               x |       .487   .0309388                      .4263611    .5476389
               y |         .4   .0387298                      .3240909    .4759091
    -------------+----------------------------------------------------------------
            diff |       .087   .0495702                     -.0101558    .1841558
                 |  under Ho:   .0499896     1.74   0.082
    ------------------------------------------------------------------------------
            diff = prop(x) - prop(y)                                  z =   1.7404
        Ho: diff = 0
    
        Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
     Pr(Z < z) = 0.9591         Pr(|Z| < |z|) = 0.0818          Pr(Z > z) = 0.0409


    Intro Home Page

    Phil Ender, 23nov05, 20Jun00