The question: you cannot measure everyone. What can you honestly claim anyway?
Suppose you want to know the average weekly study time of Bates students. There are about 1,800 of them. You could, in principle, ask all 1,800 — and then you would not need statistics at all. You would have the answer.
You will not do that. You will ask 200, and you will get a number, and that number will not be the one you wanted. It will be close, probably. But probably and close are doing a lot of work in that sentence, and the whole of this course is the effort to say exactly how much.
That gap — between the 200 you measured and the 1,800 you care about — is where statistics lives. Not in the arithmetic. The arithmetic is easy and a computer does it. The difficulty is knowing what the arithmetic entitles you to say.
The population is every element you care about. The sample is the subset you actually measured.
Two things follow immediately, and students who keep them straight have an easier term than students who do not.
A number describing a population is a parameter. A number describing a sample is a statistic. They get different letters, and the letters are not decoration:
| Quantity | Parameter (population) | Statistic (sample) |
|---|---|---|
| Mean | $\mu$ | $\bar{x}$ |
| Standard deviation | $\sigma$ | $s$ |
| Variance | $\sigma^2$ | $s^2$ |
| Proportion | $p$ | $\hat{p}$ |
| Size | $N$ | $n$ |
Greek letters are truths you will never see. Roman letters are what you computed.
And the asymmetry that everything later depends on:
$\mu$ is a fixed number. It does not move. You do not know it.
$\bar{x}$ moves. Draw a different sample and you get a different one.
That second line looks obvious and is not. It takes until Chapter 12 to use properly, and most of the confusion students have in the second half of the course is a failure to believe it early enough. The sample mean is not an approximation with a mistake attached. It is a random quantity with a distribution of its own, and that distribution is the thing we will eventually learn to describe.
Before any formula, ask what you are holding.
Categorical data are labels: class year, major, country. Numbers used as labels are still labels — a zip code is categorical, and averaging zip codes produces nothing.
Quantitative data are counts or measurements, and they come in two kinds that matter later:
Hold onto that distinction. In Chapter 7 it decides whether you add probabilities or find an area, and in Chapter 9 it produces the fact that unsettles people most: for a continuous variable, the probability of any exact value is zero.
There is also a hierarchy of how much structure a measurement carries — nominal, ordinal, interval, ratio — which matters mainly for knowing what operations are legitimate. You cannot average a nominal variable. You can order an ordinal one but not subtract it meaningfully: the gap between “fair” and “good” on a survey is not a quantity.
Everything that follows assumes the sample is related to the population in a way you can describe. So how you drew it is not an administrative detail. It is the load-bearing assumption.
Four designs, and you should be able to tell them apart.
Simple random sampling is the benchmark. Every member of the population, and every group of the same size, has an equal chance of selection. Nearly all the theory in this course assumes this, which is worth remembering when you read someone else’s study.
Systematic sampling puts the population in some order, picks a random starting point, and takes every $k$th element. It is random because you did not choose who — you chose a rule, and the rule chose for you.
Stratified sampling splits the population into layers by a characteristic you care about — class year, region, sex — and then draws a random sample inside each layer. The word strata means layers, as in the stratosphere, and that is the whole mnemonic. (I took that one from Professor Leonard, and it has never failed a student yet.) You stratify to guarantee that every subgroup appears: with pure random sampling you could, by bad luck, draw almost no first-years.
Cluster sampling splits the population into groups regardless of characteristic — city blocks, zip codes, households — picks some groups at random, and measures everyone in the ones it picked. You do it to save money.
Stratified and cluster get confused every single year, so:
| Stratified | Cluster | |
|---|---|---|
| Groups formed by | a characteristic, chosen deliberately | convenience — geography, cost |
| Each group is | internally similar, different from the others | a miniature of the whole |
| You sample | within every group | whole groups, chosen at random |
| You do it to | make sure every subgroup appears | save money and travel |
The quick test: did the grouping use a characteristic you cared about? If yes, stratified. If the groups are just whoever happened to be nearby, cluster.
Sampling error is $\bar{x} - \mu$: the difference between your sample and the population, arising purely because you took a sample. Your 200 students are not the 1,800 and were never going to be. This error is random, unavoidable, and — crucially — it shrinks as $n$ grows. Chapter 12 will tell you exactly how fast.
Non-sampling error is everything else. A mistyped number. A leading question. The people who did not reply. This error is often systematic, frequently invisible, and it does not shrink as $n$ grows.
A bigger sample fixes the first and does nothing at all for the second.
That sentence is most of what goes wrong with statistics in public life. A survey of a million people who all opted in is still a survey of people who opt in, and its margin of error — computed honestly, reported honestly — is answering a question nobody asked.
Before any analysis, a do-file needs a header and a preamble. This is the template we
use all term, and the one your problem sets are expected to follow — a .do file that
does not run from a clean session scores zero on the computational questions, and most
of what makes it run lives in these few lines.
/*********************************
Name: YOUR NAME
Aim: Problem Set 1 - describing a data set
Date created: 02/09/2026
Date Modified: 14/09/2026
*********************************/
clear all
*********************************
* Preamble to start a do file
* closes previously opened log file
capture log close
* creates a log file
log using hpandit_PS1.log, replace
*changing working directory
cd "/Users/yourname/Desktop/ECO250/STATA"
* CHANGE THE LINE ABOVE to the folder that holds your DATA folder
* show present working directory
pwd
* turns off pause in stata output
set more off
Why each piece earns its place:
The header block says who wrote it, what it does, and when. You will come back to a file months later and be grateful.
clear all empties memory. Without it, a variable left over from the last run can
silently contaminate this one.
capture log close then log using ... records everything that happens. The
capture matters: without it, the line fails when no log is open and the file stops
dead. With it, Stata shrugs and carries on.
cd points Stata at your folder, so every later path can be written relative to it
— "DATA/cps_small.dta" rather than the full path. This is the one line every reader
must change. It is also the commonest reason a classmate’s do-file will not run on
your machine.
pwd prints where Stata actually ended up, which turns a silent wrong-folder error
into an obvious one.
set more off stops Stata pausing every screenful.
With that in place, the two commands to run before anything else:
use "DATA/cps_small.dta", clear
describe
summarize wage
describe tells you what is in the file: how many observations, how many variables,
what each one is called and what it holds. summarize gives you the count, mean,
standard deviation, minimum and maximum.
Run both before you do anything else, every time. Most of the errors I see in
submitted work are not statistical errors — they are someone computing a careful
answer about a variable that turned out to have 685 missing values, which
summarize would have shown in its first column.
The same two habits — look at the file, then summarise it — in pandas.
import pandas as pd
d = pd.read_stata("DATA/cps_small.dta")
d.info() # Stata's describe
d.describe() # Stata's summarize
d.head() # the first few rows, which Stata makes you ask for
d.info() lists the columns, their types, and — the column that matters most —
how many non-missing values each has. d.describe() gives count, mean, standard
deviation, minimum, quartiles and maximum in one table.
Run both before anything else, every time. Most errors in submitted work are not statistical: they are a careful answer computed about a variable that turned out to have hundreds of missing values, which the count column would have shown.
| Stata | Python |
|---|---|
use "file.dta", clear |
d = pd.read_stata("file.dta") |
describe |
d.info() |
summarize |
d.describe() |
summarize wage |
d["wage"].describe() |
list in 1/5 |
d.head() |
count if wage > 20 |
(d["wage"] > 20).sum() |
Python is not taught and not examined in this course — your problem sets are done in Stata. It is here because a lot of economics is written in Python, and seeing the same operation twice makes it obvious which part is the statistics and which part is the software.
Mixing Greek and Roman. Writing $\sigma$ when you computed $s$ is not a typo, because the two behave differently and the formulas that use them differ. This costs more marks across the term than any other single thing.
Treating a convenience sample as random. The people who answered are not a random sample of the people you asked, and the people you asked are not a random sample of anybody. Say so.
Thinking more data fixes bias. See above. It does not.
Averaging labels. If the variable is categorical, the mean is a number with no meaning. Stata will compute it cheerfully.
For each, say whether it is a population or a sample, and name the parameter or statistic involved. (a) The mean GPA of the 23 students in this section. (b) The mean GPA of 23 students surveyed in Commons, used to describe the college.
Classify as categorical, discrete quantitative, or continuous quantitative: student ID number; number of courses taken; time spent on a problem set; letter grade; credit hours earned.
A researcher wants to estimate mean household income in Maine. Describe how she would do it (a) by stratified sampling and (b) by cluster sampling, and say which you would choose and why.
A website runs a poll and gets 2.4 million responses. The reported margin of error is $\pm 0.06$ percentage points. In one sentence, what is wrong?
A sample of 200 Bates students gives a mean study time of 14.2 hours a week. Which of the following is $\mu$, which is $\bar{x}$, and which is neither? (a) 14.2 (b) the true mean over all 1,800 students (c) 200.
(a) Population — all 23 are the group of interest, so the mean is $\mu$. (b) Sample — the 23 stand in for the college, so the mean is $\bar{x}$. Notice the same 23 people can be either. It depends entirely on what you claim they represent.
Categorical: student ID (a label, despite being numeric), letter grade (ordinal). Discrete: number of courses, credit hours. Continuous: time spent.
(a) Split Maine into counties, or into income bands if known, and draw a random sample within each so that every region is represented. (b) Split the state into census blocks, pick a random set of blocks, and survey every household in those blocks. Cluster is far cheaper because the interviewer travels to a few places instead of everywhere; stratified is more precise. Chapter 12 shows precisely how much precision clustering costs.
The margin of error measures sampling error only. The respondents selected themselves, so the dominant error here is non-sampling, and 2.4 million does nothing about it. The stated $\pm 0.06$ is arithmetically correct and practically meaningless.
(a) $\bar{x}$. (b) $\mu$. (c) neither — that is $n$.
Eight more. These are mostly about naming things correctly, which sounds like the easy part of the course and is the part people lose marks on in week one.
For each, name the population, the sample, and say whether the number given is a parameter or a statistic. (a) The registrar reports that the mean GPA of all 1,800 Bates students is 3.41. (b) A pollster calls 600 Maine voters and finds 54% support a bond measure. (c) A firm records the salary of every one of its 40 employees; the mean is $58,200.
Classify each variable as nominal, ordinal, or interval/ratio. (a) Postcode. (b) Course grade (A, B, C, D, F). (c) Household income in dollars. (d) Jersey number. (e) Temperature in degrees Celsius. (f) Number of children. (g) Rank in a marathon. (h) Blood type.
Name the sampling design in each case. (a) Every 25th name on an alphabetical list of 5,000 members. (b) The college is split into four class years; 50 students are drawn at random from each. (c) Twelve of Maine’s 490 towns are chosen at random, and every household in those twelve is surveyed. (d) A researcher posts a link on social media and analyses whoever replies.
A survey of commuting times is mailed to 4,000 households; 380 reply, and the mean reported commute is 19 minutes. The researcher plans to fix the problem by mailing to 40,000 households next time. (a) What kind of error is the main threat here? (b) Will the bigger mailing fix it? Explain in one sentence. (c) Which direction do you expect the bias to run, and why?
Explain the difference between a sampling error and a nonsampling error, and give one example of each from a study you could actually run at Bates.
A researcher wants the mean weekly spending of students at a college with 2,000 students, 1,400 of whom live on campus and 600 off. Off-campus students spend far more on average, and there are fewer of them. (a) Which design would you use, and why? (b) If you drew 200 students by simple random sampling, roughly how many off-campus students would you expect, and what is the risk?
For each statement, say whether it is descriptive or inferential. (a) “The median wage in this sample of 300 workers is $21.40.” (b) “We are 95% confident the population mean lies between 19.8 and 23.0.” (c) “Forty-two per cent of respondents said yes.” (d) “The difference between the two groups is unlikely to be chance.”
You are asked to estimate the mean number of hours Bates students sleep. Write down, in four lines, a design: who the population is, how you would draw the sample, what could go wrong, and one thing you would do to reduce that risk.
(a) Population: all 1,800 Bates students. Sample: none — this is a census. 3.41 is a parameter. (b) Population: all Maine voters. Sample: the 600 called. 54% is a statistic. (c) Population: all 40 employees, and every one was measured, so $58,200 is a parameter even though 40 sounds like a sample size. What makes something a parameter is that it describes the whole group you care about, not that the group is large.
(a) Nominal — a postcode is a label, and averaging postcodes is meaningless. (b) Ordinal — ordered, but the gap from A to B is not a measured quantity. (c) Interval/ratio. (d) Nominal — numerals used as names. (e) Interval, not ratio — 0°C is not “no temperature”, so 20°C is not twice 10°C. (f) Ratio. (g) Ordinal — first and second are ordered, but the time gap between them is unknown. (h) Nominal.
(a) Systematic. (b) Stratified, with class year as the stratum. (c) Cluster — whole towns are sampled and then enumerated. (d) A self-selected or convenience sample, which is not a probability sample at all, and no amount of statistics repairs it.
(a) Nonsampling error — specifically nonresponse bias. Only 9.5% replied. (b) No. A larger mailing with the same response rate gives you more of the same biased respondents; it shrinks the standard error around the wrong number. (c) Probably upward: people with unusually long or unusually memorable commutes have more reason to bother replying, so the sample over-represents them.
Sampling error is the difference between a sample statistic and the parameter that arises purely because you looked at some units and not others. It is unavoidable, it is random, and it shrinks as $n$ grows — that is what the whole second half of this course measures. Nonsampling error is everything else: a badly worded question, a frame that omits people, nonresponse, data entry mistakes. It does not shrink with $n$ and it is often not random. Example of each: drawing 100 students and getting a mean sleep of 6.9 hours when the true mean is 7.1 (sampling); sampling from a list of students who use the library, so you miss everyone who does not (nonsampling).
(a) Stratified, with on-campus and off-campus as strata. The two groups differ sharply on the thing being measured, which is exactly the condition under which stratifying buys precision. (b) About $200 \times 0.30 = 60$. The risk is not the expected count but the variability around it — an unlucky draw could give 40 or 80, and since off-campus spending is so different, the estimate would swing with it. Stratifying fixes the count at 60 by construction.
(a) Descriptive. (b) Inferential. (c) Descriptive. (d) Inferential.
One acceptable answer. Population: all currently enrolled Bates students. Sample: a stratified random sample of 150, drawn proportionally from the four class years using the registrar’s list as the frame. What could go wrong: nonresponse, and specifically that students who are sleeping badly during exam period are the least likely to fill in a survey — the bias runs in a known direction. Reduction: run the survey in an ordinary teaching week rather than finals, and follow up twice with nonrespondents so the response rate is high enough that the people who never reply cannot dominate the answer.