Sampling Designs Visualizer

Sampling

See how different sampling designs select people from the same population. Hundreds of individuals are shown on the grid; switch between simple random, stratified, cluster, systematic, and biased “convenience” sampling to see how each design changes the sample composition and sampling variability.

👨‍🏫 Professor Mode: Guided Learning Experience

New to sampling concepts? Enable Professor Mode for step-by-step guidance through understanding sampling distributions and the Central Limit Theorem!

OVERVIEW & WHAT THIS TOOL SOLVES

How you draw a sample from a customer population determines whether your survey or audit is trustworthy or systematically skewed. Sampling only easily reachable accounts (convenience) introduces severe bias, while ignoring known customer tiers (simple random) wastes precision when strata differ. The Sampling Designs Visualizer lets you draw single and repeated samples across a 2D population grid to compare Simple Random, Stratified, Cluster, Systematic, and Convenience sampling side-by-side.

🎯 Questions It Answers

  • How do Simple Random, Stratified, Cluster, Systematic, and Convenience sampling differ in bias and sample-to-sample variance?
  • Why does Stratified Sampling shrink the standard error of the mean when customer segments differ in spend or satisfaction?
  • When does Systematic every-kth sampling accidentally lock onto a periodic pattern in the population grid?

📂 What Data You Need

  • Population Scenario: Preset marketing populations (tiered B2B accounts, regional retail stores, freemium users) or custom grid parameters
  • Sampling Design & Size (n): Choose the sampling method, target sample size, and stratum allocation weights
  • Repeated Sampling Mode: Draw 1 sample to inspect the grid or 100+ repeated samples to build the sampling distribution

💡 What You'll Discover

  • Interactive Population Grid: Visual map highlighting exactly which individuals, strata, or clusters were selected
  • Stratum Representation Audit: True population share vs. sampled share across every customer group
  • Empirical Sampling Distribution: Histogram of repeated sample means comparing empirical bias and spread against the true population mean
🔍 Key Nuances & Common Traps to Watch For
  • Sampling Variance vs. Sampling Bias: Simple Random and Cluster sampling wobble around the true mean from draw to draw (variance), but average out to the truth over repeated draws. Convenience sampling misses the true mean consistently in the same direction (bias)—and increasing sample size n does not fix bias!
  • Stratified vs. Cluster Sampling Are Opposites: Stratified sampling samples some units from every group (best when groups differ from each other), whereas Cluster sampling samples all/many units from a few randomly chosen groups (cheaper in geographic field work, but higher variance when clusters differ).
  • Periodicity Trap in Systematic Sampling: Selecting every kth customer works like SRS unless the skip interval k aligns with a repeating cycle. Here the list runs row by row across a 25-wide grid and values drift from left to right, so at n = 80 (k = 12.5) every sample takes just two columns; try n = 125 to see the swings shrink.
📐 Under the Hood: Model Equations & Variable Definitions

1. Simple Random (SRS) vs. Stratified Sample Mean & Variance

\[ \bar{y}_{\text{SRS}} = \frac{1}{n}\sum_{i=1}^{n} y_i, \qquad \bar{y}_{\text{st}} = \sum_{h=1}^{H} W_h \bar{y}_h, \qquad \text{Var}(\bar{y}_{\text{st}}) = \sum_{h=1}^{H} W_h^2 \left(1 - \frac{n_h}{N_h}\right)\frac{S_h^2}{n_h} \]

💬 Read it in plain English: Stratified sampling computes the sample average ȳ_h inside each stratum h and weights them by true population shares W_h = N_h / N, eliminating between-stratum variance from the sampling error.

N, n
Population & Total Sample SizeYOUR DATA ⓘ
Total population units N on the grid and total sampled units n.
Wh = Nh/N
True Stratum Population ShareYOUR DATA ⓘ
Proportion of the entire population belonging to stratum h.
nh, ȳh, Sh2
Stratum Sample Size, Mean & VarianceESTIMATED ⓘ
Units drawn, sample average, and within-stratum variance in stratum h.
ȳSRS, ȳst
SRS & Stratified Mean EstimatorsOUTPUT ⓘ
Estimated population mean under Simple Random vs. Stratified sampling.

2. Systematic Skip Interval & Empirical Estimator Bias / RMSE

\[ k = \frac{N}{n}, \qquad \text{Bias}(\hat{\theta}) = \mathbb{E}[\hat{\theta}] - \mu, \qquad \text{RMSE}(\hat{\theta}) = \sqrt{\text{Bias}(\hat{\theta})^2 + \text{Var}(\hat{\theta})} \]

💬 Read it in plain English: Systematic sampling draws every k-th unit after a random start in [1, k], while repeated sampling decomposes total estimator error (RMSE) into systematic Bias plus random sampling Variance.

k
Systematic Skip IntervalYOUR DATA ⓘ
Step size N/n between consecutive selections in an ordered population list.
μ, θ̂
True Mean & Sample EstimatorOUTPUT ⓘ
True population mean μ across all N grid cells and sample estimate θ̂ on a given draw.
Bias(θ̂), Var(θ̂)
Estimator Bias & Sampling VarianceINFERENCE ⓘ
Systematic gap between average estimate and truth vs. draw-to-draw spread.

MARKETING SCENARIOS

Use these presets to explore realistic marketing sampling situations, such as balanced segments under simple random sampling, oversampling a small premium segment with stratified sampling, or drawing clusters that represent geographic regions.

POPULATION & SAMPLING SETTINGS

Configure the population

Each group is shown as a distinct color on the grid.

Choose how concentrated or fragmented the population is across groups.

Values (10–200) represent the metric of interest used for means.

Choose sampling design

Switch designs to see how sample composition and variability change.

Number of individuals selected in each sample.

Stratified sampling weights (by group)

When using stratified sampling, you can adjust how many sampled individuals come from each color group by setting relative weights below. Typically, analysts give extra weight to smaller subgroups (for example, a small segment or region) so that the sample includes enough of them for precise estimates, while using weights in analysis to adjust back to the population.

Reset run clears the drawn samples and replays the sequence from the first draw.

Total number of samples drawn: 0

VISUAL OUTPUT

Population & selected sample

The grid shows the full population. Colors represent groups; highlighted individuals are included in the current sample. When you choose Convenience sampling, the grey framed region shows the narrowed part of the population that has any chance to be sampled.

Sampling distribution of mean value

This chart accumulates the sample mean of the value of interest in repeated samples of the same size under the selected design. Compare how tightly (or loosely) the sample means cluster around the true population mean and whether some designs are visibly biased.

When showing subgroup means, you can focus on a single group to reduce visual clutter.

In practice you draw one real sample, but simulating many samples shows the sampling distribution: how the statistic (here, the mean value) would vary if you could repeat the same design over and over, drawing new samples from this same population.

SUMMARY & INTERPRETATION

True Group A proportion: –
Current sample Group A proportion: –
True mean value: –
Current sample mean value: –
Sampling design: –
Sample size: –

Design Comparison

Draw one sample to see how the current design selects individuals across groups; the results panel shows that sample's Group A share beside the true share. Then simulate many samples to see whether the sample means centre on the true mean (unbiased) and how widely they spread (precision).

Teaching Notes

Use this visualizer to demonstrate why random and stratified designs tend to produce fair, stable estimates. Cluster and systematic samples are unbiased on average here but can be far noisier when the clusters or the list order line up with the outcome; convenience sampling is biased, because part of the population can never be chosen.