toy <- tibble(
household = letters[1:8],
village = rep(c("A", "B"), each = 4),
compound = rep(1:4, each = 2),
children = c(1, 2, 2, 3, 4, 5, 5, 6)
)
toy
#> # A tibble: 8 × 4
#> household village compound children
#> <chr> <chr> <int> <dbl>
#> 1 a A 1 1
#> 2 b A 1 2
#> 3 c A 2 2
#> 4 d A 2 3
#> 5 e B 3 4
#> 6 f B 3 5
#> 7 g B 4 5
#> 8 h B 4 64 Probability sampling in one chapter
A survey interviews a few thousand households and publishes figures for millions of people. This works because every household had a known chance of being selected. This chapter states the few ideas that make it work, on a population small enough to list every sample a design could draw. Each formula can then be checked against the full list. The chapters that follow use these ideas on The Gambia.
4.1 Population, frame and units
The population is the set of units the survey describes. For the Gambia DHS it is the households of the country and the people who live in them. The frame is the list from which the sample is selected. No list of all households exists, so the frame is a list of areas, the EAs of the census, each with a count of its households. A household is reached through its EA.
A household survey therefore works with several kinds of units. The primary sampling unit (PSU) is what the first stage selects, an EA or a group of small EAs. The household is selected at the second stage. The unit of an indicator can be a third, reached through the household: a woman aged 15 to 49 for mCPR, or a child aged 12 to 23 months for vaccination.
Coverage is the match between the frame and the population. Households built since the census, or living in areas left off the frame, have no chance of selection. No estimator can bring them back. Chapter 5 discusses how to keep coverage high, and Chapter 16 what is lost when areas are excluded.
4.2 A population to enumerate
Eight households live in two villages, four in each, and each village has two compounds of two households. The variable is the number of children under five.
The population mean is 3.5 children per household. The households of a compound are alike, and the two villages differ. These two features drive everything that follows.
4.3 Inclusion probabilities and weights
A design is a rule that gives every possible sample a probability of being selected. The inclusion probability of a unit is the sum of the probabilities of the samples that contain it.
The inclusion probability \(\pi_k\) of unit \(k\) is the probability that the design selects it. Its design weight is \[ w_k = \frac{1}{\pi_k}, \] the number of population units it stands for.
Suppose the survey takes three households in village A and one in village B. A household of A has a probability of 3/4 and a weight of 4/3. A household of B has a probability of 1/4 and a weight of 4. samplyr computes the weights when it draws.
disproportionate <- sampling_design() |>
stratify_by(village) |>
draw(n = data.frame(village = c("A", "B"), n = c(3, 1)))
execute(disproportionate, toy, seed = 1) |>
as.data.frame() |>
select(household, village, children, .weight)
#> Stage 1: 1 stratum takes a single unit outside certainty.
#> ℹ Strata with one unit: "B".
#> ℹ A stratum needs two selections for its variance to be
#> estimated. survey stops on a stratum with one unless its
#> strata are collapsed, and a replicate method has nothing to
#> resample in it.
#> ℹ To estimate within each stratum, allocate at least two units
#> outside certainty to it. `min_n` bounds a stratum's whole
#> take, certainty units included.
#> household village children .weight
#> 1 a A 1 1.333333
#> 2 c A 2 1.333333
#> 3 d A 3 1.333333
#> 4 f B 5 4.000000The weights add up to 8, the size of the population. samplyr also warns that village B has a single selected household, which leaves its variance impossible to estimate, a point Chapter 10 returns to.
4.4 The Horvitz-Thompson estimator
The Horvitz-Thompson estimator of the total \(Y = \sum_k y_k\) and the Hajek estimator of the mean are \[ \hat Y = \sum_{k \in s} w_k \, y_k, \qquad \hat{\bar Y} = \frac{\sum_{k \in s} w_k \, y_k}{\sum_{k \in s} w_k}. \] Over all the samples a design can draw, \(\hat Y\) averages to \(Y\). It is unbiased whatever the inclusion probabilities, as long as none is zero.
The disproportionate design can draw 4 times 4 = 16 samples, each with probability 1/16. Listing them shows what the weights do.
true_mean <- mean(toy$children)
y <- toy$children
w <- ifelse(toy$village == "A", 4 / 3, 4)
samples <- expand.grid(a = seq_len(4), b = 5:8)
estimates <- t(apply(samples, 1, \(s) {
idx <- c(setdiff(1:4, s[["a"]]), s[["b"]])
c(unweighted = mean(y[idx]),
weighted = weighted.mean(y[idx], w[idx]))
}))
head(cbind(samples, round(estimates, 2)), 4)
#> a b unweighted weighted
#> 1 1 5 2.75 3.17
#> 2 2 5 2.50 3.00
#> 3 3 5 2.50 3.00
#> 4 4 5 2.25 2.83
colMeans(estimates)
#> unweighted weighted
#> 2.75 3.50Each row is one sample: the household left out of village A (a) and the household taken in village B (b), with its two estimates. The estimates vary from sample to sample, and the last line averages them. The weighted mean averages 3.5 over the 16 samples, the true value. Here the Hajek mean is exact on average because the weights add up to 8 in every sample. The unweighted mean averages 2.75, because it gives the households of village A, which have fewer children, three quarters of the say when they are half the population. A sample with unequal probabilities needs its weights.
4.5 The variance of a mean under simple random sampling
A simple random sample (SRS) of 4 households out of 8 gives every set of 4 the same probability. There are 70 of them.
For a simple random sample of \(n\) units from \(N\), with \(S^2\) the variance of \(y\) in the population, \[ V(\bar y) = \left(1 - \frac{n}{N}\right) \frac{S^2}{n}. \] \(1 - n/N\) is the finite population correction. It is close to 1 when the sample is a small part of the population.
srs <- combn(8, 4, \(idx) mean(y[idx]))
c(samples = length(srs), mean = mean(srs),
variance = mean((srs - true_mean)^2),
formula = (1 - 4 / 8) * var(y) / 4)
#> samples mean variance formula
#> 70.0000000 3.5000000 0.3928571 0.3928571The mean of the 70 sample means is the true mean, and their variance equals the formula. In a real survey \(S^2\) is unknown and is estimated from the sample. The standard error is the square root of the variance.
4.6 Stratification
A stratified sample draws separately in each stratum. Take two households in each village, a proportional allocation, so every household again has a probability of 1/2.
pairs <- combn(4, 2)
p <- ncol(pairs)
grid <- expand.grid(a = seq_len(p), b = seq_len(p))
stratified <- mapply(\(a, b) mean(y[c(pairs[, a], 4 + pairs[, b])]),
grid$a, grid$b)
c(samples = length(stratified),
variance = mean((stratified - true_mean)^2))
#> samples variance
#> 36.00000000 0.08333333The variance falls from 0.393 to 0.083. Under SRS, a sample could take all four households from village A and miss village B. Stratification rules such samples out. It removes the variation between strata from the variance, and gains the most when strata differ, as the two villages do.
4.7 Clustering
A cluster sample selects groups and takes every unit in them. Take two of the four compounds, with both households of each.
clustered <- combn(4, 2, \(cc) mean(y[toy$compound %in% cc]))
c(samples = length(clustered),
variance = mean((clustered - true_mean)^2))
#> samples variance
#> 6.0000000 0.8333333The variance rises to 0.833. Four households from two compounds tell less than four households drawn freely, because the households of a compound are alike. The design effect measures the loss.
The design effect of a design is the ratio of its variance to the variance of a simple random sample of the same size, and the effective sample size is the size of the simple random sample with the same precision, \[ \mathrm{deff} = \frac{V_{\text{design}}}{V_{\text{SRS}}}, \qquad n_{\mathrm{eff}} = \frac{n}{\mathrm{deff}}. \] DHS reports print the DEFT, \(\sqrt{\mathrm{deff}}\), the ratio of standard errors.
c(stratified = mean((stratified - true_mean)^2),
clustered = mean((clustered - true_mean)^2)) /
mean((srs - true_mean)^2)
#> stratified clustered
#> 0.2121212 2.1212121The stratified sample has a design effect of 0.21 and the clustered one 2.12. The clustered sample of 4 households is worth 1.9 households drawn at random.
A household survey combines the two. It stratifies, which gains a little, and clusters, which loses more, because visiting a few areas is what makes the survey affordable. Chapter 9 shows how the loss depends on the number of households taken per cluster.
4.8 Back to The Gambia
The Gambia DHS uses every idea of this chapter. Its frame is a list of EAs. It stratifies by LGA and residence. It selects EAs with probability proportional to their households and then 25 households in each, so that a household’s inclusion probability is the product of its probabilities at the two stages (Chapter 11). Its allocation is far from proportional, so households carry unequal weights and estimates must use them. Its national estimate of mCPR in 2019-20 has a DEFT of 1.576, a design effect of \(1.576^2 = 2.48\). The 8,083 married women it interviewed are worth 3,254 drawn at random.
4.9 Exercises
- In the disproportionate design, what is the inclusion probability of household
e? Check it by counting the samples of the enumeration that contain it. - Compute the stratified variance with the formula \(\sum_h W_h^2 (1 - n_h / N_h) S_h^2 / n_h\), with \(W_h\) the share of each village, and compare with the enumeration.
- Swap the children of households
bande, so that compounds 1 and 3 are no longer alike. What happens to the design effect of the cluster sample? - A DHS domain has 1,000 married women interviewed and a DEFT of 1.5. What is its effective sample size, and what RSE does it give for a proportion of 0.2?
- 1/4. Household
eis in the 4 samples withb = 5out of 16. - Each village has \(S_h^2 = 2/3\), \(W_h = 1/2\), \(n_h = 2\) and \(N_h = 4\), so each contributes \(1/4 \times 1/2 \times (2/3) / 2 = 1/24\), and the total is \(1/12 = 0.083\), the enumerated variance.
- Compounds 1 and 3 then each hold one household with few children and one with many. The SRS variance is unchanged, since the eight values are the same, and the design effect of the cluster sample falls from 2.12 to 1.27.
- \(1000 / 1.5^2 = 444\). The RSE is \(1.5 \sqrt{0.8 / (0.2 \times 1000)} = 0.095\), or 9.5%.