Confidence intervals, chi-square and regression
引入| English | 释义 | 拼音 |
|---|---|---|
| confidence interval/ˈkɒnfɪdəns ˈɪntəvl/ | 置信区间 | zhì xìn qū jiān |
| chi-squared test/kaɪ skweəd test/ | 卡方检验 | kǎ fāng jiǎn yàn |
"Student" at the Guinness brewery, 1908
- William Sealy Gosset worked for the Guinness brewery in Dublin, testing barley and hops with very small samples. In 1908 he published the distribution now called Student's $t$ — under the pen name "Student", because Guinness did not want competitors to know it used statistics.
- Small samples give uncertain estimates. A confidence interval 置信区间 gives a range of plausible values for a population mean; a chi-squared test 卡方检验 checks whether categorical data fit a model or are independent.
Gosset published the t-distribution under the name "Student".
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Guinness kept its methods secret.
Confidence intervals
- With known $\sigma$: $\bar x \pm z^*\dfrac{\sigma}{\sqrt n}$, with $z^* = 1.96$ for 95%. With unknown $\sigma$, the GDC uses the $t$-distribution and the sample standard deviation.
- A larger sample gives a narrower interval: the width scales with $\tfrac{1}{\sqrt n}$.
If the sample size is multiplied by 4, the confidence interval width is
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Width ∝ 1/√n.
x̄ = 50, σ = 5, n = 25. Find the upper limit of the 95% interval.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
50 + 1.96 × 1.
Chi-squared test for independence
- Expected count $= \dfrac{\text{row total} \times \text{column total}}{\text{grand total}}$. $\chi^2 = \sum\dfrac{(O - E)^2}{E}$.
- Degrees of freedom $= (\text{rows} - 1)(\text{columns} - 1)$; combine categories if any $E < 5$.
Confidence intervals, chi-square and regression
For a normal mean with known σ, a 95% interval is sample mean±1
Compare the model with the worked case and explain one change.
A row total is 40, a column total is 60 and the grand total is 200. Find the expected count.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
40 × 60 ÷ 200.
How many degrees of freedom has a 3 × 4 contingency table?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
2 × 3.
Regression revisited
- Test whether a correlation is significant; use residuals and $R^2$ to compare non-linear models fitted on the GDC.
Worked example: an interval and a test
- Interval: $n = 25$ packets, $\bar x = 50.0$ g, known $\sigma = 5$ g: $50.0 \pm 1.96 \times \dfrac{5}{5} = 50.0 \pm 1.96$, giving $[48.04, 51.96]$ g. A label claim of 52 g lies outside it.
- $\chi^2$: 100 students, preference for online or paper revision by year group: observed $\begin{pmatrix}30 & 20\\ 20 & 30\end{pmatrix}$, all row and column totals 50, so each $E = 25$.
- $\chi^2 = 4 \times \dfrac{5^2}{25} = 4$, with 1 degree of freedom; the 5% critical value is 3.841. Since $4 > 3.841$, reject independence: preference is associated with year group.
In the worked example, find χ².
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
4 × 25/25.
Interpreting an interval
- "95% confidence" describes the method: about 95% of intervals built this way contain the true mean. It is not a 95% probability for this particular interval.
A 95% interval has a 95% probability of containing the mean after it is calculated.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
95% describes the method.
Do not run $\chi^2$ on percentages or tiny expected counts. Use observed frequencies, and merge categories until every expected count is at least 5.
A confidence interval $\bar x \pm z^*\tfrac{\sigma}{\sqrt n}$ (or $t$ with sample $s$) gives plausible values for a mean and narrows as $n$ grows. For $\chi^2$, compute expected counts, $\sum\tfrac{(O - E)^2}{E}$ and degrees of freedom, compare with the critical value or p-value, and conclude in context.
A sample of 36 batteries has mean life 480 hours, with known σ = 30. Find a 95% confidence interval and comment on a claim of a 500-hour mean.
Interval, then judgement.