The Student Room Group

Help with goodness of fit and contingency tables

Hi, there is a question I can't work out:

The data in the following contingency table was used in investigation whether A and B are independent categories.

A1 A2 A3 A4

B1 53 39 64 24
B2 27 31 36 26

(i) Explain why the expected frequency in the cell (B1,A1) is 48.

(ii) Calculate the value of the X^2 statistic.
(edited 6 years ago)
Reply 1
Original post by tom_arbon
Hi, there is a question I can't work out:

The data in the following contingency table was used in investigation whether A and B are independent categories.

A1 A2 A3 A4

B1 53 39 64 24
B2 27 31 36 26

(i) Explain why the expected frequency in the cell (B1,A1) is 48.

(ii) Calculate the value of the X^2 statistic.


Could you give some specifics as to what is confusing you? Or attach some working out that you have tried?
Reply 2
After some research, I now understand the (i) part. Its the (ii) part which is confusing me. I'm not entirely sure what they are asking me to work out.
Reply 3
Original post by tom_arbon
After some research, I now understand the (i) part. Its the (ii) part which is confusing me. I'm not entirely sure what they are asking me to work out.


Are u familiar with chi squared tests?

The test statistic is given by

Where Oi is the observed value and Ei is the expected value.

The degrees of freedom of a contingency table is given by:

(No of rows -1)*(No of columns -1)
Original post by tom_arbon
Hi, there is a question I can't work out:

The data in the following contingency table was used in investigation whether A and B are independent categories.

A1 A2 A3 A4

B1 53 39 64 24
B2 27 31 36 26

(i) Explain why the expected frequency in the cell (B1,A1) is 48.

(ii) Calculate the value of the X^2 statistic.


(i). Finding expected frequencies: (Row Total * Column Total) / (Grand Total)

(ii) Calculating the value of the X^2 statistic.

There are two methods: I used the one proposed above by Shaanv to calculate the test of statistic as a measure of goodness of fit.
So using the formula I've given you in part (i), calculate the expected frequencies for each cell.

If the variables A and B are independent, they will have no association.
If A and B are not independent i.e. dependent, they will have an association.

Degrees of freedom = (number of rows - 1)(number of columns - 1).

If you calculate all the expected frequencies and since you're given the observed frequencies, you can now substitute them for each cell into the formula and add them all up giving the X^2 statistic.

Find the critical value using the significance level and degrees of freedom from the chi-squared distribution.

From the diagram or curve drawn when sketching the probability distribution function of the chi-squared distribution: the chi-squared probability distributution/density function.

If X^2 (test statistic) < critical value,
X^2 is not in the critical region and therefore no rejection - accept null hypothesis (H0) - there are independent.

If X^2 (test statistic) > critical value,
X^2 is in the critical region and therefore you reject the null hypothesis (H0) - the two variables are dependent i.e. accept H1.
(edited 6 years ago)

Quick Reply

Latest