Inference

Stage 16 of 23 Strand 4 of 5 18 lessons

18 illustrated lessons, each teaching the why before the how.

Start with Point Estimates in the app →
Revise Inference with flashcards →

Jump to a lesson

Point Estimates

Unbiased means right on average, not right.

A point estimate is a single best guess at a parameter, computed from the sample

Read the full lesson →

sample meanthe obvious estimateestimate of the population mean

The sample mean is the natural estimate of the population mean.

unbiasedover many samples, not on any oneright on average

Unbiased does not mean right. It means right on average over many samples.

xy

Any one estimate still misses. A point estimate says nothing about by how much.

Now you

estimatora rule applied to a sample

What is an estimator that is right on average across many samples called?

estimatora rule applied to a sample

What is an estimator that is always exactly correct called?

Unbiased Sample Variance

Using the sample mean costs a degree of freedom.

Dividing by n minus one corrects the sample variance for using the sample mean

Read the full lesson →

divide by nthe data sits closer to its own meantoo small

The data sits closer to its own mean than to the population mean.

divide by n − 1one degree of freedom is used up by the meanunbiased

So dividing by n understates the spread on average. Dividing by n − 1 corrects it.

the n deviations add to 0fix those and the last one is forcedonly n − 1 are free

The deviations from the sample mean add to zero, so only n − 1 are free.

Now you

sum of squaresdivide it by what?

For an unbiased sample variance from 19 readings, what do you divide by?

sum of squaresdivide it by what?

For an unbiased sample variance from 25 readings, what do you divide by?

Estimates from Summarized Data

The mean and the variance from coded totals.

From coded totals, add a back to the coded mean; the variance is the same for x − a as for x

Read the full lesson →

n = 10each x has had 50 subtracted

Data often come as totals of coded values: 50 was subtracted from each x, and only the sums are given.

add the 50 back
x̄ = 50 + 2 = 52

The coded values have mean 20 ÷ 10 = 2, so the unbiased estimate of the population mean is 50 + 2 = 52.

Var(x − a) = Var(x)the squares measured from the mean

Subtracting the same number from every value does not change the spread, so the variance works on the coded sums.

divide by n − 1 = 9
= (130 − 40) ÷ 9 = 10

Here s² = (130 − 400 / 10) / 9 = 10. Dividing by n − 1, not n, makes the estimate unbiased.

Now you

n = 10

n = 10, Σ(x − 50) = 30 and Σ(x − 50)² = 135. What is the unbiased estimate of the population mean?

n = 10

n = 10, Σ(x − 40) = 40 and Σ(x − 40)² = 178. What is the unbiased estimate of the population variance?

Null and Alternative Hypotheses

The dull explanation a test tries to rule out.

The null hypothesis is the no-change explanation a test tries to rule out

Read the full lesson →

xy

The null hypothesis, H₀, claims no effect, no difference — nothing has changed.

xy

The alternative, H₁, claims an effect — it needs evidence before you believe it.

fail to rejectthe data were merely not surprising enoughnot the same as proving

A test can reject the null hypothesis, or fail to — it can never prove the null true.

Now you

xy

Which hypothesis is "the mean is unchanged"?

xy

Which hypothesis is "the new drug works better"?

One-Tailed and Two-Tailed

Two tails split the level between both ends.

A two-tailed test splits its significance level between both ends

Read the full lesson →

xy

Testing only for an increase puts all 5 percent in one tail.

xy

Testing for any change splits it: 2.5 percent in each of the two tails.

critical zone-tailed1.645two-tailed1.96

So the two-tailed critical value sits further out, and is harder to exceed.

Now you

xy

At 5 percent, what is the critical z for a one-tailed test?

xy

At 5 percent, what is the critical z for a two-tailed test?

The Z-Test

How many standard errors from the claim.

A z-test asks how many standard errors the sample mean sits from the claimed mean

Read the full lesson →

sigma becomes the standard error

z = (x̄ − μ) / (σ ÷ √n): standardize as before, but divide by the standard error instead of σ.

−3−2−101231.96z = 1.96p = 0.05p < 0.05: reject H₀

Then compare that z with the critical value for your significance level.

xy

A large sample makes the error small, so small differences become detectable.

Now you

xy

The claimed mean is 67, sigma is 10, n = 4, and the sample mean is 77. What is z?

xy

The claimed mean is 84, sigma is 20, n = 25, and the sample mean is 80. What is z?

Critical Regions

Results too unlikely to blame on chance.

The critical region is the set of results too unlikely to blame on chance alone

Read the full lesson →

xy

Mark off the most extreme 5 percent. That shaded tail is the critical region.

xy2.5

A z of 2.5 lands inside that same tail, which is surprising if the null holds.

in the regionat that significance level
reject

A result landing in the region rejects the null at that significance level.

Now you

xy

The test is one-tailed at 5 percent and the statistic is 1.2. What do you conclude?

xy

The test is one-tailed at 5 percent and the statistic is 0.5. What do you conclude?

P-Values

The chance of data this extreme, if H0 held.

A p-value is the chance of a result at least this extreme if the null were true

Read the full lesson →

xy

Shade everything at least as extreme as what you actually saw.

p < significance levelthe data would be unlikely if the null held
reject

A small p means the data would be unlikely if the null were true, so reject it.

if then data
| not this
if data then
p measures the first direction only

It is the probability of the data given the null, never the other way around.

Now you

xy

A test of the claim that a new mug keeps coffee hot longer gives p = 0.02. Which conclusion is best?

xy

p = 0.3 at the 5 percent level. What do you conclude?

Testing a Proportion with the Binomial

A binomial tail is the p-value of a claim.

A tail probability under the binomial claim is the p-value that tests it

Read the full lesson →

46810121416

The claim is that the die is fair. Then sixes in 60 rolls follow the binomial B(60, 1/6).

xy

The rolls give 17 sixes — shade everything at least that extreme under the claim.

X ~
if the die really is fair
small means surprising
the p-value of the claim

That tail probability is the p-value: how surprising 17 would be if the claim held.

the conclusion names the die
evidence the die favors sixes

A small tail rejects fairness. Stated about the die itself: there is evidence it favors sixes.

Now you

xy

The tail comes to p = 0.01. Which conclusion is best?

xy

The tail comes to p = 0.004. Which conclusion is best?

Type One and Type Two Errors

Crying wolf, or missing a real effect.

A test can raise a false alarm or miss a real effect, and reducing one raises the other

Read the full lesson →

UrejectH₀ true5

Rejecting a null that was actually true is a type one error.

xy1.645

The probability of a type one error is the significance level, which you chose deliberately.

xy1.645

A type two error is a result from the true distribution falling short of that same line, so the null survives.

xy2.5

Demand more proof and the line slides out, so the type two area grows with it.

Now you

UrejectH₀ true5

What kind of error is failing to reject a false H₀?

UrejectH₀ true5

What kind of error is rejecting a true H₀?

Confidence Intervals

A range of believable values, not one guess.

A confidence interval reports a range of believable values instead of a single guess

Read the full lesson →

point estimateone number carries no widthsays nothing about error

A single number says nothing about how far off it might be.

xy

So report the estimate ± 1.96 standard errors — the z that leaves 2.5 percent in each tail.

xy

The 95 percent describes the method: 95 in 100 such intervals contain the true mean.

Now you

xy

The sample mean is 56 and the standard error is 1. What is the 95 percent interval?

xy

The sample mean is 78 and the standard error is 5. What is the 95 percent interval?

Expected Frequencies

The counts a table would hold with no link at all.

An expected frequency is the row total times the column total divided by the grand total

Read the full lesson →

cityfarmcats2416dogs614

Sixty pet owners are sorted two ways. These four counts are what was observed.

cityfarmtotalcats241640dogs61420total303060

Total the rows and the columns. Those margins are what the test works from.

cityfarmtotalcats241640dogs61420total303060

Two in three owners keep cats. If home makes no difference, every column splits the same way.

row total × column total ÷ grand totalcats in the city, if home changes nothing40 × 30 ÷ 60 = 20

That gives the expected count: row total times column total, over the grand total.

cityfarmcats2020dogs1010

Do that for all four cells. The margins survive; only the inside has been evened out.

Now you

cityfarmtotalcats183250dogs222850total4060100

What count would the marked cell hold if home and pet were unlinked?

cityfarmcats2020dogs1010

What does an expected frequency describe?

The Chi-Squared Test for Independence

Do the rows and the columns move together?

A chi-squared test weighs observed counts against expected ones to judge whether two categories are linked

Read the full lesson →

cityfarmtotalcats241640dogs61420total303060

H₀ says the pet kept is independent of the home. H₁ says the two are linked.

cityfarmcats2020dogs1010

Under H₀ the expected counts follow from the margins, and the observed ones miss them.

expected
and that total is χ²
added over every cell

Each miss is squared, then divided by the expected count. Add up all four cells.

(2 − 1) × (2 − 1) = 1rows minus one, times columns minus onedegrees of freedom

Degrees of freedom are rows minus one times columns minus one, so this table has 1.

x3.84

Read the total against the chi-squared curve for 1 degree of freedom.

χ² = 4.8 > 3.84at the 5 percent level
reject

The total is past the critical value, so the gaps are too large to be chance alone.

reject
the verdict names the pets
evidence the pet kept depends on the home

State the conclusion in context: evidence the pet kept depends on the home.

Now you

x3.84

χ² comes to 5.6 against a critical value of 3.84. What do you conclude?

x3.84

χ² comes to 9.1 against a critical value of 3.84. What do you conclude?

The Chi-Squared Goodness of Fit Test

Do the counts match the model you claimed?

A goodness of fit test compares observed counts with the counts a claimed model predicts

Read the full lesson →

123456

Sixty rolls of a die are counted by face. H₀ claims the die is fair.

123456

A fair die expects ten of each. That flat row is what the claim predicts.

expected
the same χ² statistic as before
added over the six faces

The statistic is unchanged: square each face’s miss, then divide by the expected count.

6 − 1 = 5the last face is fixed once sixty is used updegrees of freedom

Here the degrees of freedom are the categories minus one, because the counts must still total sixty.

xy11.07

With 5 degrees of freedom the 5 percent tail begins at 11.07.

χ² = 2.8 < 11.07the verdict names the dieno evidence the die is unfair

Falling short leaves the claim standing: no evidence this die is loaded.

Now you

categories minus onethe last count is fixed by the totaldegrees of freedom

A goodness of fit test uses 5 categories. How many degrees of freedom?

123456

A die claimed fair is rolled 120 times. What count does H₀ expect per face?

The One-Sample T-Test

One claimed mean, and a spread you must estimate.

A one-sample t-test judges a claim about a mean when the spread has to be estimated from the sample

Read the full lesson →

:
one population, one claimed mean
:

A machine claims a mean fill of 500 ml. Twelve bottles are all the evidence.

xy

With the spread estimated rather than known, the curve keeps heavier tails.

one is spent estimating s
on n − 1 degrees of freedom

The statistic divides the gap from the claimed mean by the estimated standard error.

x̄ = 496, s = 6, n = 12the gap, in estimated standard errors

A mean of 496 with s = 6 over twelve bottles gives t = −2.31.

xy−2.20

Eleven degrees of freedom put the two-tailed 5 percent critical value at 2.20 in each tail.

2.31 > 2.20the verdict names the bottlesevidence the mean fill is not 500 ml

The size of t is past the critical value, so there is evidence the machine is not filling to its claim.

population spread givenz-testpopulation spread estimated by sand the smaller the sample, the more the two differt-test

Use z when the population spread is given, and t when the sample must estimate it.

Now you

xy

There is one sample of 8, one claimed mean, and the population spread is unknown. Which test applies?

xy2.2

|t| = 1.14 against a critical value of 2.2. What do you conclude?

The Two-Sample T-Test

Comparing two means with the spread unknown.

A two-sample t-test asks whether two sample means differ by more than sampling variation explains

Read the full lesson →

plainfed101520253035

Two groups of plants give two sample means. The gap could be real, or just chance.

: the two population means are equal
or one is larger, for a one-tailed test
: they differ

H₀ says both populations share one mean, and the gap is only sampling variation.

xy

A z-test needed the population spread. Here only the two samples supply it.

gap between the sample meansand the result is t÷ the standard error of that gap

So t divides the gap between the means by the standard error of that gap.

samples independenta pooled test also assumes equal spreadseach population roughly normal

It assumes independent samples drawn from populations that are roughly normal.

xy

Technology turns t into p. If p is below the significance level, reject the null hypothesis.

p = 0.01 < 0.05the verdict names the plantsevidence the fed plants grow taller

State the verdict about the plants, never about the number that produced it.

Now you

plainfed101520253035

Two independent samples are taken and the population spread is unknown. Which test compares the means?

xy

The t-test returns p = 0.03 at the 5 percent level. What do you conclude?

Testing a Variance with Chi-Squared

A claim about the spread, not about the mean.

Scaling a sample variance by (n − 1) / σ² gives a chi-squared statistic that tests a claim about spread

Read the full lesson →

:
the claim is about the spread, not the mean
:

A process claims a variance of 4. Here the mean is not what is in question.

when the population is normal
chi-squared on n − 1 degrees of freedom

Scale the sample variance by (n − 1) / σ² and it follows a chi-squared curve.

n = 15, , claimed
the statistic
14 × 6.4 ÷ 4 = 22.4

Fifteen readings with s² = 6.4 against a claimed 4 give a statistic of 22.4.

xy23.68

Fourteen degrees of freedom put the upper 5 percent tail beyond 23.68.

22.4 < 23.68the verdict names the processno evidence the spread exceeds the claim

The statistic falls short, so nothing here shows the process varies more than claimed.

:
and this curve is not symmetric, so they differ
a bar in each tail

A two-tailed claim needs both tails, and this curve is not symmetric about its peak.

Now you

(21 − 1) × 8 ÷ 4degrees of freedom times the ratio of the variances?

n = 21, s² = 8, and H₀ claims σ² = 4. What is the statistic?

xy23.68

The statistic is 19.8 against an upper critical value of 23.68. What follows?

Comparing Two Variances with the F-Test

One spread over the other, larger on top.

The ratio of two sample variances follows an F distribution, which tests whether two populations vary equally

Read the full lesson →

line Aline B5101520253035

Two production lines share much the same center but have very different spreads.

F = larger smaller
which is why one tail is enough
so F is at least 1

Divide the larger sample variance by the smaller, and the ratio is F.

from 10 readings
from 8 readings
on 9 and 7 degrees of freedom

Each sample brings its own degrees of freedom, one fewer than its readings.

xy3.68

Read F on the curve for 9 and 7 degrees of freedom: the upper 5% tail begins at 3.68.

2.4 < 3.68the verdict names the two linesno evidence the spreads differ

F falls short of the critical value, so the two lines may well vary by the same amount.

do two means differ?a t-testdo two spreads differ?and the pooled t-test assumes this one finds nothingan F-test

So a t-test compares two means, and an F-test compares two spreads.

Now you

xy3.68

F comes to 4.2 against a critical value of 3.68. What do you conclude?

xy3.68

F comes to 3.1 against a critical value of 3.68. What do you conclude?

Continue your journey in the app — save your progress