Meet William Sealy Gosset.


Problem: A batch of beer should have a fixed [chemical level related to barley] in order to be of good quality. Can you test a small number of barrels and infer if the entire batch is of good enough quality?

The \(t\) distribution

Used to estimate the mean when you have a small sample drawn from a nearly normal population.

Conditions

  • Independent observations (\(n < 0.1 N\))
  • Nearly normal population distribution
    • Check distribution of the sample as a proxy

\(t\) versus normal

The \(t\) has heavier tails than the normal distribution.

Degrees of Freedom

The number of parameters that are free to vary, without violating any constraint imposed on it.

Parameters

\(\mu\)


Since \(\bar{x} = \frac{1}{n}\sum_{i = 1}^n x_i\), one of our observations is constrained, leaving \(n-1\) that are free to vary.

\[ df = n - 1\]

Hypothesis testing

  1. State hypotheses: e.g. \(H_0: \mu = \mu_0\) versus \(H_A: \mu \ne \mu_0\)
  2. Check conditions
    • Independent observations
    • Nearly normal population
  3. Compute observed \(t\)-statistic \[ t_{obs} = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} \]
  4. Draw picture to assess where \(t_{obs}\) falls in \(t_{df = n - 1}\)
  5. Compute a (two-tailed) \(p\)-value
  6. State conclusion

Confidence interval for \(\mu\)

point estimate \(\pm\) margin of error

\[ \bar{x} \pm (t^*_{df} \times SE) \]

  • \(\bar{x}\): point estimate of \(\mu\).
  • \(t^*_{df}\): critical value that leaves \(\alpha\) in the tails of a \(t\) with \(df = n - 1\).
  • \(SE\): standard error of \(\bar{x}\), \(s/\sqrt{n}\).

Finding \(p\)-values and \(t^*_{df}\)

pt(-2.2, df = 18)
## [1] 0.0206
qt(.025, df = 18)
## [1] -2.1

Example: The Kilogram

How do we know how much a kilogram weighs?

Example: The Kilogram

Meet the IPK: International Prototype Kilogram, Paris, France.

Example: The Kilogram

Question

The US has two copies of the IPK. Say they make a third copy for Reed. We take 6 measures of our new RPK and get the following:

## [1] 0.997 0.976 1.032 1.101 1.004

Is it a safe assumption that the RPK weighs the same as the IPK?

Extra problem