Real-Life Hypothesis Tests

These problems arise from my actual experience, but numbers have been fudged to protect confidentiality.

Problem 1 (Population Mean). As I taught my classes, I noticed that students are exceedingly taller than I. My height is 160 cm, so I suspect that the average height \mu of students is not 160 cm. By collecting the heights x cm of 30 randomly chosen students, I obtained the following data:

\Sigma x = 4840,\quad \Sigma x^2 = 781\, 176.

Test at the 5% significance level to determine whether my suspicion is justified.

(Click for Solution)

Solution. Let X denote the height of a randomly chosen student in cm, and \mu = \mathbb E[X].

We first set up the null and alternative hypotheses:

\mathrm H_0 : \mu = 160,\quad \mathrm H_1 : \mu \neq 160.

Denote the population variance by \sigma^2 and n = 30. Assume \mathrm H_0 holds, so that \mu = 60. Since n \geq 30, by the central limit theorem,

\displaystyle \frac{\bar X_n - \mu}{\sigma / \sqrt{n}} \approx Z \sim \mathcal N(0, 1).

Since \sigma^2 is unknown, we need to estimate it using s^2:

\displaystyle s^2 = \frac 1{30-1} \left( 781\, 176 - \frac{4840^2}{30} \right) \approx 11.1.

Furthermore, we estimate \mu using \bar x:

\displaystyle \bar x = \frac{4840}{30} \approx 161.

Hence, our calculated test statistic c will be

\displaystyle c := \frac{\bar x - \mu}{s/\sqrt{n}} = \frac{161.33 - 160}{\sqrt{11.126 / 30}} \approx 2.19.

Since n \geq 30, t(n-1) \approx \mathcal N(0, 1), so that using either a z– or a t-test would yield similar results. Denote T \sim t(n-1) and the significance level \alpha = 0.05.

  • Using a z-table, p \leq \alpha \iff |z| \geq 1.96.
  • Using a t-table, p \leq \alpha \iff |t| \geq 2.05.

Whether we let z = c or t = c, it is true that p \leq \alpha. Therefore, there is sufficient evidence to reject \mathrm H_0 and conclude that Joel’s suspicion is justified, i.e. the average height of students is larger than 160 cm.

Problem 2 (Confidence Intervals). Keep the scenario as Problem 1 but denote the true population mean by \mu_0. Use the t-test for simplicity. Determine the interval of values that \mu_0 can take such that there is insufficient evidence to reject the null hypothesis at the 5% significance.

(Click for Solution)

Solution. By definition,

\displaystyle t = \frac{\bar x - \mu_0}{s / \sqrt n} \quad \iff \quad \mu_0 = \bar x - t \cdot \frac{s}{\sqrt n}.

We do not reject \mathrm H_0 if and only if p > \alpha = 0.05. Therefore,

p > \alpha \quad \iff \quad |t| < 2.05 =: t_{\alpha/2} \quad \iff \quad -t \in (-t_{\alpha/2}, t_{\alpha/2}).

Therefore,

\displaystyle \mu_0 = \bar x - t \cdot \frac{s}{\sqrt n} \in \left( \bar x - t_{\alpha/2} \cdot \frac{s}{\sqrt n}, \ \bar x + t_{\alpha/2} \cdot \frac{s}{\sqrt n}\right).

Remark 1. We call this calculated interval the (1-\alpha)-confidence interval for \mu_0. Denoting a specific sample K := \{X_1,\dots, X_n\}, let \bar X_K, S_K^2 denote the corresponding computed unbiased estimators for \mu, \sigma^2 respectively. Then the computed corresponding confidence interval I_K will equal

I_K = \displaystyle \left( \bar X_K - t_{\alpha/2} \cdot \frac{S_K}{\sqrt n}, \bar X_K + t_{\alpha/2} \cdot \frac{S_K}{\sqrt n}\right).

Hence, different samples would yield different confidence intervals. Since K is random, so is I_K. Furthermore, defining T := (\bar X_K - \mu_0)/(S_K/\sqrt n) \sim t(n-1), mimicking the computation above yields

\mathbb P(\mu_0 \in I_K) = \mathbb P(- t_{\alpha/2} < T < t_{\alpha/2}) = 1-\alpha.

Thus, we have the following interpretation of a (1-\alpha)-confidence interval: the probability that a randomly chosen confidence interval will contain the (deterministic though unknown) population mean is (1-\alpha).

Problem 3 (Population Proportion). I went to a nearby café, and noticed that there were more women than men in the café. Out of 50 people present, 32 were women.

I suspect that it is true in general that there were more women than men in Starbucks on average. Test at the 5% significance level to determine whether my suspicion is justified.

(Click for Solution)

Solution. Let \xi be a Bernoulli random variable that represents the gender of a person. Here \xi = 0 denotes that the person is a man and \xi = 1 denotes that the person is a woman. Denote p := \mathbb E[\xi], which yields the proportion of women in the café.

We first set up the null and alternative hypotheses:

\mathrm H_0 : p = 0.5,\quad \mathrm H_1 : p > 0.5.

Assume \mathrm H_0 holds, so that p = 0.5. We next estimate p using \bar \xi_n:

\displaystyle \bar \xi_n = \frac{32}{50} = 0.64.

Since n = 50 \geq 30 and np(1-p) = 12.5 \geq 10, by the central limit theorem,

\displaystyle \frac{\bar \xi_n - p}{\sqrt{p(1-p)}/\sqrt n} \approx Z \sim \mathcal N(0, 1).

Hence, our calculated test statistic, the z-value, will be as follows:

\displaystyle z := \frac{0.64 - 0.5}{ \sqrt{0.5 (1-0.5 )}/\sqrt{50} } \geq 1.97.

Using a z-table, p := \mathbb P(Z > z) < 0.05 = \alpha  \iff z > 1.645, which holds. Therefore, there is sufficient evidence to reject \mathrm H_0 and conclude that Joel’s suspicion is justified, i.e. there are more women than men on average.

Problem 4 (Goodness-of-Fit). A total of 750 students took an assessment worth 10 marks. For each k = 1, 2, \dots, 10, let f(k) denote the number of students who scored k marks out of 10. We have the following data:

Assuming that scores are continuous, determine at the 5% significance level if the scores can be well-approximated using a normal distribution.

(Click for Solution)

Solution. Let X denote the score of a randomly chosen student with \mu = \mathbb E[X] and \sigma^2 = \mathrm{Var}(X). We first set up the null and alternative hypotheses:

\mathrm H_0 : X \sim \mathcal N(\mu, \sigma^2),\quad \mathrm H_1 : X \not \sim \mathcal N(\mu, \sigma^2).

We first estimate \mu and \sigma^2 using \bar x and s^2 respectively. Denoting the scores by x, the summary statistics are

\Sigma x = 3600,\quad \Sigma x^2 = 21\, 600.

Hence,

\displaystyle \bar x = \frac{3650}{750} \approx 4.87,\quad s^2 = \frac 1{749} \left(21\, 600 - \frac{3600^2}{750}\right) \approx 4.12.

Now we assume \mathrm H_0 holds, so that X \sim \mathcal N(4.87, 4.12). Denoting

p_k := \mathbb P(k - 0.5 < X < k + 0.5),

we will use the test statistic

\displaystyle W = \sum_{k=1}^{10} \frac{ (f(k) - 750p_k)^2 }{ 750p_k } \sim \chi^2(9),

which follows a \chi^2-distribution with 10-1 = 9 degrees of freedom. For a proof for why this distribution works, refer to this document. Using relevant z-table look-up values (or a spreadsheet application), we obtain the following values for E_k \equiv 750 p_k (rounded to the nearest integer for readability, but whose original value we use in the final computation):

\begin{aligned} E_1 = 25 \quad E_2 = 55 \quad E_3 &= 96 \quad E_4 = 133 \quad E_5 = 146 \\ E_6 = 125 \quad E_7 = 85 \quad E_8 &= 45 \quad E_9 = 19 \quad E_{10} = 6 \end{aligned}

Piecing all of the values together,

\displaystyle w = \sum_{k=1}^{10} \frac{ (f(k) - 750 p_k)^2}{ 750 p_k } \approx 1.97.

Using a \chi^2-table, p := \mathbb P(W > w) < 0.05 = \alpha \iff w > 18.3, which does not hold. Therefore, there is (woefully) insufficient evidence to reject \mathrm H_0 and we cannot conclude that X does not follow a normal distribution.

Problem 5 (Population Variance). Using the data in Problem 4, and assuming that the scores are normally distributed, test at the 5% significance level to determine if the standard deviation of assessment scores is greater than 2.

(Click for Solution)

Solution. We first set up the null and alternative hypotheses:

\mathrm H_0 : \sigma^2 = 4, \quad \mathrm H_1 : \sigma^2 > 4.

We use the test statistic W := (n-1) S^2 / \sigma^2 \sim \chi(n-1):

\displaystyle w = \frac{ (750 - 1) \cdot 4.12105 }{ 4 } \approx 772.

Using a spreadsheet application, \mathbb P(W > w) < 0.05 = \alpha \iff w > 686. Therefore, there is sufficient evidence to reject \mathrm H_0 and conclude that \sigma^2 > 4, which implies \sigma > 2.

—Joel Kindiak, 4 Dec 25, 1915H

Published by


Leave a comment