Menu

Sampling and Uncertainty

Lesson 3: Sampling and Uncertainty

Why do analysts use samples?

Collecting data from every member of a population can be:

  • Too expensive (surveying every customer)
  • Too slow (manual review of every transaction)
  • Impossible (future customers)

A sample gives information about the larger population, but the result depends on:

  • How the sample was selected
  • How large it is
  • How much random variation it contains

Population and sample

Term

Meaning

Example

PopulationThe full group you want to understandAll app users
SampleThe subset you actually observe2,000 users who answered a survey
ParameterA true population value (usually unknown)True average satisfaction
StatisticA value calculated from the sampleSample average satisfaction

Example: A survey of app users who voluntarily answer a pop-up may not represent all users. People who respond can differ from people who ignore it.

Sampling bias

Bias type

What happens

Example

Selection biasThe sample excludes part of the populationSurveying only existing customers ignores people who never bought
Self-selection (voluntary response) biasOnly motivated people respondReviews skew toward very happy or very angry customers
Survivorship biasOnly "survivors" are analysedStudying only successful products
Non-response biasNon-responders differ from respondersBusy customers skip long surveys
UndercoverageSome groups can't be reachedEmail-only surveys miss customers without email

Sampling methods:

Method

How it works

Strength

Simple randomEvery member has an equal chanceReduces selection bias
StratifiedRandom samples within subgroups (e.g., regions)Ensures every subgroup is represented
ClusterRandomly select whole groups (e.g., stores)Practical for spread-out populations
SystematicEvery k-th recordSimple; watch for hidden patterns
ConvenienceWhoever is easiest to reachCheap, but high bias risk

A sample can be large and still biased. Size reduces random error, not bias.

Uncertainty

  • Sample estimates vary from sample to sample. This is sampling variability.
  • Standard error (SE) measures how much an estimate is expected to vary. For a mean: SE = SD ÷ √n.
  • Larger samples → smaller SE → more precise estimates. Quadrupling the sample size roughly halves the SE.
  • Confidence intervals communicate a range of values compatible with the data under a statistical procedure and its assumptions. A common approximation for a 95% interval for a mean, with a reasonably large sample, is: estimate ± 1.96 × SE.
  • A 95% confidence interval does not mean "there is a 95% chance the true value is in this specific interval". It means the procedure captures the true value in about 95% of repeated samples.

Key takeaways

  • Ask: How was the data collected? Who was excluded? Does the sample represent the group you want to describe?
  • These questions often matter more than the choice of formula.
  • Report uncertainty alongside estimates.

Data Analytics Tutorial



Learn via Video Course

Data Analysis and Processing with Python using Pandas - Data Science Course Logo

Data Analysis and Processing with Python using Pandas - Data Science Course

5 hrs



Get in Touch For Details