Data Sampling Methods: Random, Stratified and Systematic Sampling
An educational researcher has a list of 240 eligible fictional students but can survey only 60. One colleague suggests selecting 60 randomly from the entire list. A second recommends dividing the roster into three study levels and selecting students randomly within each level. A third proposes drawing one number from one to four and then choosing every fourth roster position. All three procedures may use randomization—but will they give the same sample, represent subgroups equally, or yield the same estimate of student performance?
The answer depends on sampling design. A valid selection mechanism specifies who can be selected, with what probabilities and through which operational steps. A well-chosen design can make population estimation more defensible, while a flawed roster, poorly defined groups or misleading standard-error calculation can invalidate even beautifully formatted statistics. In this guide you will learn simple random, stratified random and systematic random sampling, calculate proportional allocations, inclusion probabilities and design weights, then compare actual selected estimates in a reproducible fictional research project.
The demonstration uses 240 unique invented StudentCodes, split into three study levels containing 120, 72 and 48 students. Each principal method selects exactly 60 distinct units. We also execute 500 sampling replicates for each method, compare empirical estimation errors, and document why the fixed-order systematic design has only four possible start-based samples. Excel, Google Sheets, Pandas and NumPy walkthroughs, twelve inline figures, a ten-task capstone and thirty original questions support independent practice. No survey of real students was performed.
Reproducible project facts: N=240; n=60; sampling fraction 25%. The known fictional population mean assessment score is 72.1542. The verified selected means are 71.4000 for SRS, 71.4667 for proportionate stratified sampling and 71.2833 for stipulated systematic start 3. These are results of particular simulated selections—not proof that any sampling design always outperforms another.
What is sampling in statistics?
Statistical sampling selects a subset of units from a clearly defined population for measurement or analysis. In population research the aim is often to estimate a characteristic, such as average assessment performance or the percentage with learning-resource access, without contacting every eligible person. The collection of units relevant to the question is the target population; the operational list used to select units is the sampling frame; and the selected subset is the sample. Those terms answer different questions and should not be used interchangeably.
In our teaching exercise the full fictional population file already contains every assessment result so the sample estimates can be compared against the known answer. A real-world survey typically lacks the unmeasured population outcomes—that is the reason for estimating them from a subset. If your research instead concerns every student in a particular institution, the population might be that institution’s eligible learners. It would not automatically be all high-school students worldwide. Generalization depends on who was eligible, covered, selected and observed.

Population versus sample: a clear comparison
| Concept | Population | Sample |
|---|---|---|
| Definition | All defined eligible units | Selected subset of those units |
| Our example | 240 fictional students | 60 selected students |
| Characteristic | Unknown population mean in real research | Observed sample mean estimates it |
| Source of variation | May change across research populations | Changes across random selections from one population |
| Potential problem | Ambiguous eligibility or coverage | Sampling variability, nonresponse and measurement error |
Census versus sample survey
A census attempts to collect data from every unit in the defined population. A sample survey collects data from selected units. Measuring 60 rather than 240 can save time, cost and response burden, but it introduces uncertainty due to selection. A census can avoid sampling variability for a perfectly measured complete finite population, yet it can still suffer nonresponse, processing mistakes, ambiguous definitions and faulty measurements. Calling an exercise a census does not make its observations automatically accurate.
Sampling frame: inspect the roster before selecting
A sampling frame is the actual list or operational mechanism from which eligible units can be selected. We use an ordered CSV roster of 240 unique fictional StudentCodes, each linked to one study level. Audit the list for duplicate IDs, excluded eligible students, ineligible entries, outdated records, missing groups and inconsistent labels. If 20 eligible learners were absent, those units could not be drawn from this frame—even with flawless random code. That creates a coverage problem not repaired by generating more random numbers.
A sampling unit is the entity chosen by the procedure: here, a student. An assessment score is a variable recorded for that student, not a separate sampling unit. If one learner has multiple test records, randomly selecting 60 rows could accidentally select fewer than 60 distinct students. The working population deliberately uses one row per unique StudentCode and records roster position, study level, fictional region, subject, assessment score, study hours, attendance, resource access and research eligibility.
Probability versus nonprobability sampling
In probability sampling, a specified random selection mechanism yields calculable inclusion probabilities for eligible units, supporting design-based reasoning about estimates. The simplest example is SRS without replacement. In nonprobability sampling, inclusion is not governed by such a fully specified probability design: convenience, volunteer, purposive and quota approaches may be useful for exploration but do not automatically justify standard design-based margins of error for a broader population. Probability selection also cannot guarantee good measurement, complete response or an error-free frame.
A central distinction is that random sampling selects units for observation, whereas random assignment allocates participating units to intervention conditions. The first can support population representation; the second can improve causal comparisons under appropriate experimental designs. They are not substitutes. For more on interpreting estimated differences and hypotheses, see Topic 80: Hypothesis Testing and Topic 77: Correlation vs. Causation.
The fictional population: three complete study-level strata
| Study level | Eligible population | Population proportion |
|---|---|---|
| Level A | 120 | 50% |
| Level B | 72 | 30% |
| Level C | 48 | 20% |
| Total | 240 | 100% |

Sampling fraction versus response rate
The planned sampling fraction is f=n/N=60/240=0.25: one quarter of the frame is selected. That does not mean a 25% response rate. For example, if only 48 of the 60 selected students returned questionnaires, the simple response fraction would be 48/60=80%. The actual operational response rate may require more careful eligibility categories, but the basic lesson holds: selection and response are separate stages. Even an 80% response rate does not prove that response bias is absent.
Simple random sampling: what makes a sample genuinely random?
Simple random sampling (SRS) without replacement gives each possible subset of size n from the finite frame of size N the same probability. Each particular student has first-order inclusion probability π=n/N, so π=60/240=0.25 in our project. Equal first-order inclusion probabilities are important but are not the full SRS definition: a correctly randomized systematic sample can give everyone the same π while permitting only a small number of possible 60-person subsets. The procedure, not the casual word “random,” defines the design.
To create our SRS, we first verified all 240 student codes were unique and eligible, kept the saved roster order and used Pandas DataFrame.sample(n=60,replace=False,random_state=81). The result contained exactly 60 distinct StudentCodes, with study-level counts A=34, B=13, C=13. The assessment mean was 71.4000 compared with the synthetic population’s known mean 72.1542, giving an error of approximately −0.7542 points. That deviation is ordinary sampling variation, not by itself proof of biased selection.

Select a simple random sample without replacement in ten steps
Start with a correctly defined target population, validate eligibility and duplicate codes, assign one ID to each unique student, then define a documented random selection algorithm. Choose n=60 without replacement, which means an ID cannot be selected twice within that sample. Check that exactly 60 rows remain, that they contain 60 unique codes, and that every selected ID exists in the eligible frame. Preserve the input file version, its order, the seed and the final selected IDs. Only after those checks should you calculate a score estimate and report the difference from the known teaching population.
Sampling with replacement would instead allow repeated selection of the same unit during a sequence of draws, changing inclusion probabilities and variance calculations. It is appropriate for some mathematical or resampling purposes, but not for the project’s required 60 distinct students. A person may appear in several separately repeated SRS simulations, however; that does not violate without-replacement selection within any individual replicate.
Why SRS is useful—and where it falls short
Its appeal is transparent design, relatively straightforward estimation and no need to define strata in advance. SRS also permits clearly stated variance calculations for many common estimates under its assumptions. However, a complete frame may be expensive, geographically dispersed participants can increase collection costs, and small subgroups may appear infrequently or by chance be missing from one selected sample. Nonresponse or measurement error can still bias results. Do not tell students that every SRS exactly mirrors population proportions: our actual SRS contains 34/13/13 rather than the population-proportional 30/18/12.
Stratified random sampling: selecting from each meaningful group
Stratified sampling divides the eligible population into mutually exclusive, collectively exhaustive groups, then uses probability selection within each. Here the strata are study levels A, B and C. The researcher knows the population sizes before drawing the sample; this enables a deliberate sample allocation rather than leaving subgroup counts completely to chance. Stratification is particularly valuable when each subgroup requires an adequate sample or when study-level variation can make the population estimate more precise. But there must be a defensible reason for the chosen stratification variable.
Proportionate allocation formula and verified counts
With proportionate stratification, allocate sample counts in proportion to population counts using nₕ=n(Nₕ/N), subject to an integer allocation procedure that preserves total n. The population Level A share is 120/240=.50, so select 60×.50=30; Level B share is .30, so select 18; Level C share is .20, so select 12. These values are already integers and sum exactly to 60. When allocations are fractional in another investigation, document a defensible rounding and reallocation method rather than independently rounding into an unintended sample size.
n_h = n × N_h/N
Level A: 60 × 120/240 = 30
Level B: 60 × 72/240 = 18
Level C: 60 × 48/240 = 12
Total: 30 + 18 + 12 = 60
| Stratum | Nₕ | Population share Wₕ | Selected nₕ | Design weight Nₕ/nₕ |
|---|---|---|---|---|
| Level A | 120 | 0.50 | 30 | 4.0 |
| Level B | 72 | 0.30 | 18 | 4.0 |
| Level C | 48 | 0.20 | 12 | 4.0 |
| Total | 240 | 1.00 | 60 | Equal-weight design |

How to execute the stratified selection correctly
First validate every student’s study-level label and confirm that all 240 eligible units belong to exactly one of the three levels. Draw 30 distinct Level A students, 18 distinct Level B students, and 12 distinct Level C students, independently using a specified probability selection procedure within each group. Concatenate the selected rows, check the total is 60 and verify all StudentCodes are unique. Save the random-state settings and roster version. We executed these three within-stratum Pandas selections using random_state=81 and preserved their exact IDs in the companion stratified CSV.
Our selected proportionate stratified mean is 71.4667 points under the correct population weighting, approximately −0.6875 below the known fictional mean. It happens to be slightly closer than the SRS result for this one draw; that does not establish a universal improvement. The actual precision gains from stratification depend on the outcome’s variability between and within strata, the allocation and the estimator used. Stratification can reduce variance substantially when its groups meaningfully explain outcome differences, but not always for every outcome.
Estimating a population mean from separate strata
The standard stratified estimator for a population mean is Σ(Wₕ × x̄ₕ), where Wₕ=Nₕ/N is the true population share and x̄ₕ is the sample mean within stratum h. The weights are 0.50, 0.30 and 0.20. Because our selection fractions are all equal, the ordinary arithmetic mean over all 60 selected students equals this weighted mean. But that equality does not extend automatically to disproportionate sampling; students need to understand the weights before interpreting an overall estimate.
Separate illustration: weighted mean 73 versus unweighted 70
To see why weighting matters, consider separate illustrative group means A=80, B=70, C=60 and population shares .50, .30, .20. The proper population-weighted mean is .50×80+.30×70+.20×60 = 73. Treating the three groups as equally important instead gives (80+70+60)/3=70. That is the wrong estimand for these unequal group sizes. These three assumed means were not taken from the generated 240-row dataset and should never be presented as its measured study-level means.

Disproportionate allocation: why sample smaller groups more heavily?
Researchers may choose disproportionate stratification to give small but important groups adequate observations. Imagine drawing 20 students from each study level, rather than 30/18/12. This still totals 60, but sampling fractions differ sharply: Level A 20/120≈16.67%, Level B 20/72≈27.78%, and Level C 20/48≈41.67%. Students in Level C are more likely to be included than students in Level A. Such a design is not inherently biased if the inclusion probabilities are known and appropriate design-based estimators are used.
For stratified SRS without replacement, the inclusion probability in stratum h is nₕ/Nₕ and the corresponding simple design weight is wₕ=Nₕ/nₕ. Under 20/20/20 allocation those weights are 6.0, 3.6 and 2.4, compared with 4.0 in each stratum under proportional allocation. The weighted sample mean Σ(wᵢyᵢ)/Σwᵢ reconstructs the correct population composition. A high response rate or a design weight alone does not automatically correct measurement error, missing eligible students or selective nonresponse.
| Stratum | Disproportionate selected nₕ | Inclusion chance | Design weight |
|---|---|---|---|
| Level A | 20 | 16.67% | 6.0 |
| Level B | 20 | 27.78% | 3.6 |
| Level C | 20 | 41.67% | 2.4 |
Neyman allocation and precision: an optional advanced insight
If within-stratum outcome standard deviations differ and sampling costs are equal, an allocation proportional to Nₕ × Sₕ can minimize the variance of a particular stratified mean estimator under standard assumptions. This is often called Neyman allocation. It requires useful variability information and an explicit outcome of interest. An allocation efficient for assessment scores need not be optimal for attendance or resource-access proportions. Always prioritize the research goals, subgroup reporting needs and real data-collection costs, not a single magic ratio.
Systematic sampling: one random start, then every kth unit
In systematic random sampling, the researcher begins with a defined ordered frame, selects a random starting position under an appropriate mechanism, and then follows a specified interval. Our N=240 and n=60 yield an integer interval k=N/n=4. A valid random-start version first chooses r uniformly from 1, 2, 3 or 4, then selects positions r, r+4, …, r+59×4. For the worked illustration we stipulate r=3, which produces positions 3,7,11,15,19,…,239. The stipulated start was not presented as an output of a random-number generator.
N = 240; n = 60
k = N/n = 240/60 = 4
Allowed uniform random starts: r = 1, 2, 3, 4
Illustrative r = 3 (stipulated, NOT randomly generated)
Positions = r + j*k, j = 0,...,59
First five: 3, 7, 11, 15, 19
Last: 3 + 59*4 = 239

Because N is exactly divisible by n, each roster unit belongs to exactly one of the four start-based samples. Uniformly choosing one start gives each student’s first-order inclusion probability 1/4=25%. This makes the design equal-inclusion-probability but not SRS: SRS permits every possible 60-person subset, whereas our fixed-order systematic procedure permits only four different subsets. Its pairwise selection structure differs substantially, which affects analysis of uncertainty.
Systematic ordering and the danger of periodicity
Imagine a roster whose category labels repeat A, B, C, D, A, B, C, D and so on. A k=4 design starting at position 3 would select only category C. A different start would repeatedly select another one of those categories. Randomizing the start chooses between four patterns but does not mix the categories within any realized sample. This is periodicity: a repeating pattern in list order that interacts with the sampling interval. It can make the sample a poor representation of an important population feature and increase variability.

The actual fictional roster used in our project was generated with study-level labels distributed through the ordered codes, rather than deliberately arranged as that repeating ABCD risk example. Its systematic start-3 sample happens to include exactly 30 Level A, 18 Level B and 12 Level C students. That matching composition is a feature of this one generated roster and selected start; it is not guaranteed by systematic sampling. The selection’s mean score, 71.2833, still differs from the known population mean even though its level proportions match.
What if the systematic interval is not an integer?
For a population of 250 and target sample of 60, N/n≈4.1667. Simply rounding k to four and taking every fourth record can select the wrong number of units or change inclusion probabilities. Researchers use carefully specified variants such as fractional-interval or circular systematic designs, with appropriate rules to control sample size and probabilities. These designs require more care than the simple exact-integer example. Our project deliberately keeps N/n=4, so the one-based positions and uniform-start inclusion probabilities can be checked without ambiguity.
Variance estimation for one fixed systematic sample
A subtle but important problem: in this fixed ordered N=240 roster with a single random start, the sample contains information from only one of four possible start-based subsets. Without additional assumptions or replicated design features, a design-unbiased sampling variance estimator generally cannot be constructed from that one realized systematic sample alone. Standard SRS variance formulas should therefore not be copied over merely because both designs include 60 units and each has π=.25. Repeated starts, randomized ordering, model-based approximations or design-specific replication approaches may support appropriate uncertainty analyses in other settings.
Compare all three designs at a glance
| Feature | Simple random | Stratified random | Systematic random start |
|---|---|---|---|
| Selection | Every size-60 subset equally likely | SRS separately within A/B/C | One uniform start, fixed interval |
| Our realized sample size | 60 | 30+18+12=60 | 60 |
| First-order π | 0.25 | 0.25 under proportional allocation | 0.25 |
| Main strength | Transparent design, straightforward analysis | Planned subgroup counts, possible precision | Convenient ordered roster operation |
| Ordering sensitivity | Not inherent to design | Within-stratum order relevant to reproducibility | Potentially serious periodicity |
| Analysis | SRS estimators and variance | Weighted stratified estimators and variance | Special variance care |
| Subgroup balance guaranteed? | No | Yes for the defined allocation | No |
| Main weakness | Subgroups can be uneven | Need accurate stratum frame | Few start-based samples; ordering risk |
Stratified sampling versus cluster sampling
Both designs involve groups but differ in purpose and selection. Stratified sampling divides the population into categories and selects individuals within each stratum; the project’s design includes some members of every study level. Cluster sampling draws entire groups, such as randomly selected schools or classes, sometimes followed by sampling within selected clusters. Cluster designs may reduce travel or recruitment costs, but students within one class may resemble each other, increasing the importance of dependence-aware inference. A sample of 60 individuals selected by drawing three whole classes is not automatically a 60-person SRS.
Which sampling method is best for a research question?
Choose simple random sampling when a complete validated list exists and no special subgroup allocation or field procedure is required. Consider stratified random sampling when important groups should have planned sample sizes or when meaningful grouping may improve precision. Consider systematic random sampling when an ordered roster supports an efficient fixed-interval procedure and its ordering has been checked for harmful periodicity. Real research can require multistage, cluster, unequal-probability or adaptive sampling; this three-way guide is a foundation, not an exhaustive decision tree.
The most appropriate method may also depend on privacy constraints, geography, resources and whether responses are collected at individual or group level. A large convenience sample of students near a library may be useful for pilot feedback yet cannot automatically be used to estimate a global student characteristic. Equally, a perfectly randomized sample of an outdated roster may exclude students without internet access. Design and operational quality matter together. Statistics Canada and Penn State’s sampling theory course provide detailed official guidance.
Sampling error is not the same as sampling bias
Sampling error describes how an estimate from a selected probability sample differs from the finite population quantity due to the random selection process. Its expected variation is described by a sampling distribution under the specified design. Sampling bias describes systematic distortion connected with selection or observation relative to the target estimand. A particular honest SRS estimate can be above or below the true mean without the procedure being biased. Conversely, repeated measurements from a flawed frame can cluster tightly around the wrong answer.
Common nonsampling problems include undercoverage, volunteers selecting themselves, nonresponse related to study habits, inconsistent assessment scales, duplicate records, faulty entry and incorrect eligibility. Some can occur in both a census and a sample survey. Suppose only students with mobile data access appear in a digital-learning platform roster: randomizing within that platform cannot give offline students a positive inclusion probability. A high response rate among those selected likewise does not show that excluded or nonresponding people resemble respondents on outcomes of interest.
How sample means vary across repeated selections
We used the same verified synthetic population and repeated each sampling method 500 times with a documented NumPy random generator seed 8181. Each SRS replicate independently drew 60 units without replacement; each stratified replicate independently selected 30/18/12 within levels; each systematic replicate randomly chose one of the four possible starts for the fixed ordered roster. Every replicate recorded its estimated mean and the error relative to the known population mean 72.1541667. This permits empirical summaries rather than hypothetical claims about which draw was better.

| 500-replicate metric | SRS | Proportionate strata | Fixed-order systematic |
|---|---|---|---|
| Mean of estimates | 72.1161 | 72.1594 | 72.1310 |
| Empirical bias | −0.0380 | +0.0052 | −0.0231 |
| SD of repeated estimates | 1.1864 | 1.0653 | 0.6755 |
| Mean squared error | 1.4062 | 1.1326 | 0.4559 |
The systematic method has a smaller empirical MSE in this particular fixed-roster simulation. This is not a universal performance ranking: the ordered roster happened to yield four start-based estimates that are fairly close together. In fact, because there are only four different systematic starts, 500 repetitions repeat those same four possible samples. The four exact means are 72.4000, 73.1167, 71.2833 and 71.8167. Their equally weighted average is exactly the known population mean; the 500-draw average differs slightly because each start need not appear exactly 125 times.


Standard error under simple random sampling
The standard error measures sampling variability of an estimator under a specified probability design. For a simple random sample without replacement from a finite frame, a common estimated mean standard error is SE(x̄)=√[(1−n/N)s²/n], where s² is the usual sample variance calculated with n−1 denominator. For the selected 60-person SRS in this project, the computed SE is approximately 1.2675 assessment points. This estimate describes random selection under the SRS design; it does not include measurement, frame or nonresponse bias.
Finite population correction: calculate rather than memorize
The finite population correction in the stated variance expression is √(1−n/N). For 60 selected from 240 without replacement, FPC=√0.75≈0.8660, which reduces the standard error relative to the corresponding with-replacement approximation. In a separate numerical illustration where s=12, the estimated SRS SE is √[(.75×144)/60]=√1.8≈1.3416 points. The assumed s=12 in that calculation is not the observed SD of the SRS draw in the actual generated dataset.
Under SRS without replacement:
SE_est = sqrt((1 − n/N) * s² / n)
For SE illustration only:
N = 240; n = 60; assumed sample s = 12
FPC = sqrt(1 − 60/240) = sqrt(0.75) = 0.8660
SE = sqrt(0.75 * 12² / 60) = sqrt(1.8) = 1.3416
Stratified uncertainty requires stratified calculations
For stratified independent SRS within levels, an estimated variance of the weighted mean is Σ[Wₕ²(1−nₕ/Nₕ)sₕ²/nₕ]. This combines within-stratum sample variances and the corresponding finite-population fractions. Applying it to the actual generated stratified sample yields estimated SE approximately 1.2445 points. Its value happens to be slightly below the selected SRS estimate 1.2675, but those are both random estimates from different realized samples. They are not a definitive comparative efficiency study and should not be generalized to every outcome.
Margin of error and confidence intervals need a valid design
An introductory margin of error is commonly a critical value multiplied by an estimated standard error, conditional on a specific estimator, design and confidence procedure. With the separate illustrative SE 1.3416 and a large-sample normal critical value 1.96, the half-width would be about 2.63 score points. This is not a universal margin of error for any study with n=60; small samples, stratified or clustered designs may need different critical values and variance estimators. The margin excludes unmeasured coverage and response bias and does not guarantee the true value lies in any one particular interval.
Sample-size planning: beyond a single calculator output
A sample size should reflect the research question, desired precision, population variability, sampling design, planned subgroup estimates, likely nonresponse, budget and costs. For preliminary estimation of a population proportion under a large-population SRS approximation, a familiar formula is n₀=z²p(1−p)/e². It uses an assumed proportion p, target half-width e and a chosen normal critical value z. Researchers may apply a finite-population correction and adjust for expected nonresponse and design effects. This formula is not appropriate for every mean, rare event, complex sample or longitudinal objective.
Design effects and effective sample size
A design effect compares the variance of an estimator under an actual design with its variance under a specified SRS reference: DEFF=Var(actual)/Var(SRS reference). Clustering can raise variance when observations within groups are similar; effective stratification can reduce it; and highly unequal weights can change precision. The result is design- and estimator-specific and is not always greater than one. Simply claiming “60 responses means the same precision under every method” ignores the design. Complex surveys should use survey-aware analysis rather than routine unweighted functions alone.
Random sampling in Microsoft Excel
Excel can help select students from a validated roster. For an SRS practice exercise, add a =RAND() helper beside each eligible record, generate random values, sort the entire table by that column and take the first 60 distinct StudentCodes. RAND is volatile; sorting or recalculation can change values. Save a copy of the generated random numbers as values and preserve the selected IDs if the draw must be reproduced. Using a random function on duplicate rows is not a valid way to select 60 unique students.
For proportionate stratification, filter the original roster by study level, apply the same documented random-sort technique within each stratum, select 30 Level A, 18 Level B and 12 Level C rows, and combine the selections. Verify total and uniqueness before computing the population-weighted mean. For systematic sampling, Excel versions supporting dynamic arrays can generate the stipulated positions with =SEQUENCE(60,1,3,4). In older versions, write 3 in the first position cell and add four sequentially through 60 rows. Remember that worksheet row numbers may include headers, so positions must refer to the defined roster itself.
Excel SRS helper (enter into cell next to each student):
=RAND()
Modern Excel systematic positions for stipulated start=3:
=SEQUENCE(60,1,3,4)
Validation after preserving the selected IDs:
=COUNTA(B2:B61)
=COUNTA(UNIQUE(B2:B61))
Expected: 60 selected IDs and 60 unique IDs
(UNIQUE requires a compatible Excel version.)
Google Sheets: repeat the procedure with preserved results
Google Sheets also provides RAND() and SEQUENCE(rows,columns,start,step), documented by Google. Create random numbers beside the whole population, sort all columns together, copy the resulting values, and preserve the selected StudentCodes. For stratification, choose exact 30/18/12 totals after random selection within filtered groups. The companion XLSX can be imported to Sheets, but it is a compatible workbook rather than a native online Sheets document; the actual online application was not used to execute this exercise. Locale-specific separators, numerical text and recalculation must be verified after import.
Python and Pandas: a reproducible SRS draw
Python makes the selection procedure and its assumptions explicit. The supplied population CSV contains 240 rows; validate unique codes and eligibility before calling Pandas sample(n=60,replace=False,random_state=81). The fixed integer sets a pseudorandom generator state for reproducible teaching; it is not the sample size. The saved input dataset and row order also matter if you expect the same actual IDs from a repeated execution. This core script was executed against the generated file to produce the supplied simple-random CSV.
import pandas as pd
population=pd.read_csv('synthetic-student-population.csv')
assert len(population)==240
assert population['StudentCode'].nunique()==240
srs=population.sample(n=60,replace=False,random_state=81)
assert len(srs)==srs['StudentCode'].nunique()==60
print(srs['AssessmentScore'].mean()) # 71.4
Python: stratified random selection and weighted mean
For proportional stratification, select separately from each filtered study level with required allocations and without replacement. The samples can then be combined. Use population proportions to calculate the overall estimated mean; in this proportional case, simple averaging over all 60 selected rows gives the same result. A loop avoids accidentally taking an overall SRS and merely labelling its group counts as stratified. The selection is reproducible only with the same data and documented generator behavior.
alloc={'Level A':30,'Level B':18,'Level C':12}
parts=[]
for level,count in alloc.items():
group=population.loc[population.StudyLevel==level]
parts.append(group.sample(n=count,replace=False,random_state=81))
stratified=pd.concat(parts,ignore_index=True)
weights={'Level A':.50,'Level B':.30,'Level C':.20}
weighted=sum(weights[level]*stratified.loc[
stratified.StudyLevel==level,'AssessmentScore'].mean()
for level in alloc)
print(round(weighted,6)) # 71.466667
Python: systematic positions are one-based, iloc is zero-based
The worked systematic example intentionally fixes the illustrative start to three so the mathematical positions are 3,7,11,…,239. NumPy’s arange(3,241,4) creates these one-based positions, but Pandas iloc uses zero-based indices, so subtract one to retrieve the intended rows. For an actual randomized start, draw an integer uniformly from 1 to 4 using a documented NumPy generator and record its observed value. Do not call the stipulated start three “randomly obtained” unless that randomization was performed.
import numpy as np
positions=np.arange(3,241,4) # 60 one-based positions
systematic=population.iloc[positions-1]
assert len(positions)==60 and positions[-1]==239
print(round(systematic.AssessmentScore.mean(),6)) # 71.283333
# Different example: actual random start, if needed
rng=np.random.default_rng(81234)
random_start=int(rng.integers(1,5))
print('Randomly generated start:',random_start)
Compare the three realized sample estimates
The complete synthetic population has a verified mean assessment score of 72.1542 on a 0–100 scale. The fixed selected samples estimate SRS 71.4000, stratified 71.4667 and systematic 71.2833. Each estimate is slightly below the known population mean. The sample composition differs: SRS selects 34/13/13 by chance; stratification fixes 30/18/12; and the start-three systematic selection happens to achieve 30/18/12 in this roster. The correct interpretation considers the selection design and random variability rather than declaring the closest one the universal winner.


Ten practical applications of sound sampling choices
| Application | Target population | Candidate frame | Practical design consideration |
|---|---|---|---|
| Student achievement | Eligible learners | Unique students on validated roster | Stratify by study level when subgroup estimates matter |
| Study habits | All participants in a defined programme | Students in programme registry | SRS if frame complete and selection costs modest |
| Healthcare survey | Patients meeting specified eligibility | Clinic appointment frame | Consider strata by relevant age or service group |
| Public opinion | Defined resident population | Population register or appropriate probability frame | Use sampling methods that cover offline households |
| Retail preferences | Customers in a defined period | Customer transaction roster | Use unbiased frame and document nonrespondents |
| Environmental monitoring | Defined sampling locations over time | Geographic grid/time schedule | Systematic spacing requires spatial-pattern checks |
| Agricultural field study | Defined farm plots | Mapped plot identifiers | Stratify by known soil types if analytically justified |
| Manufacturing quality | Items in a defined production run | Complete item sequence | Randomized systematic positions after checking cycles |
| Website usability | Users of a named product | Eligible test-user registry | Probability sampling if claiming user-population estimates |
| University research | Defined enrolled students | Current enrollment database | Proportionate or disproportionate strata by faculty |
These are illustrative design proposals, not claims that any real survey used a specific method or produced the corresponding results. For each project, state the research objective, sampling unit, eligibility conditions, realistic operational frame and potential exclusions. An online survey will not necessarily represent nonusers of the platform; collecting many responses does not remove that coverage problem. The best practice is to declare which population the design actually reaches and report limits to broader generalization.
Capstone: Selecting and evaluating samples from a fictional population
The ten-task capstone uses the same 240-record fictional population and the three saved 60-person selections. Every task requires its objective, formula or software method, verified output and interpretation, plus a note about uncertainty or bias. The full capstone PDF and Word template can be used for a complete research report. The known full-population mean is available in this teaching exercise only; real studies ordinarily must estimate it from unobserved population outcomes.
Capstone 1 — Define population and frame
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
A roster with 240 unique eligible fictional students, with one sampling unit per StudentCode. Record any additional assumptions before generalizing.
Capstone 2 — Calculate sampling fraction
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
n/N=60/240=0.25; this is 25% selected, not a response rate. Record any additional assumptions before generalizing.
Capstone 3 — Draw SRS
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
Fixed Pandas random_state=81 selects 60 unique IDs; sample mean 71.4000. Record any additional assumptions before generalizing.
Capstone 4 — Draw proportionate stratified
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
Select A30, B18, C12 within strata; weighted estimated mean 71.4667. Record any additional assumptions before generalizing.
Capstone 5 — Apply systematic design
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
k=4, stipulated start 3, positions 3…239, 60 students; mean 71.2833. Record any additional assumptions before generalizing.
Capstone 6 — Compare study-level composition
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
SRS A34/B13/C13; stratified A30/B18/C12; systematic A30/B18/C12 by chance. Record any additional assumptions before generalizing.
Capstone 7 — Compare estimates with true population mean
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
Known fictional population mean 72.1542; errors −0.7542, −0.6875 and −0.8708. Record any additional assumptions before generalizing.
Capstone 8 — Compare repeated sampling
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
500 replicates per design; systematic has only four distinct start-defined samples. Record any additional assumptions before generalizing.
Capstone 9 — Investigate bias and uncertainty
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
Review missing frame units, nonresponse, design weights, periodicity and design-specific variance. Record any additional assumptions before generalizing.
Capstone 10 — Write the research report
Explain your procedure, show the relevant calculation, and interpret the selection before revealing the reference.
Show verified reference
State population, frame, unit, random mechanism, sample size, seeds, actual results and limitations. Record any additional assumptions before generalizing.
Thirty original practice questions: hints and worked answers
Questions 1–10 review foundations, 11–20 cover calculations, and 21–30 test critical research judgement. Each question has a separately collapsed hint and answer. Try your own solution before opening either panel; the PDF question sheet and worked answer guide also permit offline study. A simple 30-point self-assessment can help identify topics to revise, but it is not an official academic grading scale.
Level 1 — Sampling foundations: Questions 1–10
Question 1 — Define sampling
What is statistical sampling?
Show hint
Think selecting units.
Show worked solution
Verified answer: Select a subset of clearly defined population units for measurement or analysis.
Common mistake: Sample is not the population.
Question 2 — Population
Who is the population in our project?
Show hint
All eligible units.
Show worked solution
Verified answer: All 240 specified eligible fictional students.
Common mistake: Do not say all students worldwide.
Question 3 — Sample
What sample size is planned?
Show hint
Selected subset.
Show worked solution
Verified answer: 60 distinct fictional student units.
Common mistake: One draw may not mirror shares exactly.
Question 4 — Census or sample
Distinguish a census from a sample survey.
Show hint
All versus some.
Show worked solution
Verified answer: A census attempts all 240; the sample survey selects 60.
Common mistake: A census can still have error.
Question 5 — Sampling frame
Define the frame used for randomization.
Show hint
Operational list.
Show worked solution
Verified answer: Validated ordered roster of 240 unique eligible StudentCodes.
Common mistake: Incomplete frame introduces undercoverage.
Question 6 — Sampling unit
Is the sampling unit the student or each test result?
Show hint
What is selected?
Show worked solution
Verified answer: The fictional student; scores are recorded variables.
Common mistake: Do not count repeated rows as separate students.
Question 7 — Probability sampling
What characterizes probability sampling?
Show hint
Known selection mechanism.
Show worked solution
Verified answer: A random design with calculable inclusion chances for eligible units.
Common mistake: Convenience selection is not random sampling.
Question 8 — Simple random
What makes SRS without replacement special?
Show hint
All subsets equally possible.
Show worked solution
Verified answer: Every possible distinct 60-unit subset has the same probability.
Common mistake: Equal individual π alone does not imply SRS.
Question 9 — Stratified
How is stratified random sampling performed?
Show hint
Randomize within groups.
Show worked solution
Verified answer: Divide into exhaustive nonoverlapping strata, then randomly sample each.
Common mistake: Convenience picks within strata are invalid.
Question 10 — Systematic
Define the worked systematic design.
Show hint
Random start then interval.
Show worked solution
Verified answer: Choose a start uniformly from 1–4 and select every fourth unit.
Common mistake: Do not omit the random-start mechanism.
Level 2 — Verified calculations: Questions 11–20
Question 11 — Sampling fraction
Calculate f for N=240,n=60.
Show hint
n/N.
Show worked solution
Verified answer: f=60/240=.25=25%.
Common mistake: Do not confuse f with response rate.
Question 12 — SRS inclusion probability
What is each student’s π in SRS?
Show hint
n/N again.
Show worked solution
Verified answer: π=60/240=.25 before sampling.
Common mistake: No guarantee of proportional subgroups.
Question 13 — Without replacement
Why must all 60 IDs be unique?
Show hint
No repeats per sample.
Show worked solution
Verified answer: An ID is removed from eligibility after selection within that draw.
Common mistake: Can occur again in another replicate.
Question 14 — Proportional allocation
Calculate A/B/C allocations for n=60.
Show hint
Multiply population shares by 60.
Show worked solution
Verified answer: A30, B18, C12, for 50%,30%,20%.
Common mistake: Do not round into an incorrect total.
Question 15 — Check strata
Verify allocated counts and group coverage.
Show hint
Add them.
Show worked solution
Verified answer: 30+18+12=60; all 240 belong to one of A/B/C.
Common mistake: No overlapping or missing strata.
Question 16 — Systematic interval
Compute k for 240 and 60.
Show hint
N/n.
Show worked solution
Verified answer: k=4.
Common mistake: Not a seed or a subgroup count.
Question 17 — Systematic selection
For r=3 and k=4, state first five and last position.
Show hint
r+4j.
Show worked solution
Verified answer: 3,7,11,15,19…239.
Common mistake: Convert to zero-based indexing in Python.
Question 18 — Design weights
Find proportional stratum weights.
Show hint
N_h/n_h.
Show worked solution
Verified answer: A=4, B=4, C=4.
Common mistake: Equal design weights can occur for unequal strata.
Question 19 — Weighted mean
For separate means 80,70,60 and shares .5,.3,.2 calculate mean.
Show hint
Multiply means by shares.
Show worked solution
Verified answer: 0.5×80+0.3×70+0.2×60=73; equal group average 70 is wrong.
Common mistake: This is not the generated dataset result.
Question 20 — Cluster versus strata
How does selecting whole schools differ from sampling within levels?
Show hint
Selected groups vs groups all sampled.
Show worked solution
Verified answer: Stratified samples individuals within every level; cluster may sample selected whole schools.
Common mistake: Group labels do not define an identical design.
Level 3 — Research judgement: Questions 21–30
Question 21 — Coverage error
What if 20 eligible students are absent from the frame?
Show hint
Could they be drawn?
Show worked solution
Verified answer: Missing units have zero chance from the faulty frame; coverage error remains.
Common mistake: Randomizing does not fix undercoverage.
Question 22 — Response rate
48 out of 60 selected reply. Calculate response fraction.
Show hint
Respondents over selected.
Show worked solution
Verified answer: 48/60=.80 or 80%, with possible response bias.
Common mistake: High response rate does not prove absence of bias.
Question 23 — Disproportionate strata
Compare 20/20/20 with proportionate 30/18/12.
Show hint
Selection chances change.
Show worked solution
Verified answer: 20 each oversamples small levels; weights A6, B3.6, C2.4.
Common mistake: Do not estimate overall mean unweighted.
Question 24 — Finite population correction
Compute FPC when n60,N240.
Show hint
sqrt(1-f).
Show worked solution
Verified answer: sqrt(.75)≈.866025.
Common mistake: Apply only with the corresponding variance expression.
Question 25 — Estimated SRS SE
Given separate illustrative s12, compute SE for N240,n60.
Show hint
sqrt((1-f)s²/n).
Show worked solution
Verified answer: sqrt(.75×144/60)=sqrt(1.8)≈1.34164.
Common mistake: The illustrative s12 is not our observed sample SD.
Question 26 — Periodicity
Explain danger of repeating ABCD roster with k4.
Show hint
All selected from same phase.
Show worked solution
Verified answer: Starting at 3 selects C,C,C,… rather than all categories.
Common mistake: Random start alone cannot remove periodicity.
Question 27 — Excel RAND
Why freeze random values or IDs after sampling?
Show hint
RAND recalculates.
Show worked solution
Verified answer: A refreshed helper column reshuffles ranks; preserve selected IDs/values.
Common mistake: A saved volatile formula is not fixed evidence.
Question 28 — Pandas SRS check
How verify a valid Python sample of 60?
Show hint
Use replace=False and unique IDs.
Show worked solution
Verified answer: df.sample(n=60,replace=False,random_state=81); assert 60 distinct codes.
Common mistake: Seed does not repair duplicate frame units.
Question 29 — Choose the design
Need guaranteed numbers from each study level: choose method.
Show hint
Plan allocations.
Show worked solution
Verified answer: Use probability stratification with 30/18/12 or justified unequal allocation/weights.
Common mistake: Do not declare one method universally best.
Question 30 — Integrated findings
Report three selected means and the known population mean.
Show hint
Use verified results.
Show worked solution
Verified answer: Population 72.1542; SRS 71.4000; stratified 71.4667; systematic 71.2833.
Common mistake: One draw does not rank methods forever.
Common sampling mistakes and practical corrections
| Mistake | Correction |
|---|---|
| Population and sample confused | Define the target eligible units first. |
| One record assumed to equal one person | Verify unique sampling units. |
| Large sample assumed representative | Coverage, selection and response still matter. |
| Convenience recruitment called random | Specify a genuine probability mechanism. |
| Incomplete roster treated as complete | Audit missing eligible units and duplicates. |
| Repeated student records selected separately | Deduplicate and define the unit. |
| Sampling confused with random assignment | Selection supports coverage; assignment supports intervention comparisons. |
| Equal inclusion chance called SRS | SRS requires every size-n subset equally likely. |
| Sampling with replacement inadvertently | Use replace=False for 60 unique students. |
| Best-looking random draw hand-selected | Save the original documented selection. |
| Strata overlap | Partition into mutually exclusive levels. |
| Some eligible students omitted from strata | Check exhaustive coverage. |
| Stratum sizes guessed rather than counted | Verify 120,72,48 before allocating. |
| Allocations rounded to wrong total | Enforce sum n_h=60. |
| Within-stratum convenience selection | Use random selection separately within each stratum. |
| Unequal design probabilities ignored | Apply appropriate weights. |
| Stratum means averaged equally | Use W_h population shares. |
| Systematic selection called identical to SRS | Recognize only four start-based samples in this example. |
| Random start omitted | Choose uniformly from permitted starts. |
| Interval confused with seed | k=N/n, not a random-state parameter. |
| Roster periodicity ignored | Inspect patterns interacting with k. |
| Systematic subgroup representation guaranteed | Composition depends on order and start. |
| SRS standard error copied to systematic | Variance depends on actual design. |
| Sampling fraction called response rate | Selection and responding are different stages. |
| 80% response treated as no bias | Compare responders and nonresponders. |
| Large n presumed to remove frame bias | Audit and improve population coverage. |
| Convenience sample assigned SRS margin of error | Explain when design-based uncertainty is unsupported. |
| One method called always best | Precision depends on outcome and design. |
| Random seed assumed to ensure correct sampling | Validate algorithm, IDs, input order and unit. |
| RAND() formulas saved without freezing | Preserve actual selected IDs or random values. |
| No audit of sampled eligibility | Check every selected ID against the frame. |
| Population inference extended beyond target | State explicitly who the research represents. |
Four-week learning roadmap
| Week | Skills to develop | Evidence of mastery |
|---|---|---|
| 1 — Foundations | Population, sample, frame, unit, census and probability sampling | Define eligible 240 students and complete Questions 1–10. |
| 2 — Three designs | SRS, stratification, weights and systematic starts | Reproduce n=60, A30/B18/C12, k=4 and Questions 11–20. |
| 3 — Software and uncertainty | Excel, Google Sheets, Python, FPC, simulation and bias | Validate CSVs and explain 500-replicate summaries and Questions 21–30. |
| 4 — Capstone report | Selection, estimates, limitations and research communication | Submit all ten capstone tasks and a reproducible methods report. |
Work through the roadmap at a pace suitable for your mathematical background. Keep a research log recording the input file version, actual selected identifiers, random-state settings and the reasoning behind the design. If you change the population or roster ordering, rerun the selection and report the new results rather than reusing the published numbers. A correct code execution is valuable, but the broader achievement is a sampling design that genuinely supports the research question.
Download the complete Topic 81 resource toolkit
The following ten resources are available in the connected WordPress staging media library. The downloadable complete ZIP supplied alongside this lesson also contains the original fictional population, all three exact sample CSVs, 500-replicate simulation CSV, runnable Python notebook, statistical images, answer-bank data and generator scripts needed for independent audit. These resources contain no actual student personal information. The two XLSX files were constructed as formula-based educational workbooks and checked for formula errors; the Google Sheets-compatible version has not been executed in native Google Sheets.
- Excel sampling practice workbook
- Google Sheets-compatible workbook
- 30 sampling questions (PDF)
- 30 worked answers (PDF)
- Sampling formulas cheat sheet (PDF)
- Sampling-method selection guide (PDF)
- Sampling frame and bias checklist (PDF)
- Ten-task sampling capstone (PDF)
- Four-week skills checklist (PDF)
- Editable research report template (Word)
Optional structured courses on sampling
Learners who prefer guided study may review Sampling People, Networks and Records on Coursera and Sampling Strategies for Effective Research Design on Udemy. Both course destinations were located from provider listings, but they are supplied as ordinary informational links, not verified Notes for SHS affiliate-tracked links. Check current price, prerequisites, syllabus and credential terms on each provider page; no commission or enrollment guarantee is claimed.
Frequently asked questions about sampling
What is sampling in statistics?
Selecting units from a defined population for observation and statistical analysis.
What is simple random sampling?
Every distinct subset of the target sample size has the same selection probability under SRS without replacement.
What is stratified random sampling?
Partitioning a population into exhaustive nonoverlapping strata and randomly selecting within each.
What is systematic random sampling?
Choosing a properly randomized starting position and selecting units at a specified interval in an ordered frame.
Is systematic sampling the same as simple random sampling?
No. They can have identical first-order inclusion probabilities but very different possible subsets and variance structures.
How do I calculate the sampling fraction?
Divide selected n by eligible population N: 60/240=0.25.
How do I calculate proportional strata?
Multiply n by each population group’s share: 30,18 and12 for 50%,30%,20%.
How do I calculate a systematic interval?
For this integer-interval design, k=N/n=240/60=4.
What is a design weight?
The inverse of a unit’s inclusion probability; for stratified SRS, N_h/n_h.
Why are nonresponse and bias important?
People not covered or not responding may differ systematically on study outcomes.
Can Excel and Sheets produce random samples?
They can use RAND for random sorting, but the random values or selected IDs need preserving for reproducibility.
Is random sampling always representative?
No. Random selection supports design-based reasoning but each sample varies, and frame, response and measurement errors can remain.
Conclusion: choose the sampling design that answers the question
Simple random, stratified and systematic sampling are all valuable probability methods when implemented under their proper definitions. SRS makes every eligible size-n subset equally likely; stratification fixes appropriate planned counts within defined groups and combines estimates using valid weights; systematic random-start sampling uses operationally convenient intervals but may be vulnerable to roster ordering and periodicity. Their estimated means can differ even when they select the same number of units, and statistical uncertainty must follow the actual design—not simply the word “random.”
In our 240-student fictional research population, all three methods selected exactly 60 students and produced independently verified mean estimates. Their observed errors, subgroup compositions and 500-replicate MSE results demonstrate why one experiment does not determine a universally best method. The next step for students is to reproduce the selections in Python or a spreadsheet, check the sampling frame and design weights, complete the capstone and explain what the estimates can legitimately represent. Sampling is the foundation of inferential statistics: a well-defined research population and defensible selection mechanism come before confidence intervals or p-values.
Authoritative references and software documentation
- Penn State — Sampling Theory and Methods
- Penn State — Simple Random Sampling
- Penn State — Stratified Sampling
- Penn State — Cluster and Systematic Sampling
- Statistics Canada — Probability Sampling
- AAPOR — Survey Research Best Practices
- Pandas — DataFrame.sample
- NumPy — Random Generator
- Google Sheets — SEQUENCE Function