graph LR
A(Two<br>Variables) --> B(Contingency<br>Tables) --> C(Chi-squared<br>Test) --> D(t-Test)
POP88162 Introduction to Quantitative Research Methods
Department of Political Science, Trinity College Dublin
graph LR
A(Two<br>Variables) --> B(Contingency<br>Tables) --> C(Chi-squared<br>Test) --> D(t-Test)
\[P(Y_{EU\_2016} = y, X_{GE\_2015} = x)\]
\[P(Y_{EU\_2016} = y | X_{GE\_2015} = x)\]
Null hypothesis:
\(H_0\): In the population vote choice in 2015 UK GE is independent from (has no association with) vote in 2016 UK EU membership referendum.
Alternative hypothesis:
\(H_a\): In the population vote choice in 2015 UK GE is associated with vote in 2016 UK EU membership referendum.
Let’s ask ourselves, what would we expect to see in our data if our \(H_0\) was true?
And does our data look like that?
\[f_e = \frac{total_{row} \times total_{column}}{n}\]
\[f_e = \frac{7018 \times 6401}{13912} = 3229\]
\[ \begin{aligned} \chi^2 = \sum\frac{(f_o - f_e)^2}{f_e} = \\ \frac{(4289 - 3229)^2}{3229} + \frac{(2729 - 3789)^2}{3789} + \\ \frac{(2112 - 3172)^2}{3172} + \frac{(4782 - 3722)^2}{3722} \approx \\ 1300 \end{aligned} \]
chisq.test() function:Source