Statistical Inference · Statistical Inference
What inference is
In Statistical Inference because the job is to take these rows and say how sure we are about a claim that reaches past them.
Stay with Rao's Corner Shop — the same eight customers Data Science already lined up. Each row still has a name, visits, spent, plan, and came_back. Anu spent Rs 320 and came back; Deepak spent Rs 0 and did not. Data Science asked what this week says. This course asks a further question: if these eight people are only this week's sample — the rows we actually have — how sure are we about a claim that reaches all customers, or next week? The columns stay the same. The reach of the sentence changes.
- Statistical Inference
- Medium level
- 5 concepts
1These rows, not all customers
Open the shop sheet the way Data Science did. Eight names: Anu, Bala, Chitra, Deepak, Esha, Farah, Gopal, Hari. Each line is one customer in this week — Anu's line is visits 4, spent 320, monthly, yes. That pile of eight lines is the sample: the rows we actually have, written down, countable. Nothing about next week's walk-ins is on it.
The population is the larger group the owner cares about: typical customers, or next week's walk-ins, or everyone who uses the counter. We do not have those extra rows. The word is not a second spreadsheet hiding in a drawer — it is the group the sentence wants to talk about, and we only hold a slice of it.
The columns stay name, visits, spent, plan, came_back. Nothing new is invented. Inference starts the moment a sentence about these eight people is asked to stand for people who are not on the sheet.
Figure. The sample is this week's eight rows. Name, visits, spent and came_back sit on the sheet. The population is the customers who are not on it.
| name | visits | spent | plan | came_back |
|---|---|---|---|---|
| Anu | 4 | 320 | monthly | yes |
| Bala | 1 | 80 | drop-in | no |
| Chitra | 6 | 510 | monthly | yes |
| Deepak | 0 | 0 | monthly | no |
| Esha | 3 | 240 | drop-in | yes |
| Farah | 2 | 150 | monthly | yes |
| Gopal | 5 | 400 | monthly | yes |
| Hari | 1 | 60 | drop-in | no |
Coding lab. Count the sample runs in the app, with checks on your output.
The owner wants a sentence about typical customers, not just this week. What is missing?
- The other customers — they are the population, and they are not on this sheet
- A sklearn estimator
- A new column called probability
These eight rows are the sample. Typical customers are the population.
2A claim that reaches past the sheet
Five of the eight came back. Point at the sheet: Anu, Chitra, Esha, Farah, Gopal said yes; Bala, Deepak, Hari said no. That sentence is a fact about these rows. You can re-count it tomorrow and get five again, because the week-1 export does not change.
The owner then says most customers come back. That second sentence is a population claim. It talks about people who are not on the sheet — next week's eight, or the typical customer. The first sentence can be true and the second still false, if this week happened to be a friendly one.
Inference is the move from the first sentence to the second, and the honesty about how far that move can go. We will later ask whether 5 of 8 is a weird week under a dull story. First, hear the two sentences as different reaches.
No diagram — the idea is carried by the prose, table, code block or coding lab.
| Sentence | Talks about |
|---|---|
| 5 of 8 came back | This week's sample |
| Most customers come back | The population |
Count who came back
On week 1, how many of the eight rows have came_back yes, and what fraction is that?
- yes rows: Anu, Chitra, Esha, Farah, Gopal5
- 5 / 80.625
Pro tip. 0.625 is a sample fact. 'Most customers come back' is the claim that still needs a warrant.
Coding lab. Count came_back runs in the app, with checks on your output.
How does an inferential claim differ from an empirical sample summary?
- An inferential claim is restricted strictly to describing the rows in the current CSV
- An inferential claim replaces probability calculations with deterministic formulas
- An inferential claim reaches beyond the observed sample to draw conclusions about the broader unobserved population
- An inferential claim requires collecting data from every single member of the population
Sample statistics describe the rows you hold; statistical inference uses that evidence to make probability-backed claims about the unseen population.
3A sample number, a population number
Add the spent column on week 1: 320 + 80 + 510 + 0 + 240 + 150 + 400 + 60 = 1760. Divide by eight people: 1760 / 8 = 220. Mean spent this week is Rs 220. That number is a statistic — a number computed from the sample we hold. If the eight names changed, 220 would change with them.
The typical-week mean spent — the number the owner wishes he knew for all customers — is a parameter. It does not appear on the sheet. No cell is labelled 'typical week'. We will later put a range around 220 and ask whether 220 is a wild week.
Keep the names straight before any formula: 220 is from these rows; the typical-week mean is not written down. A statistic is what we can compute. A parameter is what the claim is about.
Figure. Mean spent this week is Rs 220, from 1760 / 8. Those eight tickets are the statistic. The typical-week mean is not on the sheet.
Mean spent this week
What is mean spent on the eight week-1 rows?
- 320+80+510+0+240+150+400+601760
- 1760 / 8220
Pro tip. Rs 220 is a statistic. The typical-week mean is the parameter we do not get to read.
Coding lab. Mean spent runs in the app, with checks on your output.
What is the key distinction between a sample statistic (like sample mean) and a population parameter (like true mean)?
- The sample statistic is an unknown constant while the population parameter varies from week to week
- The sample statistic is always larger than the population parameter by a factor of square root of n
- The sample statistic is a known number computed from observed data, whereas the population parameter is a fixed unknown truth
- There is no distinction; both terms refer to the same calculated column average
x_bar is calculated from sample rows and varies across samples. mu is the true, fixed property of the entire population that we estimate.
4Description stops at this sheet
Data Science already described this table: who came back, how monthly members differed from drop-ins, what the week totalled. Those sentences stay true even if next week looks different, because they only claim this sheet. 'Five of eight came back' does not become a lie when Isha's week arrives.
Inference starts when the same numbers are asked to travel. Would 5 of 8 come back next week? Is Rs 220 close to what a typical week spends? Those questions can be wrong even when the sheet was read honestly. The sheet did not change. The claim's reach did.
No diagram — the idea is carried by the prose, table, code block or coding lab.
| Course | The sentence is about |
|---|---|
| Data Science | This week's eight rows |
| Statistical Inference | Next week / all customers |
Coding lab. Same sheet, new question runs in the app, with checks on your output.
Data Science says 5 of 8 came back this week. What does inference add?
- A warrant for talking about customers who are not on this sheet
- A fitted rent model
- A new came_back column
Description stops at the sheet. Inference asks whether the story travels.
5Not a predictor
The job on this sheet is still the owner's question: from these eight rows, how sure are we about a number that describes all customers, or next week? An interval around 220, a test of 'more often than not', a p-value for 5 of 8. This course does not fit a model.
Machine Learning would take a ready table and fit a predictor — size, distance, age to rent, or came_back as a label. That work lives in the Machine Learning course. If you find yourself importing sklearn, you have left the lesson.
No diagram — the idea is carried by the prose, table, code block or coding lab.
| Course | Job |
|---|---|
| Data Science | Describe this sheet |
| Statistical Inference | How sure about all / next week |
| Machine Learning | Fit a predictor |
Why is statistical inference not the same task as supervised machine learning regression?
- Inference requires fitting gradient boosted decision trees on unlabelled tables
- Regression cannot calculate mathematical averages or standard deviations
- Inference can only be conducted on datasets with fewer than five observations
- Inference quantifies uncertainty about a population truth rather than predicting individual row targets
ML fits a predictor y_hat = f(x) for specific instances. Inference asks how well a sample statistic estimates an underlying population parameter.
Notes
- In Statistical Inference because the job is to take these rows and say how sure we are about a claim that reaches past them.
- Open the shop sheet the way Data Science did. Eight names: Anu, Bala, Chitra, Deepak, Esha, Farah, Gopal, Hari. Each line is one customer in this week. That pile of eight lines is the sample — the rows we actually have. The population is the larger group the owner cares about: typical customers, or next week's walk-ins, or everyone who uses the counter. We do not have those extra rows.
- Five of the eight came back. That sentence points at this sheet: Anu, Chitra, Esha, Farah, Gopal said yes; Bala, Deepak, Hari said no. It is a fact about these rows.
Exam traps & shortcuts
- A sample number describes these rows. A population claim reaches past them.
- Fail-to-reject is not proof. A p-value is not the chance the null is true.
Recap
These eight rows are a sample. A number from them is a statistic. A claim about all customers is the inference. Data Science described the sheet; Machine Learning would fit a predictor. Neither is this course.
- These rows, not all customers
- Open the shop sheet the way Data Science did. Eight names: Anu, Bala, Chitra, Deepak, Esha, Farah, Gopal, Hari. Each line is one customer in this week — Anu's line is visits 4, spent 320, monthly, yes. That pile of eight lines is the sample: the rows we actually have, written down, countable. Nothing about next week's walk-ins is on it.
- A claim that reaches past the sheet
- Five of the eight came back. Point at the sheet: Anu, Chitra, Esha, Farah, Gopal said yes; Bala, Deepak, Hari said no. That sentence is a fact about these rows. You can re-count it tomorrow and get five again, because the week-1 export does not change.
- A sample number, a population number
- Add the spent column on week 1: 320 + 80 + 510 + 0 + 240 + 150 + 400 + 60 = 1760. Divide by eight people: 1760 / 8 = 220. Mean spent this week is Rs 220. That number is a statistic — a number computed from the sample we hold. If the eight names changed, 220 would change with them.
- Description stops at this sheet
- Data Science already described this table: who came back, how monthly members differed from drop-ins, what the week totalled. Those sentences stay true even if next week looks different, because they only claim this sheet. 'Five of eight came back' does not become a lie when Isha's week arrives.
Practise What inference is
Reading is free and needs no account. Practice, mocks and progress live in the app.
- A 3-question practice set that ends the chapter
- 5 quick checks with worked explanations
- Timed mocks scored with the real marking scheme
- Readiness tracked per topic, kept on your device