Inference
Stage 16 of 23 Strand 4 of 5 17 lessons
17 illustrated lessons, each teaching the why before the how.
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
The sample mean is the natural estimate of the population mean.
Unbiased does not mean right. It means right on average over many samples.
Any one estimate still misses. A point estimate says nothing about by how much.
Now you
What is an estimator that is right on average across many samples called?
What is an estimator that is always exactly correct called?
Lesson complete. Continue your journey in the app — your progress saves there.
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
The data sits closer to its own mean than to the population mean.
So dividing by n understates the spread on average. Dividing by n − 1 corrects it.
The deviations from the sample mean add to zero, so only n − 1 are free.
Now you
For an unbiased sample variance from 19 readings, what do you divide by?
For an unbiased sample variance from 25 readings, what do you divide by?
Lesson complete. Continue your journey in the app — your progress saves there.
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
The null hypothesis, , claims no effect, no difference — nothing has changed.
The alternative, , claims an effect — it needs evidence before you believe it.
A test can reject the null hypothesis, or fail to — it can never prove the null true.
Now you
Which hypothesis is "the mean is unchanged"?
Which hypothesis is "the new drug works better"?
Lesson complete. Continue your journey in the app — your progress saves there.
One-Tailed and Two-Tailed #
Two tails split the level between both ends.
A two-tailed test splits its significance level between both ends
Testing only for an increase puts all 5 percent in one tail.
Testing for any change splits it: 2.5 percent in each of the two tails.
So the two-tailed critical value sits further out, and is harder to exceed.
Now you
At 5 percent, what is the critical z for a one-tailed test?
At 5 percent, what is the critical z for a two-tailed test?
Lesson complete. Continue your journey in the app — your progress saves there.
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
: standardize as before, but divide by the standard error instead of .
Then compare that z with the critical value for your significance level.
A large sample makes the error small, so small differences become detectable.
Now you
The claimed mean is 67, sigma is 10, n = 4, and the sample mean is 77. What is z?
The claimed mean is 84, sigma is 20, n = 25, and the sample mean is 80. What is z?
Lesson complete. Continue your journey in the app — your progress saves there.
Critical Regions #
Results too unlikely to blame on chance.
The critical region is the set of results too unlikely to blame on chance alone
Mark off the most extreme 5 percent. That shaded tail is the critical region.
A z of 2.5 lands inside that same tail, which is surprising if the null holds.
A result landing in the region rejects the null at that significance level.
Now you
The test is one-tailed at 5 percent and the statistic is 1.2. What do you conclude?
The test is one-tailed at 5 percent and the statistic is 0.5. What do you conclude?
Lesson complete. Continue your journey in the app — your progress saves there.
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
Shade everything at least as extreme as what you actually saw.
A small p means the data would be unlikely if the null were true, so reject it.
It is the probability of the data given the null, never the other way around.
Now you
A test of the claim that a new mug keeps coffee hot longer gives p = 0.02. Which conclusion is best?
p = 0.3 at the 5 percent level. What do you conclude?
Lesson complete. Continue your journey in the app — your progress saves there.
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
The claim is that the die is fair. Then sixes in 60 rolls follow the binomial .
The rolls give 17 sixes — shade everything at least that extreme under the claim.
That tail probability is the p-value: how surprising 17 would be if the claim held.
A small tail rejects fairness. Stated about the die itself: there is evidence it favors sixes.
Now you
The tail comes to p = 0.01. Which conclusion is best?
The tail comes to p = 0.004. Which conclusion is best?
Lesson complete. Continue your journey in the app — your progress saves there.
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
Rejecting a null that was actually true is a type one error.
The probability of a type one error is the significance level, which you chose deliberately.
A type two error is a result from the true distribution falling short of that same line, so the null survives.
Demand more proof and the line slides out, so the type two area grows with it.
Now you
What kind of error is failing to reject a false ?
What kind of error is rejecting a true ?
Lesson complete. Continue your journey in the app — your progress saves there.
Confidence Intervals #
A range of believable values, not one guess.
A confidence interval reports a range of believable values instead of a single guess
A single number says nothing about how far off it might be.
So report the estimate standard errors — the z that leaves 2.5 percent in each tail.
The 95 percent describes the method: 95 in 100 such intervals contain the true mean.
Now you
The sample mean is 56 and the standard error is 1. What is the 95 percent interval?
The sample mean is 78 and the standard error is 5. What is the 95 percent interval?
Lesson complete. Continue your journey in the app — your progress saves there.
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
Sixty pet owners are sorted two ways. These four counts are what was observed.
Total the rows and the columns. Those margins are what the test works from.
Two in three owners keep cats. If home makes no difference, every column splits the same way.
That gives the expected count: row total times column total, over the grand total.
Do that for all four cells. The margins survive; only the inside has been evened out.
Now you
What count would the marked cell hold if home and pet were unlinked?
What does an expected frequency describe?
Lesson complete. Continue your journey in the app — your progress saves there.
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
says the pet kept is independent of the home. says the two are linked.
Under the expected counts follow from the margins, and the observed ones miss them.
Each miss is squared, then divided by the expected count. Add up all four cells.
Degrees of freedom are rows minus one times columns minus one, so this table has 1.
Read the total against the chi-squared curve for 1 degree of freedom.
The total is past the critical value, so the gaps are too large to be chance alone.
State the conclusion in context: evidence the pet kept depends on the home.
Now you
χ² comes to 5.6 against a critical value of 3.84. What do you conclude?
χ² comes to 1.2 against a critical value of 3.84. What do you conclude?
Lesson complete. Continue your journey in the app — your progress saves there.
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
Sixty rolls of a die are counted by face. claims the die is fair.
A fair die expects ten of each. That flat row is what the claim predicts.
The statistic is unchanged: square each face’s miss, then divide by the expected count.
Here the degrees of freedom are the categories minus one, because the counts must still total sixty.
With 5 degrees of freedom the 5 percent tail begins at 11.07.
Falling short leaves the claim standing: no evidence this die is loaded.
Now you
A goodness of fit test uses 5 categories. How many degrees of freedom?
χ² = 7.2 with a critical value of 11.07. What is the conclusion?
Lesson complete. Continue your journey in the app — your progress saves there.
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
A machine claims a mean fill of 500 ml. Twelve bottles are all the evidence.
With the spread estimated rather than known, the curve keeps heavier tails.
The statistic divides the gap from the claimed mean by the estimated standard error.
A mean of 496 with s = 6 over twelve bottles gives t = −2.31.
Eleven degrees of freedom put the two-tailed 5 percent critical value at 2.20 in each tail.
The size of t is past the critical value, so there is evidence the machine is not filling to its claim.
Use z when the population spread is given, and t when the sample must estimate it.
Now you
There is one sample of 8, one claimed mean, and the population spread is unknown. Which test applies?
|t| = 1.14 against a critical value of 2.2. What do you conclude?
Lesson complete. Continue your journey in the app — your progress saves there.
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
Two groups of plants give two sample means. The gap could be real, or just chance.
says both populations share one mean, and the gap is only sampling variation.
A z-test needed the population spread. Here only the two samples supply it.
So t divides the gap between the means by the standard error of that gap.
It assumes independent samples drawn from populations that are roughly normal.
Technology turns t into p. If p is below the significance level, reject the null hypothesis.
State the verdict about the plants, never about the number that produced it.
Now you
Two independent samples are taken and the population spread is unknown. Which test compares the means?
The t-test returns p = 0.03 at the 5 percent level. What do you conclude?
Lesson complete. Continue your journey in the app — your progress saves there.
Testing a Variance with Chi-Squared #
A claim about the spread, not about the mean.
Scaling a sample variance by gives a chi-squared statistic that tests a claim about spread
A process claims a variance of 4. Here the mean is not what is in question.
Scale the sample variance by and it follows a chi-squared curve.
Fifteen readings with against a claimed 4 give a statistic of 22.4.
Fourteen degrees of freedom put the upper 5 percent tail beyond 23.68.
The statistic falls short, so nothing here shows the process varies more than claimed.
A two-tailed claim needs both tails, and this curve is not symmetric about its peak.
Now you
n = 21, , and claims . What is the statistic?
The statistic is 19.8 against an upper critical value of 23.68. What follows?
Lesson complete. Continue your journey in the app — your progress saves there.
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
Two production lines share much the same center but have very different spreads.
Divide the larger sample variance by the smaller, and the ratio is F.
Each sample brings its own degrees of freedom, one fewer than its readings.
Read F on the curve for 9 and 7 degrees of freedom: the tail begins at 3.68.
F falls short of the critical value, so the two lines may well vary by the same amount.
So a t-test compares two means, and an F-test compares two spreads.
Now you
F comes to 4.2 against a critical value of 3.68. What do you conclude?
F comes to 3.1 against a critical value of 3.68. What do you conclude?
Lesson complete. Continue your journey in the app — your progress saves there.