All modules

Module 01 · Data & statistical thinking

Start with a better question.

Define what you want to learn, who the data describe, and how the observations were collected. Every calculation depends on these choices.

20–25 min · Learn, explore, practiceA good place to begin
Question → design → data → evidence

By the end of this lesson

Name the question and the unit

Suppose a parcel company asks, “How long do deliveries take?” Before collecting data, make the question precise: the mean handling time, in minutes, for all parcels processed at one depot during a specified week. A delivery, a customer, and a depot are different observational units. Mixing them changes the question.

A variable records a property of each unit. Parcel category is categorical; handling time is quantitative and continuous; the number of failed delivery attempts is quantitative and discrete. Numeric-looking labels, such as postal codes, are still categories. Averaging them has no useful interpretation.

Record units, measurement rules, missing-value codes, and the time window before analysis. A zero-minute handling time and an unrecorded handling time are not interchangeable. A clear data definition makes the eventual result reproducible.

See who gets into the sample

Compare a random sample of the entire depot with a sample restricted to the small-parcel queue.

Illustrative finite population: 400 parcels. Each dot is one parcel; horizontal position gives handling time. Vertical offsets separate overlapping dots and carry no statistical meaning.

Make a change

30

Change the seed to draw another reproducible sample.

Population mean · μ37.00
Sample mean · x̄35.73
x̄ − μ · minutes-1.27
Large parcels in sample22 of 30

Every parcel was eligible. The sample mean varies across seeds; one close or distant result does not by itself validate or invalidate the sampling design.

Read the chart summary

The population mean is 37 minutes. This sample contains 30 parcels, including 22 large parcels, and has mean 35.73 minutes. The sample mean minus the population mean is -1.27 minutes.

Try this

Population, sample, parameter, statistic

The population is the full set of units the question concerns. A sample is the subset actually observed. A parameter summarizes the population, such as its mean μ; a statistic summarizes a sample, such as x̄. The statistic can change when a new sample is drawn, even when the population stays fixed.

In this illustrative depot, 100 small parcels have a mean handling time of 14.5 minutes, and 300 large parcels have a mean of 44.5 minutes. The population mean is a weighted average: (100 × 14.5 + 300 × 44.5) / 400 = 37.0 minutes. Simply averaging the two group means gives 29.5 minutes and incorrectly gives equal weight to groups of unequal size.

The explorer reveals the whole population so that you can compare a sample estimate with the truth. In an actual study, the population parameter is usually unknown. That is why sampling design and uncertainty matter.

How the sample arrives matters

A simple random sample without replacement gives every subset of n distinct population units the same chance of selection. Its sample mean is unbiased for the population mean over repeated samples. An individual sample need not match the population exactly; its discrepancy is sampling error.

The convenience option below draws only from the small-parcel queue. Each selected unit is real and measured correctly, but the design excludes all large parcels. Increasing n within that queue makes the small-parcel estimate more stable; it does not turn it into an estimate representative of the whole depot.

Try a random sample of 100 parcels, then a convenience sample of 100. The convenience sample becomes a census of the small-parcel queue and has mean 14.5, still 22.5 minutes below the depot mean. This is a design problem, not a rounding problem. Nonresponse and an incomplete sampling frame can cause similar difficulties.

Match the conclusion to the design

Random sampling helps justify generalizing from the sample to its target population. Random assignment allocates experimental units to treatments and helps support causal comparisons. These are separate decisions. A randomized trial conducted on volunteers does not automatically represent everyone; a random customer survey does not automatically establish causation.

If experienced employees use a new scanning system and inexperienced employees use the old one, a difference in processing times may reflect experience as well as the system. Experience is a possible confounder. Randomly assigning comparable employees or shifts to systems, with a suitable design, can reduce this concern.

End an analysis by stating the population, outcome, estimate, and limits. “The sampled parcels averaged 36.8 minutes” is a descriptive statement. “The new scanner reduces handling time” is a causal statement requiring much stronger design support. Accurate arithmetic cannot supply evidence the study never collected.

Make the connection.

Try each question before revealing the solution.

A survey records delivery satisfaction from 80 of 2,000 customers. Identify the population, sample, variable, and observational unit.

Show the worked solution

The population is the 2,000 target customers, and the sample is the 80 respondents. The variable is each customer’s satisfaction response; the observational unit is a customer. If satisfaction uses categories such as dissatisfied, neutral, and satisfied, it is an ordered categorical variable. How the 80 were selected and who declined to respond affect generalization.

Why does surveying 1,000 customers who voluntarily submit a complaint not guarantee a better estimate of overall satisfaction than a smaller random sample?

Show the worked solution

Complaint submission selects customers through a process related to satisfaction. More responses can reduce variability within that selected group while retaining selection bias. Sample size alone cannot justify treating the complaint group as representative of all customers.

A manager randomly samples 60 employees, then lets each choose between two training programs. Does the design establish which program causes higher productivity?

Show the worked solution

No. Random sampling helps with representation of the employee population, but program choice may depend on motivation, experience, or schedule. Those factors can also affect productivity. Random assignment to programs would address a different question: whether the treatment comparison supports a causal interpretation.

Assumptions, methods & references
  • All parcel values are fictional teaching data. The population is fixed at 400 parcels with overall mean 37 minutes.
  • Random samples are drawn without replacement from all 400 parcels. Convenience samples are drawn without replacement from the first 100 small parcels.
  • The displayed error is one realized sampling error, not an estimate of the method’s average bias. The convenience design’s expected error is −22.5 minutes.
  • A seed makes the pseudorandom draw repeatable; it is not a model parameter or a confidence level.

Further reading

Keep building your intuition.Describing data