Statistical Tests — Chi-Squared and (HL) t-tests

Statistical Tests — Chi-Squared and (HL) t-tests

The idea of a hypothesis test

A hypothesis test uses sample data to decide between two competing claims about a population. The null hypothesis $H_0$ states "no effect / no association," while the alternative hypothesis $H_1$ states the opposite. We compute a test statistic and a $p$-value — the probability of data at least as extreme as ours if $H_0$ were true. We compare the $p$-value with a chosen significance level $\alpha$ (commonly $0.05$): if $p < \alpha$ we reject $H_0$; otherwise we do not reject it. Equivalently, we compare the calculated statistic with a critical value.

The chi-squared test for independence

The $\chi^2$ test for independence checks whether two categorical variables are associated. Suppose a streaming service surveys viewers and records preferred genre against ag