*! version 0.1.0 14dec2014
help for ppssampford - version 0.1.0 - 14dec2014

Title

ppssampford -- Draw sample with probability proportionate to size without replacement, using Sampford's method.

Syntax

ppssampford [if] [in], sampsize(variable) outname(newvar) mos(variable) [strata(variable) rescale outpos(newvar) replace]

sampsize(variable) specifies a numeric variable containing, for each case, the desired sample size to be drawn within stratum.
(Note: sampsize must be uniform within stratum.)

outname(newvar) specifies the name of the output sampling variable (e.g., "sampled");
a variable will be created with this name and will be set to 1 for cases sampled, 0 for cases not sampled, and missing for cases omitted from sampling via "if" or due to missing data.

mos(variable) specifies the measure of size (MOS) to be used.
(Note: Unless you specify rescale, a case's MOS divided by the total MOS within stratum must not be greater than the sampling fraction for the stratum.
Otherwise, this would lead to a greater-than-100% probability of selection.)

Options

strata(variable) optionally specifies a numeric variable indicating the strata assignment for each case.

rescale optionally specifies that if any measures of size lead to an impossibly high probability of selection, the program should select such cases with certainty.
Then, the Sampford design (with a recalculated target sample size) should be implemented on the remaining cases.
(Note: If this option is specified, the user is strongly urged to also specify outpos(newvar), given that the probability of selection will no longer be proportional to the original MOS.)

outpos(newvar) optionally specifies a new variable that should be created containing a given case's probability of selection (i.e., first order inclusion probability).

replace optionally specifies that if any variables already exist with the names specified by outname(newvar) and/or rescale (if applicable), they should be replaced.

Description of Program

ppssampford implements Sampford's method of selecting samples with inclusion probability proportionate to size, without replacement (PPSWOR). Sampford (1967) provides details.

Summary of Sampford's Method

Sampford's method is a probability proportionate to size sampling procedure without replacement.
There are several algorithms for implementing Sampford sampling designs (e.g., see Tillé, 2006; also see Grafström, 2008).
This particular program implements Sampford's original algorithm, described by Tillé (2006) as a multinomial rejective procedure:

1. Select one case with probability proportionate to size with replacement (PPSWR) sampling with probability proportionate to the initial MOS.

2. Select n-1 cases with PPSWR based on a MOS that has been recalculated as lambda[i] = p[i]/(1-n*p[i]), where p[i] = MOS[i]/summation(MOS[i], for i=1/N);
i.e., p[i] equals the measure of size for a particular case divided by the sum of all measures of size.

3. Combine the samples from (1) and (2). If no cases have been selected more than once, keep the sample, otherwise repeat steps (1) through (3).

Benefits of Sampford's method are that it allows for the selection of PPSWOR samples for a fixed sample size, and allows for positive second-order inclusion probabilities, which are necessary for unbiased variance estimates;
however, a drawback of rejective Sampford algorithms is that they can be slow.
The algorithm can be particularly slow when a high sampling fraction is used and/or when a case has a probability of selection of just below 100%.
However, Grafström's paper provides a non-rejective algorithm for implementing the Sampford design, which I plan to incorporate into a subsequent version of this program.

On Sampling Without Replacement When the MOS Leads to an Impossibly High Probability of Selection

As noted in the description for the mos option, a problematic scenario can sometimes occur in which the measure of size leads to an impossibly high probability of selection (i.e., greater than 100%).
A practical situation in which this can commonly occur is that in which a high sampling fraction is used for a particular stratum.
For example, assume 400 cases are to be sampled from a population of 500, and 250 cases have a MOS of 1, and the other 250 cases have a MOS of 2.
This would lead to 133 cases sampled from the first group and 267 cases sampled from the second group, which is impossible since the second group only contains 250 population members.

A simple recursive solution can be employed in this situation, assuming that the number of cases to be sampled in the stratum does not exceed the stratum population size.
First, determine whether any cases have a MOS that will lead to a probability of selection greater than 100%. Select these cases with certainty.
Second, for each stratum, reduce the number of cases to be sampled by the number that were selected in the previous step, and remove these cases from the sampling universe so that they cannot be selected again.
Repeat the previous two steps until no remaining cases are sampled with certainty, and then employ Sampford's algorithm on the remaining cases.
The set of cases to be sampled is the union of the set of cases sampled with certainty and the set of cases sampled without certainty.

In the previous example, this would lead to the 250 cases with a MOS of 2 being selected with certainty. Then, 150 cases would be sampled from the remaining 250 cases.

This algorithm has been implemented via the rescale option.

Technical Notes

-If the strata or mos options are specified, cases with missing data on either of these two variables are omitted from the analysis, though a warning is displayed.

-This is a beta version of a program implementing the Sampford algorithm.
While it seems to be operating correctly, the author urges users to verify that it is operating as intended and to email him with any bug reports.
Note that ppschromy is a PPSWOR program by the same author that has been thoroughly tested, though it has different properties for the joint inclusion probabilities.

To-Do List

Possible modifications that may be made for future versions include:

-Conduct additional testing prior to a v1.0.0 release;

-Implement a non-rejective version of Sampford's algorithm, to improve program speed;

-Add an option for the computation of the second-order probabilities of inclusion.

References

Grafström, A. (2009). Non-rejective implementations of the Sampford sampling design. Journal of Statistical Planning and Inference, 139(6), 2111-2114.

Sampford, M. R. (1967). On sampling without replacement with unequal probabilities of selection. Biometrika, 54(3-4), 499-513.

Tillé, Y. (2006). Sampling Algorithms. Springer.

Author

Jonathan Mendelson, Fors Marsh Group, jmendelson@forsmarshgroup.com.

The author welcomes any comments or questions.