Why Resample Within Strata?
Suppose an analyst estimates a claim frequency separately for two predefined risk groups and then combines the estimates to represent a target population. The groups may have different outcome distributions, and the target population may contain a different proportion of each group than the observed sample. A bootstrap that resamples the pooled observations can change the group counts from replicate to replicate. That variation may not belong in the uncertainty calculation when the subgroup sizes are meant to remain fixed.
A stratified bootstrap addresses this by resampling observations with replacement separately within each stratum. Each bootstrap replicate contains the same number of observations from each stratum as the original sample. The statistic is then recalculated using the intended subgroup weights.
The strata must be defined before resampling, and the statistic must be specified before its uncertainty is calculated. For a weighted mean, the weights should represent the target being estimated. They might be known population proportions, or they might be the observed sample proportions if the goal is the mean of the observed sample’s empirical mixture. These choices generally produce different estimates.
The Weighted Mean and Its Bootstrap Uncertainty
Let \(\bar X_h\) denote the observed mean in stratum \(h\). Let \(W_h\) be the weight assigned to that stratum, with \(W_h\geq 0\) and \(\sum_{h=1}^H W_h=1\). The weighted estimate is
For example, if the target population is known to be 30% from one stratum and 70% from another, the corresponding weights are \(0.30\) and \(0.70\), even if the sample has a different composition. In a bootstrap replicate \(b\), calculate the stratum means \(\bar X_h^{*(b)}\) and then
The bootstrap standard error is the sample standard deviation of the \(B\) replicate statistics:
This measures the spread of the bootstrap replicates around their own average. It is an estimate of sampling uncertainty under the resampling scheme; it is not the standard deviation of the original observations, nor is it the standard deviation of the replicate statistics around the original estimate.
Why the Variance Formula Holds
The bootstrap variance for a weighted mean can also be calculated directly from the empirical variation within each stratum. Define the empirical variance in stratum \(h\), using denominator \(n_h\), as
Within stratum \(h\), a bootstrap draw takes each observed value with probability \(1/n_h\). Its conditional mean is \(\bar X_h\), and its conditional variance is \(\hat\sigma_h^2\). Since the replicate mean averages \(n_h\) independent draws with replacement, its conditional variance is \(\hat\sigma_h^2/n_h\). The resampling is independent across strata, so the weighted sum has variance equal to the sum of the weighted stratum variances:
The square on each weight matters: variance scales with the square of a constant multiplier. If \(s_h^2\) instead denotes the usual sample variance with denominator \(n_h-1\), then \(\hat\sigma_h^2=(n_h-1)s_h^2/n_h\), so the same result can be written as
This is a conditional bootstrap variance: it treats the observed stratum sizes and weights as fixed. It does not include uncertainty from estimating population stratum proportions. If the target weights themselves are estimated, their uncertainty requires a method that accounts for that estimation. Also, a stratum with \(n_h=1\) has no observed within-stratum variation, so ordinary resampling there produces no variation and cannot reveal the stratum’s underlying uncertainty.
Worked Example: Combining Two Strata With Fixed Population Weights
A hypothetical benefits analyst observes values of 10 and 14 in stratum A, and 20 and 28 in stratum B. The target population weights are \(W_A=0.25\) and \(W_B=0.75\). Calculate the weighted estimate, then calculate the bootstrap standard error from the following four specified stratified replicates. In each replicate, resample two observations within each stratum.
Method and original estimate. The observed stratum means are \(\bar X_A=(10+14)/2=12\) and \(\bar X_B=(20+28)/2=24\). Therefore,
Replicate 1. The resampled values are \((10,10)\) in A and \((20,20)\) in B. The stratum means are 10 and 20, so \(\hat\theta^{*(1)}=0.25(10)+0.75(20)=17.5\).
Replicate 2. The resampled values are \((10,14)\) in A and \((20,28)\) in B. The stratum means are 12 and 24, so \(\hat\theta^{*(2)}=0.25(12)+0.75(24)=21\).
Replicate 3. The resampled values are \((14,14)\) in A and \((28,28)\) in B. The stratum means are 14 and 28, so \(\hat\theta^{*(3)}=0.25(14)+0.75(28)=3.5+21=24.5\).
Replicate 4. The resampled values are \((10,14)\) in A and \((20,20)\) in B. The stratum means are 12 and 20, so \(\hat\theta^{*(4)}=0.25(12)+0.75(20)=3+15=18\).
The four replicate estimates are 17.5, 21, 24.5, and 18. Their average is \((17.5+21+24.5+18)/4=20.25\). The sum of squared deviations from 20.25 is
The bootstrap variance estimate is \(31.25/(4-1)=10.4167\), and the bootstrap standard error is \(\sqrt{10.4167}=3.2275\). Rounded to four decimal places, it is 3.2275. The calculation is checked by verifying that each replicate used two draws from each stratum and retained the specified 0.25 and 0.75 weights. The common mistake this avoids is allowing the replicate stratum counts to vary by pooling all four observations.
Worked Example: A Weighted Subgroup Rate
In a hypothetical study, stratum A has binary outcomes \(0,1,1\), and stratum B has outcomes \(0,0\). The target population is 80% A and 20% B. Calculate the weighted rate and the standard error from four specified bootstrap replicates. In every replicate, B’s resampled outcomes are \((0,0)\); A’s resampled outcomes, in order, are \((0,0,1)\), \((1,1,1)\), \((0,1,1)\), and \((0,0,0)\).
Method and original estimate. The observed rates are \(\bar X_A=2/3\) and \(\bar X_B=0/2=0\). Thus the target-weighted rate is
In replicate 1, A’s rate is \(1/3\), giving \(0.8(1/3)+0.2(0)=4/15\). In replicate 2, A’s rate is 1, giving \(0.8\). In replicate 3, A’s rate is \(2/3\), giving \(8/15\). In replicate 4, A’s rate is 0, giving 0. The replicate estimates are therefore \(4/15,12/15,8/15,0\).
Their average is \((4+12+8+0)/60=24/60=2/5\). The squared deviations from \(2/5=6/15\) sum to
The replicate sample variance is \((16/45)/3=16/135\), so the bootstrap standard error is \(\sqrt{16/135}=0.3443\), rounded to four decimal places. The standard error is based on the four stated replicates and is consequently a rough Monte Carlo estimate. Notice that the original estimate is 0.5333, not the unweighted average of the two subgroup rates. Using the subgroup weights is essential to the target.
Worked Example: Analytic Uncertainty for a Weighted Mean and a Subgroup Gap
A hypothetical portfolio sample has values \(2,4,6\) in stratum A and \(5,5,11\) in stratum B. The target weights are \(W_A=0.60\) and \(W_B=0.40\). Use the stratified bootstrap variance formula to find the weighted mean’s standard error and the standard error of the subgroup difference \(\bar X_B-\bar X_A\).
Method and weighted estimate. The means are \(\bar X_A=(2+4+6)/3=4\) and \(\bar X_B=(5+5+11)/3=7\). Thus \(\hat\theta=0.60(4)+0.40(7)=2.4+2.8=5.2\).
For A, squared deviations from 4 are \(4,0,4\), so \(\hat\sigma_A^2=8/3\). For B, squared deviations from 7 are \(4,4,16\), so \(\hat\sigma_B^2=24/3=8\). Hence the conditional bootstrap variance of the weighted mean is
The standard error is \(\sqrt{0.7467}=0.8641\), rounded to four decimal places. The observed subgroup gap is \(7-4=3\). For a difference, the stratum coefficients are \(-1\) for A and \(+1\) for B; their squares are both 1. Therefore,
The gap’s standard error is \(\sqrt{32/9}=1.8856\), rounded to four decimal places. These calculations are checked against the within-stratum sample sizes, both equal to 3. The common mistake is to use the overall weighted-mean formula for a subgroup contrast without changing its coefficients: the contrast uses \(-1\) and \(+1\), not 0.60 and 0.40.
Choosing the Correct Weights and Resampling Scheme
The choice of weights determines the estimand, meaning the population quantity the calculation is intended to represent. If the goal is an overall mean for a target population with known stratum proportions, use those proportions. If the goal is the mean of the observed sample, \(W_h=n_h/n\), where \(n=\sum_h n_h\), reproduces the sample’s composition. Holding weights fixed in the bootstrap keeps that same target in every replicate.
A pooled bootstrap instead resamples \(n\) observations from the combined sample. The number of observations from each stratum then varies between replicates. That can be appropriate for a different inferential target, but it does not preserve fixed subgroup counts and may mix within-stratum variability with variability in subgroup composition. For a stratified bootstrap, the resampling procedure must match the design and the statistic:
Use the predefined subgroups relevant to the estimand, not groups selected after inspecting bootstrap results.
State whether the weights are known population proportions or observed sample proportions.
Draw \(n_h\) observations with replacement from the \(n_h\) observed values in stratum \(h\).
Compute subgroup quantities first, then combine them using the stated weights or contrast.
Use the replicate standard deviation for a bootstrap standard error, and interpret it as conditional on the resampling design.
This procedure assumes observations are independent within each stratum and that resampling the observed values is a reasonable approximation to sampling from that stratum’s population. If observations are dependent, or if the data arose from a complex survey design with clustering or unequal selection probabilities, ordinary within-stratum resampling may not represent the design. A stratum with very few observations also gives a limited empirical distribution; with only one observation, its bootstrap mean is always that observation.
Common Exam Traps
- Pooling when subgroup sizes should remain fixed. A pooled resample can change subgroup counts. Resample the original number of observations separately within every stratum when fixed counts are part of the setup.
- Using sample proportions instead of target weights. A sample deliberately oversampling a small subgroup may not reflect the target population’s composition. Use the weights specified by the target.
- Changing weights between replicates without justification. If the target weights are fixed, keep them fixed in every replicate; otherwise the statistic itself changes its target composition.
- Forgetting that variances use squared weights. For a weighted sum, each stratum’s variance contribution is multiplied by \(W_h^2\), not \(W_h\).
- Overinterpreting a tiny bootstrap run. A small number of replicates can produce a noisy estimate of uncertainty. The arithmetic may be exact for the listed replicates, but the result may still be imprecise as a Monte Carlo approximation.
These methods are aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus. The central exam check is to distinguish uncertainty within strata from changes in stratum composition, then use a resampling scheme consistent with the quantity being estimated.
Check Your Understanding
For each problem, identify the relevant weights or within-stratum resampling calculation before checking the answer.
- A sample has two values, 3 and 5, in stratum A and two values, 7 and 9, in stratum B. The target weights are 0.25 for A and 0.75 for B. What is the weighted estimate? (Answer: 7)
- Stratum A has outcomes 0 and 2; stratum B has outcomes 3, 3, and 6. The target weights are 0.50 and 0.50. What is the weighted mean? (Answer: 2.5)
- For a stratified bootstrap, A has values 1 and 3 with weight 0.40, and B has values 2 and 6 with weight 0.60. Using the empirical variance with denominator \(n_h\), what is the conditional bootstrap standard error of the weighted mean? (Answer: 0.8944)
- A binary-outcome sample has A outcomes \(1,0,0,0\) and B outcomes \(1,1\). If the target weights are 0.25 for A and 0.75 for B, what is the weighted rate? (Answer: 0.8125)
- A stratum contains only one observed value. What does ordinary within-stratum resampling estimate for the variability of that stratum’s bootstrap mean, and what is the limitation? (Answer: Zero bootstrap variance; the single observation provides no information about the stratum’s underlying variability.)