Lesson 110 — Trim 11 Consolidation: Statistical Inference
Trim 11 synthesis workshop: confidence intervals for the mean, z and t tests, ANOVA, chi-square, simple and multiple regression, and Bayesian inference — all the pillars of inferential statistics in one integrated map.
Used in: 3.º ano do EM / Stochastik LK alemão · Math B japonês (Estatística) · H2 Mathematics (Singapura) — Statistics
Trim 11 in three equations: confidence interval to estimate, statistic to test, and Bayes' rule to update beliefs. All statistical inference is a variation of these three forms.
Rigorous notation, full derivation, hypotheses
Formal synthesis of trim 11
The three pillars of statistical inference
"A confidence interval provides a range of plausible values for the population parameter. The correct interpretation: if we repeat the procedure many times, of the constructed intervals will contain the true parameter." — OpenIntro Statistics §5.2
Trim 11 decision flow — each statistical question has its method.
Worked examples
Exercise list
40 exercises · 10 with worked solution (25%)
- Ex. 110.1Application
, , (known). Construct the 95% CI for .
Show solution
Standard error: . Margin: . CI: .Show step-by-step (with the why)
- Identify: , , (known). Why: known means use , not .
- Critical value: .
- Standard error: .
- Margin: .
- CI: .
Trick: with , — quick mental math.
- Ex. 110.2Application
Using the data from the previous exercise (, , ), test vs at the 5% level. Compute and decide.
Show solution
. With , two-sided p-value . Reject at 5% level. - Ex. 110.3ApplicationAnswer key
Two independent samples: , , ; , , . Perform the Welch test at the 5% level.
Show solution
Welch: . Two-sided p-value . Reject . - Ex. 110.4Application
Three groups with plants each, means , , . Assuming (within-group variance), compute from ANOVA and decide at the 5% level.
Show solution
. . . Critical value . Since , reject .Show step-by-step (with the why)
- Overall mean: .
- .
- .
- . Strongly reject since .
Note: With and critical value , the p-value is tiny.
- Ex. 110.5ApplicationAnswer key
Fitted model: . What is the point prediction for ?
Show solution
. - Ex. 110.6Application
, , predictors. Compute .
Show solution
. - Ex. 110.7Application
A contingency table produced . How many degrees of freedom? Is there association at the 5% level?
Show solution
Table : . Critical value . Since , reject independence hypothesis. - Ex. 110.8Application
Prior . Observe successes in trials. What is the posterior distribution of ?
Show solution
Prior , successes in . Posterior: . - Ex. 110.9ApplicationAnswer key
With the posterior from the previous exercise, compute the posterior mean and the MAP (mode of the posterior distribution).
Show solution
Posterior : mean . MAP (mode) . - Ex. 110.10Application
Look up in the standard normal distribution table: what is ?
Show solution
. This is the critical value for two-sided 95% CI. Don't confuse with (90% CI). - Ex. 110.11Application
Using the same data , , , now construct the 90% CI for . Is the interval wider or narrower than the 95% CI?
Show solution
For 90% CI, . Standard error: . Margin: . CI: . The 90% CI is narrower than the 95% CI (which had margin 1.96). - Ex. 110.12Application
You want a 95% CI with maximum margin of error units, knowing . What is the minimum sample size?
Show solution
Formula: . Round up: .Show step-by-step (with the why)
- Identify: , , 95% confidence implies .
- Apply: .
- Round up (conservative): .
General rule: to cut the margin in half, quadruple .
- Ex. 110.13Application
A sample of observations has and . Test vs at the 5% level.
Show solution
. With , two-sided critical value . Since , reject . - Ex. 110.14Application
In a sample of voters, 60 approve a certain measure. At the 5% level, is there evidence that the true proportion ? Use the z test for proportion.
Show solution
. . Two-sided p-value . Reject . - Ex. 110.15Application
observations with , , , . Compute and interpret.
Show solution
. . Model: . Each unit increase in increases by 2.5 on average. - Ex. 110.16ApplicationAnswer key
A contingency table produced . How many degrees of freedom? Is there association at the 5% level?
Show solution
Table : observed frequencies , total 100. Expected frequencies under independence: row 1 has 50 cases, column 1 has 50 cases; each expected cell . . But with the problem frequencies: . . Critical value . Since , do not reject at the exact threshold. - Ex. 110.17Application
ANOVA with groups, total. , . Compute and decide at the 5% level.
Show solution
. . . Critical value . Since , reject . - Ex. 110.18Application
, , . Compute the Pearson correlation coefficient .
Show solution
. - Ex. 110.19Application
Two independent groups: , , ; , , . Construct the 95% CI for using Welch's statistic.
Show solution
Observed difference: . Standard error of difference: . Welch degrees of freedom: , . Margin: . CI: . - Ex. 110.20Application
Define Type I and Type II error in a hypothesis test. What is the relationship between them and the parameters and ?
Show solution
Type I error occurs when is true but we reject it (false positive); probability . Type II error occurs when is false but we fail to reject it (false negative); probability . Power of test . - Ex. 110.21Understanding
What is the correct interpretation of a 95% CI in the frequentist perspective?
Show solution
Correct frequentist interpretation: the procedure produces intervals that cover the true in 95% of repetitions. The interval constructed from one specific sample either contains or does not contain — there is no probability associated with a fixed interval. - Ex. 110.22Understanding
What does the p-value of a hypothesis test measure? Choose the correct interpretation.
Show solution
The p-value is NOT the probability that is true. It is . Common errors: confusing p-value with the probability of or — both are serious misinterpretations. - Ex. 110.23UnderstandingAnswer key
Explain what measures in linear regression and why high correlation does not imply causation.
Show solution
measures fit on the training set — not causation or generalization. Correlation causation: classic example, ice cream and drowning are correlated (both rise in summer), but one doesn't cause the other. High with small samples can indicate overfitting. - Ex. 110.24Understanding
What is the fundamental difference between the Bayesian and frequentist interpretation of the parameter ?
Show solution
Fundamental difference: frequentists treat as an unknown constant (without distribution); Bayesians assign a probability distribution to . The Bayesian credible interval allows one to say "with probability 95%, "; the frequentist CI does not. - Ex. 110.25Understanding
Why use ANOVA instead of multiple tests to compare groups?
Show solution
With groups, performing separate tests at level inflates familywise Type I error. ANOVA tests in one test at level . To identify which pairs differ, use post-hoc (Tukey, Bonferroni) after rejecting . - Ex. 110.26Understanding
When do you use the chi-square independence test and when do you use ANOVA? Identify the application conditions for each.
Show solution
Chi-square independence: both variables are categorical (nominal or ordinal). ANOVA: one numeric response variable and one categorical factor with levels. Confusing the two is a serious test-selection error. - Ex. 110.27Modeling
An election survey interviewed voters; 250 support candidate A. Construct a 95% CI for the true proportion of supporters.
Show solution
. Standard error: . Margin: . CI: .Show step-by-step (with the why)
- Compute .
- Compute the standard error: .
- Margin: .
- CI: .
Note that the CI for a proportion uses the standard error based on , not on population .
- Ex. 110.28Modeling
Regression model for energy consumption (kWh/month) as a function of average monthly temperature (°C): , fitted for temperatures between 20 and 60°C. Predict consumption for °C and for °C. Which prediction involves extrapolation?
Show solution
For : (interpolation — safe). For : (extrapolation — outside the sample interval 20 to 60 degrees, use with caution). - Ex. 110.29ModelingAnswer key
A 4-sided die was rolled 100 times. Observed frequencies: face 1 = 20, face 2 = 30, face 3 = 28, face 4 = 22. At the 5% level, is the die fair? Use the chi-square goodness-of-fit test.
Show solution
Expected frequencies: each category should have observations. . Degrees of freedom: . Critical value: . Since , do not reject — no evidence the die is unfair. - Ex. 110.30ModelingAnswer key
A clinical trial measured healing time (in days) of 25 patients before and after a new ointment formula. Means: before days, after days, standard deviation of differences days. At the 5% level, did the new formula reduce healing time (one-tailed test)?
Show solution
Paired differences: days, days (from problem), . . (one-tailed). Since , reject — the new formulation is faster on average.Show step-by-step (with the why)
- Paired test: each patient has two times (before and after). Compute differences .
- days; standard deviation of differences days.
- .
- Reject since .
Paired test is more powerful than independent two-sample test when there is correlation within pairs (same patient at both times).
- Ex. 110.31Modeling
Fitted regression model: . An observed point is . Compute the residual and interpret geometrically.
Show solution
Prediction for : . Residual: . The observed point falls exactly on the fitted line — zero residual. - Ex. 110.32Modeling
In a sample of students, 192 passed the test. The historical pass rate is 60%. At the 5% level, is there evidence of change in the pass rate? Use the z test for proportion.
Show solution
. . Two-sided p-value . Do not reject — no evidence of change in approval rate at 5% level. - Ex. 110.33ModelingAnswer key
An agricultural cooperative tested 3 fertilizers on corn plots ( plots per fertilizer). , . At the 5% level, is there a difference in productivity among the fertilizers?
Show solution
Three fertilizers, plants per group (). ; . . Critical value . Since , reject — at least one fertilizer differs. - Ex. 110.34Modeling
In a simple regression analysis: , , . Compute and . What proportion of the variation in is explained by the model?
Show solution
. In simple regression, . Interpretation: 81% of the variation in is explained by the linear relationship with . - Ex. 110.35Modeling
An epidemiologist believes the prevalence of a rare disease in a region is 30%, modeled by . In a screening of people, he finds positive. Determine the posterior distribution and the new point estimate (posterior mean).
Show solution
Prior (prior mean ). Data: , . Posterior: . Posterior mean: . The posterior mean lies between the prior (30%) and the MLE (10/50 = 20%) — typical behavior of Bayesian updating. - Ex. 110.36Challenge
A researcher performs 10 simultaneous hypothesis tests, each at the 5% level. What is the probability of at least one false positive? How does Bonferroni correction solve the problem?
Show solution
With 10 independent tests at level , the probability of at least one false positive is — far above 5%. Bonferroni divides: . Limitation: Bonferroni is conservative (reduces power) when hypotheses are correlated; a less conservative alternative: FDR control via Benjamini-Hochberg.Show step-by-step (with the why)
- Probability of at least one false positive in independent tests: .
- For , : . Huge inflation.
- Bonferroni: use in each test.
- This guarantees familywise Type I error (Boole's inequality).
Cost: reduced power. With positive correlation among tests, Bonferroni is conservative.
- Ex. 110.37Challenge
In multiple regression, what is multicollinearity? What are the consequences for the estimated coefficients and for predictions ?
Show solution
Multicollinearity occurs when predictors are highly correlated. Consequences: (1) standard errors of inflated — coefficients unstable; (2) individual t-values are small even if overall model is significant; (3) predictions remain stable, but coefficients are not interpretable in isolation. Diagnosis: Variance Inflation Factor (VIF). Remedy: remove redundant predictors or use ridge regression. - Ex. 110.38ChallengeAnswer key
Compare simple random sampling, stratified sampling, and convenience sampling. What is the fundamental limitation of convenience sampling for statistical inference?
Show solution
Convenience sampling (e.g., your classmates, Instagram followers) introduces selection bias — the sample does not represent the population. Increasing does not correct systematic bias; it only reduces variance. Historical example: 1936 Literary Digest survey with 2.4 million responses but severe selection bias predicted the US election wrongly. Stratified sampling can be more efficient than SRS for heterogeneous populations. - Ex. 110.39ChallengeAnswer key
A diagnostic test has sensitivity 90% and specificity 95%. Disease prevalence in the population is 1%. A patient tested positive. What is the positive predictive value (PPV) — that is, what is the probability the patient really has the disease? Use Bayes' theorem.
Show solution
Using Bayes: , , prevalence . . PPV . Striking conclusion: even with 90% sensitivity, only ~15% of positives actually have the disease when prevalence is 1%. This is the screening paradox with rare diseases.Show step-by-step (with the why)
- Define events: = disease, = positive test.
- Data: , implies . .
- Law of total probability: .
- Bayes: .
The paradox: with low prevalence, false positives outnumber true positives — PPV stays low even with accurate tests.
- Ex. 110.40Proof
Prove that the sample variance is an unbiased estimator of , that is, that . Why is division by (not by ) necessary?
Show solution
Proof of unbiasedness: . Expansion: . Thus . Dividing by : . Dividing by would give .Show step-by-step (with the why)
- Write .
- Take expectation: .
- .
- .
- Dividing by : . Q.E.D.
Sources
- OpenIntro Statistics (4th ed.) — Diez, Çetinkaya-Rundel, Barr · CC-BY-SA · Foundation for CI, z/t tests, ANOVA, regression, and chi-square (§5–8).
- Statistics (OpenStax) — Illowsky, Dean · CC-BY · Systematic coverage of CI (§8), hypothesis testing (§9), two samples (§10), chi-square and ANOVA (§11), linear regression (§12–13).
- Statistical Thinking for the 21st Century — Poldrack · CC-BY-NC · Modern approach to Bayesian inference (Ch. 15), positive predictive value, and p-value interpretation.
- Introduction to Probability — Grinstead and Snell · GNU FDL · Properties of variance and estimator proofs (§9.3).