2025-09-17

Setup

This presentation will briefly discuss the topic of Hypothesis Testing within Statistics. We will be using the “Seatbelts” dataset provided in R Studio, which includes data concerning road casualties in Great Britain between the years 1969 and 1984.

To better work with data, we first transform it from a Time-Series to a dataframe, adding the month and year data as a single column.

data("Seatbelts")
df <- as.data.frame(Seatbelts)
time_index <- time(Seatbelts)
df$time <- as.Date(paste
        (floor(time_index), 
        round((time_index - floor(time_index)) * 12)
        + 1, 1, sep = "-"))

Data Under Consideration

Here we present a plot of the data showing the numbers of auto accident deaths by month and year.

Hypotheses

Hypothesis Testing can be summarized as a process by which a claim is evaluated, an alternate claim is proposed, and a determination is made as to whether the hypothesis should be rejected.

The claim proposed in this presentation is that the average number of vehicle related deaths in Great Britain between the years 1969 and 1984 is greater than or equal to 150. This will be our null hypothesis.

The alternate claim will then be that the average number of those same deaths is less than 150.

Standard Deviation

We will need to calculate our standard deviation in order to conduct the test. The equation is as follows:

\[\sigma = \sqrt\frac{\sum{(X-\mu)^2}}{N}\] We can use R to calculate this value with our given dataset.

stand_dev = sd(df[,1])

The standard deviation for this dataset is 25.3798864

Variables

Here we present the variables we have so far to conduct the test.

m = mean(df[,1])
h = 150
n = nrow(df)
a = 0.05

We will be testing our hypothesis with a significance level of 5%.

\[\alpha=0.05\]

Plot of Normal Distribution

Here, we show a plot of the normal distribution around our calculated mean.

Calculating Critical Value

We need to calculate our critical value in order to determine what values fall within the rejection region. To do that, we require the use of a z-table, which will not be printed here due to size constraints. However, given an alpha value of .05, we arrive at a z-value of 1.65.

\[c=\mu + (z_c \times (\frac{\sigma}{\sqrt{n}}))\]

z = 1.65
cv = m + (z * (stand_dev / sqrt(nrow(df))))

Our critical value is 125.824282

Shading the area of our critical value

Here, we shade the area of our critical value. If the null hypothesis falls within the region shaded, we must reject it.

Conclusion

Finally, we decide whether to reject or not reject our null hypothesis.

The value we proposed was greater than or equal to 150. As such, we must reject the null hypothesis since that value falls squarely within our rejection region.