SST 301 • UNIT 8 • Statistics
Hypothesis Testing
Topics covered: Testing Framework, Parametric Testing (t-test)
Syllabus Study Notes (Core Overview)
Free Overview Preview1. Concept and Use Case
Hypothesis testing is a formal statistical procedure for deciding whether observed data provide sufficient evidence to reject a stated claim about a population. In this course, the procedure is applied within a computing context where statistical computation supports decision-making, and it builds directly on earlier work with pseudo-random number generators and simulation, since simulated data are frequently used to illustrate and validate the testing framework.
The central use case is the comparison of two sample means. When two groups are measured under different conditions, a natural question is whether the difference between their observed means reflects a genuine difference in the underlying populations or merely sampling variability. Student's $t$-test addresses this question under the assumption that the data are normally distributed.
The testing framework rests on four components:
- A null hypothesis, denoted $H_0$, which states the default position of no effect or no difference.
- An alternative hypothesis, denoted $H_a$, which states the effect or difference the analyst suspects.
- A test statistic, computed from the sample data, whose distribution under $H_0$ is known.
- A $p$-value, which quantifies the probability of obtaining a test statistic at least as extreme as the one observed, assuming $H_0$ is true.
The decision rule compares the $p$-value against a pre-specified significance level $\alpha$. If the $p$-value is less than or equal to $\alpha$, $H_0$ is rejected in favour of $H_a$; otherwise, there is insufficient evidence to reject $H_0$.
2. Data, Syntax, and Core Concepts
2.1 Hypotheses
The null hypothesis $H_0$ is a statement of equality or no effect. For a two-sample comparison of means, the typical form is
$$
H_0: \mu_1 = \mu_2
$$
where $\mu_1$ and $\mu_2$ denote the population means of the two groups. The alternative hypothesis $H_a$ may be two-sided or one-sided:
$$
H_a: \mu_1 \neq \mu_2
$$
$$
H_a: \mu_1 > \mu_2
$$
$$
H_a: \mu_1 < \mu_2
$$
The choice among these forms must be made before examining the data, since it determines how the $p$-value is computed.
2.2 Significance Level
The significance level $\alpha$ is the probability of rejecting $H_0$ when $H_0$ is in fact true. It is chosen by the analyst prior to the test. Common values are $0.05$ and $0.01$. The significance level defines the rejection region: the set of test statistic values for which $H_0$ is rejected.
2.3 Test Statistic
A test statistic is a numerical summary of the sample data whose sampling distribution under $H_0$ is known. For the two-sample $t$-test, the statistic measures the standardised difference between the two sample means. The general form is
$$
t = \frac{\text{difference of sample means}}{\text{standard error of the difference}}
$$
The standard error quantifies the variability expected in the difference of sample means due to random sampling alone.
2.4 $p$-value
The $p$-value is the probability, computed under the assumption that $H_0$ is true, of observing a test statistic at least as extreme as the value actually obtained. A small $p$-value indicates that the observed data would be unlikely if $H_0$ were true, providing evidence against $H_0$.
2.5 Normality Assumption
Student's $t$-test assumes that the data in each group are drawn from a normal distribution. This assumption justifies the use of the $t$-distribution for the test statistic. When sample sizes are large, the test is relatively robust to mild departures from normality, but the assumption remains central to the derivation of the test.
Unlock Complete Study Notes & Exam Traps
The full guide includes formal proofs, worked exemplar calculations, high-yield exam traps, and examiner marking schemes. Continue studying this topic in Mentify Prep Studio.
Verified Examination Problems
3 verified questions in catalogQuestion 2 (5 marks)
A researcher wants to compare the mean exam scores of two independent groups of students taught by two different methods. A random sample of 12 students from Method A gives a sample mean of 78 with a sample standard deviation of 6.5. An independent random sample of 15 students from Method B gives a sample mean of 73 with a sample standard deviation of 7.2. Assume that the exam scores in each group are normally distributed and that the two population variances are equal.
(a) State the null and alternative hypotheses for testing whether the two population means differ.
(b) Calculate the pooled sample variance and the standard error of the difference in sample means.
(c) Compute the test statistic for the two-sample $t$-test.
(d) Using a significance level of $\alpha = 0.05$, state the critical value(s) and make a conclusion. What is your interpretation of the result?
Question 3 (1 marks)
A random sample of 20 men was taken to investigate whether lifetime alcohol consumption affects deltoid muscle strength in the non-dominant arm. Let $X$ denote the total lifetime dose of alcohol consumed and $Y$ the deltoid muscle strength. A simple linear regression of $Y$ on $X$ was fitted and the following output was obtained:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 22.6020 3.8011 5.946 1.59e-05 ***
alcohol -0.1901 0.1331 -1.428 0.171
---
Residual standard error: 6.582 on 17 degrees of freedom
Multiple R-squared: 0.1072, Adjusted R-squared: 0.05472
F-statistic: 2.039 on 1 and 17 DF, p-value: 0.1714
State the null and alternative hypotheses that would be used to test whether there is a significant linear relationship between alcohol consumption and muscle strength.
Access all authentic past questions, interactive AI hint generation, and full marking rubrics in the course studio.
Unlock All Questions in Studio →