SMPPR
Computes statistics for inferences regarding the population proportion and total given proportion data from a simple random sample.
Required Arguments
NINT — Number of sample units in the class of interest, for the population (or subpopulation) of interest. (Input)
NSAMP — Number of units in the entire random sample. (Input)
NPOP — Number of units in the population. (Input)
CONPER — Confidence level for two‑sided interval estimates, in percent. (Input)
A CONPER percent confidence interval is computed; hence, CONPER must be greater than or equal to 0.0 and less than 100.0. CONPER is often 90.0, 95.0, or 99.0. For a one‑sided confidence interval with confidence level ONECL, set CONPER = 100.0 ‑ 2.0 * (100.0 ‑ ONECL).
STAT — Vector of length 10 containing the resulting statistics. (Output)
These are:
I | STAT(I) |
---|
1 | Estimate of the proportion. |
2 | Estimate of the total. |
3 | Variance estimate of the proportion estimate. |
4 | Variance estimate of the total estimate. |
5 | Lower confidence limit for the proportion. |
6 | Upper confidence limit for the proportion. |
7 | Lower confidence limit for the total. |
8 | Upper confidence limit for the total. |
9 | Estimate (expressed as a percentage) of the coefficient or variation of the total estimate. Not defined if NINT = 0. |
10 | Indicator of the distribution used to approximate the hypergeometric distribution for the confidence interval calculations. If STAT(10) = 0, then the normal is used. If STAT(10) = 1, then the Poisson is used. If STAT(10) = 2, then the binomial is used. |
FORTRAN 90 Interface
Generic: CALL SMPPR (NINT, NSAMP, NPOP, CONPER, STAT)
Specific: The specific interface names are S_SMPPR and D_SMPPR.
FORTRAN 77 Interface
Single: CALL SMPPR (NINT, NSAMP, NPOP, CONPER, STAT)
Double: The double precision name is DSMPPR.
Description
The routine SMPPR computes point and interval estimates for the population proportion and total from a simple random sample. The simplest and most common case for which this routine is appropriate is one in which the population sampled contains two or more classes, and it is desired to estimate the proportion of the population falling into a particular class (“class of interest”). The data required by SMPPR consist of counts of the number of sample items in the class of interest, the sample size, and the population size. If there are more than two classes in the population, some of the classes may not be of interest.
Since the hypergeometric distribution is the appropriate probability model for the sampling for proportions in a finite population without replacement, exact confidence limits could be computed using that distribution. For populations with sizes that occur in practice (more than a hundred, often in the thousands or even millions), the confidence limits can be approximated very well by use of the normal, the binomial, or the Poisson distribution. Routine SMPPR uses one of these distributions in setting confidence limits, following the guidelines in the table on page 58 of Cochran (1977).
Examples
Example 1
The first example is from Cochran (1977, page 52). A simple random sample of size 200 was drawn from a list of 3042 names and addresses. Verification of the addresses in the sample showed 38 to be wrong. The objective is to estimate the total number of incorrect addresses.
USE UMACH_INT
USE SMPPR_INT
INTEGER NINT, NOUT, NPOP, NSAMP
REAL CONPER, SQRT, STAT(10), STDP, STDT
INTRINSIC SQRT
!
CALL UMACH (2, NOUT)
NINT = 38
NSAMP = 200
NPOP = 3042
CONPER = 0.0
CALL SMPPR (NINT, NSAMP, NPOP, CONPER, STAT)
STDP = SQRT(STAT(3))
STDT = SQRT(STAT(4))
WRITE (NOUT,99999) STAT(1), STAT(2), STDP, STDT, STAT(9)
99999 FORMAT (' Estimate of proportion bad: ', F5.3, /,&
' Estimate of total bad: ', F5.0, /, &
' Standard deviation estimate, proportion: ', F5.3, /, &
' Standard deviation estimate, total: ', F5.1, /, &
' Coefficient of variation: ', F5.1,'%')
END
Output
Estimate of proportion bad: 0.190
Estimate of total bad: 578.
Standard deviation estimate, proportion: 0.027
Standard deviation estimate, total: 81.8
Coefficient of variation: 14.1%
Example 2
The next example is also from Cochran (1977, page 68). A simple random sample of size 200 from 2000 colleges showed 120 colleges to be in favor of a certain proposal, 57 to be opposed, and 23 to have no opinion. We wish to estimate the number of colleges, out of the 2000, that favor the proposal.
USE UMACH_INT
USE SMPPR_INT
IMPLICIT NONE
INTEGER NINT, NOUT, NPOP, NSAMP
REAL CONPER, STAT(10)
!
CALL UMACH (2, NOUT)
NINT = 120
NSAMP = 200
NPOP = 2000
CONPER = 95.0
CALL SMPPR (NINT, NSAMP, NPOP, CONPER, STAT)
WRITE (NOUT,99999) STAT(2), STAT(7), STAT(8)
99999 FORMAT (' Estimate of number in favor: ', F5.0, /, ' 95% ', &
'confidence interval: (', F5.0, ',', F5.0, ')')
END
Output
Estimate of number in favor: 1200.
95% confidence interval: (1066.,1334.)