FNLStat : Sampling : SMPSC
SMPSC
Computes statistics for inferences regarding the population mean and total using single stage cluster sampling with continuous data.
Required Arguments
NROWS — Vector of length NCLSTR in which NROWS(I) is the number of items from the I‑th cluster currently input in Y. (Input)
Each element of NROWS may be positive, zero, or negative. A negative value for NROWS(I) means delete the ‑NROWS(I) elements of the I‑th cluster in Y from the analysis.
Y — Vector containing the cluster sample. (Input)
The observations within any one cluster must appear contiguously in Y. The first NROWS(1) elements of Y are from the first cluster, and so on.
NCLPOP — Number of clusters in the sampled population. (Input)
NPOP — Number of elements in the population (sum of all the cluster sizes in the population). (Input)
NPOP is not required when IOPT = 3.
CLMEAN — Vector of length NCLSTR containing the cluster means. (Output, if IDO = 0 or 1; Input/Output, if IDO = 2 or 3.)
CLVAR — Vector of length NCLSTR containing the within‑cluster variances. (Output, if IDO = 0 or 1; Input/Output, if IDO = 2 or 3.)
NSAMPS — Vector of length NCLSTR containing the number of nonmissing observations from each cluster. (Output, if IDO = 0 or 1; Input/Output, if IDO = 2 or 3.)
STAT — Vector of length 11 containing the resulting statistics. (Output, if IDO = 0 or 1; Input/Output, if IDO = 2 or 3.)
These are:
I
STAT(I)
1
Estimate of the mean.
2
Estimate of the total.
3
Variance estimate of the mean estimate.
4
Variance estimate of the total estimate.
5
Lower confidence limit for the mean.
6
Upper confidence limit for the mean.
7
Lower confidence limit for the total.
8
Upper confidence limit for the total.
9
Estimate (expressed as a percentage) of the coefficient of variation of the mean and total estimate.
10
The total sample size.
11
The number of missing values.
Optional Arguments
IDO — Processing option. (Input)
Default: IDO = 0.
IDO
Action
0
This is the only invocation of SMPSC for this data set, and all the data are input at once.
1
This is the first invocation, and additional calls to SMPSC will be made. Initialization and updating for the data in Y are performed.
2
This is an intermediate invocation of SMPSC and updating for the data in Y is performed.
3
This is the final invocation of this routine. Updating for the data in Y and wrap‑up computations are performed.
NCLSTR — Number of clusters into which the sample is divided. (Input)
In the vectors of length NCLSTR, the elements are all ordered in the same way. That is, the first cluster is always the first, the second always the second, and so on.
Default: NCLSTR = size (NROWS,1).
IOPT — Estimation option. (Input)
Default: IOPT = 0.
IOPT
Action
0
Ratio‑to‑size estimation is used.
1
Unbiased estimation is used.
2
Probability‑proportional‑to‑size estimation is used and all clusters in population are of known size.
3
Probability‑proportional‑to‑size estimation is used and the cluster sizes are known only approximately or a measure of cluster size other than the number of elements per cluster is to be used.
SIZE — If IOPT = 3, vector of length NCLSTR containing a measure of cluster size for each cluster in the sample. (Input)
The sampled cluster size measures must be ordered in correspondence with the ordering of clusters in Y. SIZE is required only when IOPT = 3.
TSIZE — If IOPT = 3, measure of total size of all clusters in the population. (Input)
TSIZE is required only when IOPT = 3.
Default: TSIZE = 1.0.
CONPER — Confidence level for two‑sided interval estimate, 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).
Default: CONPER = 95.0.
FORTRAN 90 Interface
Generic: CALL SMPSC (NROWS, Y, NCLPOP, NPOP, CLMEAN, CLVAR, NSAMPS, STAT [])
Specific: The specific interface names are S_SMPSC and D_SMPSC.
FORTRAN 77 Interface
Single: CALL SMPSC (IDO, NCLSTR, NROWS, Y, IOPT, NCLPOP, NPOP, SIZE, TSIZE, CONPER, CLMEAN, CLVAR, NSAMPS, STAT)
Double: The double precision name is DSMPSC.
Description
Routine SMPSC computes point and interval estimates for the population mean and total from a single‑stage cluster sample. The routine uses the standard methods discussed in Chapters 9 and 9A of Cochran (1977). The sample means for the individual clusters are accumulated in CLMEAN, and the corrected sums of squares are accumulated in CLVAR. In the postprocessing phase, the quantities in STAT are computed using the cluster statistics in CLMEAN, CLVAR, and NSAMPS. The parameters IDO and NROWS allow either all or part of the data to be brought in at one time.
Following the notation of Cochran (1977), let N be the number of clusters in the population, let Mi be the number of elements in the i‑th cluster unit, let M0 be the total number of elements in the population, let yij be the j‑th element in the i‑th cluster, and let n be the number of clusters in the sample. Any of three different estimators of the population total may be useful. An unbiased estimate of the total is
The ratio‑to‑size estimate is
The probability‑proportional‑to‑size estimate is
The confidence limits for the mean and total are computed using the normal approximation.
Example
In this example, we have a sample of two clusters from a population that contains 20 clusters. The sizes of the clusters in the sample are four and six, and there is a total of 100 elements in the population.
 
USE SMPSC_INT
USE UMACH_INT
 
IMPLICIT NONE
INTEGER NCLSTR
PARAMETER (NCLSTR=2)
!
INTEGER NCLPOP, NOUT, NPOP, NROWS(NCLSTR), NSAMPS(NCLSTR)
REAL CLMEAN(NCLSTR), CLVAR(NCLSTR), SIZE(NCLSTR), &
STAT(11), TSIZE, Y(10)
!
DATA Y/2.7, 5.1, 4.3, 2.8, 1.9, 6.2, 4.8, 5.1, 7.2, 6.5/
!
NCLPOP = 20
NPOP = 100
! All data are input at once.
NROWS(1) = 4
NROWS(2) = 6
CALL SMPSC (NROWS, Y, NCLPOP, NPOP, CLMEAN, CLVAR, NSAMPS, STAT)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) STAT
99999 FORMAT (' Mean estimate = ', F8.3, ' Total estimate = ', &
F8.1, /, ' Vhat of mean = ', F8.3, ' Vhat of total ' &
, ' = ', F8.1, /, ' Confidence limits for mean ', F8.3, &
',', F8.3, /, ' Confidence limits for total ', F8.1, &
',', F8.1, /, ' C. V. = ', F8.1, '%', /, &
' Sample size = ', F8.0, ' Number missing = ', &
F8.0)
END
Output
 
Mean estimate = 4.660 Total estimate = 466.0
Vhat of mean = 0.504 Vhat of total = 5035.5
Confidence limits for mean 3.269, 6.051
Confidence limits for total 326.9, 605.1
C. V. = 15.2%
Sample size = 10. Number missing = 0.
Published date: 03/19/2020
Last modified date: 03/19/2020