Hypothesis testing
A crisp manufacturer claims that its bags weigh $150$ g; a guidance counsellor at a secondary school in Cork suspects that her 6th Year students spend less time on their phones than the national average. In both cases there is a starting claim and a sample that may, or may not, contradict it. Hypothesis testing is the formal procedure for deciding, using a sample, whether that claim stands or is rejected.
Null and alternative hypotheses
In quality control at a crisp factory, we wish to check whether the mean weight of the packets is really $150$ grams, as stated on the packaging. The population standard…
In quality control at a crisp factory, we wish to check whether the mean weight of the packets is really $150$ grams, as stated on the packaging. The population standard deviation is known to be $\sigma = 5$ grams. If it is suspected that the packets may weigh either more or less than stated:
- a) State the hypotheses $H_0$ and $H_1$.
- b) If we set a significance level of $\alpha = 0.05$, calculate the critical values $z_{\alpha/2}$ that bound the acceptance region.
Type I and type II errors
Explain in your own words what it means to make a Type I Error in the context of a study attempting to test whether a new study method improves mathematics marks (where…
Explain in your own words what it means to make a Type I Error in the context of a study attempting to test whether a new study method improves mathematics marks (where $H_0$ is that the method yields no improvement).
A new model of running shoes designed to increase performance is being tested. The manufacturer sets the null hypothesis $H_0$: "The mean performance with the new model…
A new model of running shoes designed to increase performance is being tested. The manufacturer sets the null hypothesis $H_0$: "The mean performance with the new model is equal to that of the previous model" against the alternative hypothesis $H_1$: "The mean performance is higher".
Give reasons explaining what making a Type I error and a Type II error would mean in this practical context. Which of the two errors do you think would be more damaging to the company's brand image if discovered later?
The Environmental Protection Agency (EPA) conducts periodic checks on discharges from a paper mill into a riverbed. Due to environmental regulations, the mean nitrate…
The Environmental Protection Agency (EPA) conducts periodic checks on discharges from a paper mill into a riverbed. Due to environmental regulations, the mean nitrate concentration must not exceed $\mu_0 = 15\text{ mg/l}$. It is assumed that the measurements follow a normal distribution with a known standard deviation $\sigma = 2\text{ mg/l}$. The administration takes a sample of $n = 16$ independent water samples and sets up the test $H_0: \mu \le 15$ against $H_1: \mu > 15$.
- a) Precisely define what it means to commit a Type I error and a Type II error in this specific scenario. Explain in detail the practical and real consequences that each would entail for the paper mill and for the river ecosystem.
- b) At the technical committee, a disagreement arises regarding the significance level: the company's legal counsel requests setting $\alpha = 0.01$, while the environmental protection technicians prefer $\alpha = 0.10$. Reason which type of error each party seeks to minimize and which of the two levels provides greater guarantee of immediate intervention in the event of actual pollution.
- c) After performing the laboratory analyses of the $n = 16$ samples, a mean concentration of $\bar{x} = 16.1\text{ mg/l}$ is obtained. Calculate the p-value of the test and determine with reasoning what penalty or administrative resolution would be adopted under the company's criterion ($\alpha = 0.01$) and under the environmental criterion ($\alpha = 0.10$). How does this result illustrate that the chosen significance threshold conditions decision-making?
Test statistic and p-value for a mean
The tables in Formulae and Tables give $P(Z We are conducting a two-tailed hypothesis test for the mean of a normal population with known $\sigma$. After calculating the test statistic with the data from a sample, we obtain a value of $z_{exp} = 2.15$. If the critical values for a significance level of $\alpha = 0.05$ are $-1.96$ and $1.96$, reason whether we should accept or reject the null hypothesis. The Road Safety Authority (RSA) states that the mean speed on a peri-urban stretch regulated with an educational radar is $\mu = 80\text{ km/h}$, with a known population standard deviation of $\sigma = 10\text{ km/h}$. A neighborhood association claims that vehicles travel at a higher mean speed. To test this, they record the speed of a random sample of $n = 100$ vehicles and obtain a sample mean of $\bar{x} = 81.8\text{ km/h}$. A study on youth mental health indicates that the daily mean time that Sixth Year students spend on TikTok is $120$ minutes, with a standard deviation of $30$ minutes. A counsellor at a school believes that at their centre, due to the pressure of the Leaving Certificate exams, the mean time is significantly lower. They take a random sample of $50$ students and obtain a mean of $112$ minutes. An express courier company in Ireland guarantees a mean delivery time between counties of $\mu_0 = 24\text{ hours}$, with a known dispersion of $\sigma = 3\text{ hours}$. Management audits the service using the test $H_0: \mu = 24$ against $H_1: \mu > 24$ (suspicion of delays) at a significance level $\alpha = 0.05$ ($z_{0,05} = 1.645$).We are conducting a two-tailed hypothesis test for the mean of a normal population with known $\sigma$. After calculating the test statistic with the data from a sample,…
The Road Safety Authority (RSA) states that the mean speed on a peri-urban stretch regulated with an educational radar is $\mu = 80\text{ km/h}$, with a known population…
A study on youth mental health indicates that the daily mean time that Sixth Year students spend on TikTok is $120$ minutes, with a standard deviation of $30$ minutes. A…
An express courier company in Ireland guarantees a mean delivery time between counties of $\mu_0 = 24\text{ hours}$, with a known dispersion of…
Test for a proportion
Sara wants to check whether the proportion of users satisfied with her city's municipal bike-sharing service has decreased compared to the official historical figure,…
Sara wants to check whether the proportion of users satisfied with her city's municipal bike-sharing service has decreased compared to the official historical figure, which was $70\,\%$ ($p_0 = 0.70$). To do so, she surveys $n = 100$ randomly selected users and observes that $62$ of them report being satisfied (that is, $\hat{p} = 0.62$). In her notebook, Sara writes the following:
-
Statement: $H_0: \hat{p} = 0.62$ versus $H_1: \hat{p} < 0.62$.
-
Test statistic: $z = \dfrac{0.62 - 0.70}{\sqrt{\dfrac{0.62 \times 0.38}{100}}} = \dfrac{-0.08}{0.0485} \approx -1.65$.
- a) Sara has made two serious conceptual errors in her approach. Identify both errors and explain why they contradict the theoretical foundations of hypothesis testing.
- b) Correct Sara's procedure: formulate the null and alternative hypotheses accurately with the appropriate population parameters, and calculate the correct value of the experimental test statistic $z_{\text{exp}}$.
In a sustainability study, it is known that two years ago $30\ \%$ of young people in a town used public transport to get to school. Following an environmental awareness…
In a sustainability study, it is known that two years ago $30\ \%$ of young people in a town used public transport to get to school. Following an environmental awareness campaign, we want to test whether this percentage has increased. A random sample of $150$ young people is taken, and it is observed that $54$ of them now use public transport.
From these data, and with a significance level of $5\ \%$, can it be concluded that the campaign was effective and the proportion of users has increased? Set up the corresponding hypothesis test.
A health centre claims that the proportion of smokers among young people aged between 16 and 18 is $15\ \%$. To verify this, a study is conducted on a sample of $400$…
A health centre claims that the proportion of smokers among young people aged between 16 and 18 is $15\ \%$. To verify this, a study is conducted on a sample of $400$ young people in that age range, revealing that $72$ of them smoke.
Calculate the p-value (the probability of obtaining a result as extreme as, or more extreme than, the observed result under the null hypothesis) for a two-tailed test. In light of the result, would you reject the health centre's claim at a standard significance level of $\alpha = 0.05$?
The relationship between confidence interval and hypothesis test
Margin of error method for a proportion
The $95\%$ confidence interval for a population proportion is $\hat{p} \pm 1.96\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n}}$. Its largest possible radius is the margin of error, approximately $\dfrac{1}{\sqrt{n}}$. To test $H_0: p=p_0$ at $5\%$, reject $H_0$ if $p_0$ lies outside $\hat{p} \pm \dfrac{1}{\sqrt{n}}$.
A study was conducted on the monthly leisure expenditure of university students in a city, assuming it follows a normal distribution with $\sigma = 20$ euros. A $95\ \%$…
A study was conducted on the monthly leisure expenditure of university students in a city, assuming it follows a normal distribution with $\sigma = 20$ euros. A $95\ \%$ confidence interval for the mean was obtained as $(75.1; 84.9)$.
Without carrying out new standardisation calculations, use the relationship between confidence intervals and hypothesis tests to answer: Would the null hypothesis $H_0: \mu = 70$ euros be rejected against $H_1: \mu \neq 70$ euros at a significance level of $\alpha = 0.05$? What if the null hypothesis were $H_0: \mu = 80$ euros? Justify your answer.
In a canning plant in County Cork, the nominal net weight of beetroot jars must be $\mu = 250\text{ g}$. From historical controls, it is known that the population…
In a canning plant in County Cork, the nominal net weight of beetroot jars must be $\mu = 250\text{ g}$. From historical controls, it is known that the population standard deviation of the packaging process is $\sigma = 8\text{ g}$. To verify that the automatic filling machine has not become miscalibrated (neither above nor below), the quality team takes a random sample of $n = 64$ jars and obtains a mean weight of $\bar{x} = 252.2\text{ g}$. With a significance level $\alpha = 0.05$, three engineers propose three different ways to make the decision:
-
Aoife proposes constructing the $95\,\%$ confidence interval for the population mean and checking whether $\mu_0 = 250\text{ g}$ belongs to that interval.
-
Seán proposes calculating the standardized statistic $z_{\text{exp}}$ and comparing it with the two-tailed critical values $\pm 1.96$.
-
Niamh proposes directly calculating the exact p-value of the statistic and comparing it with $\alpha = 0.05$.
- a) Apply the procedures of Aoife and Seán. Show your calculations and explain why both necessarily lead to the same statistical decision in a two-tailed test.
- b) Suppose that the operations director needs an answer to the following question: “What was the exact probability of having obtained a deviation from the nominal weight as large as or larger than the observed one if the machine were perfectly calibrated?”. Justify which of the three methods directly answers that question, calculate it, and interpret the result in terms of evidence against the null hypothesis.
In a debate on sustainability, it is claimed that $75\%$ of young people in a city separate plastic packaging from the rest of the rubbish. To verify this, a sample of…
In a debate on sustainability, it is claimed that $75\%$ of young people in a city separate plastic packaging from the rest of the rubbish. To verify this, a sample of $150$ young people is selected, and it is observed that $105$ of them recycle correctly.
- a) Set up the hypothesis test to check whether the true proportion is lower than claimed.
- b) Is the initial claim acceptable for a significance level of $10\%$?
- c) Suppose that the true proportion were $65\%$. What decision would most likely be made with this test if the sample size were only $20$ people? Reason about the importance of sample size on the power of the test.
According to the CSO's Census of Population, the percentage of Irish single-person households (where a single person lives) historically stood at $26\,\%$ (…
According to the CSO's Census of Population, the percentage of Irish single-person households (where a single person lives) historically stood at $26\,\%$ ($p_0 = 0.26$). A sociologist from Maynooth University claims that in major cities such as Dublin, Cork and Galway this percentage has increased significantly in recent years. To verify this, they select a simple random sample of $n = 400$ households from a large metropolitan area and find that $124$ of them are single-person.
- a) Mathematically justify whether the approximation of the sample proportion using a normal distribution is applicable, checking the theoretical conditions on the expected number of successes and failures under the assumption that the null hypothesis is true.
- b) Model the situation using a hypothesis test: state the null and alternative hypotheses corresponding to the sociologist's suspicion, and calculate the standardized test statistic $z_{\text{exp}}$.
- c) For a significance level of $1\,\%$ ($z_{0,01} = 2.33$), determine the rejection region and conclude with reasoning in the context of the problem whether there is sufficient evidence to support the sociologist's hypothesis.
Back to the start: If you analyse a sample of $36$ bags of crisps and obtain $\bar{x} = 148$ g with $\sigma = 6$ g, the statistic is $z_{exp} = \frac{148 - 150}{6 / \sqrt{36}} = -2$; since it falls in the rejection region for $\alpha = 0.05$ ($|-2| > 1.96$), you conclude that the manufacturer does not meet the promised $150$ g. For the counsellor, the answer depends on her sample and on the $\alpha$ she chose in advance.