Sometimes we want to know if 2 variables are independent of each other, for example:
To answer the question we can use the ChiSquared test of independence. It is always the same routine, and you can use technology to help you, so learn the routine and you will have no problems in exams, or more importantly in any statistical study you are asked to complete. Essentially we are comparing a table of observed values and a table of expected values, and seeing if there is a major difference between the two. 'Major difference' is a little subjective so we have criteria for this too.
 Is your favourite colour dependent on your gender?
 Is your favourite sports team dependent on where you live?
 Is you favourtie genre of book independent of your age?
To answer the question we can use the ChiSquared test of independence. It is always the same routine, and you can use technology to help you, so learn the routine and you will have no problems in exams, or more importantly in any statistical study you are asked to complete. Essentially we are comparing a table of observed values and a table of expected values, and seeing if there is a major difference between the two. 'Major difference' is a little subjective so we have criteria for this too.
Step 1  write down the null hypothesis
H0 The colour of Tshirt chose is independent of gender
I will also write the alternative Hypothesis for completeness
H1 The colour of Tshirt chose is not independent of gender
I will also write the alternative Hypothesis for completeness
H1 The colour of Tshirt chose is not independent of gender
Step 2Calculate the ChiSquared value

Step 3:
 Determine the pvalue by using excel or your GDC
 Work out the critical value by using an online table. To work this out you will need to calculate the degrees of freedom, which is (number of columns  1)x(number of rows 1). In an examination this critical value will be given.
Step 4:
 Compare the pvalue against the significance level. You will determine this in your own project but it will be given in examinations
 Compare the ChiSquared value against the critical value from the step above.
Step 5:
We reject our null hypothesis if:
We fail to reject our null hypothesis if:
Note that the statements are opposites and we don't really prove our null hypothesis, we simply fail to reject it.
 The pvalue is smaller than the significance value
 The ChiSquared value is greater than the critical value.
We fail to reject our null hypothesis if:
 The pvalue is greater than the significance value
 The ChiSquared value is smaller than the critical value.
Note that the statements are opposites and we don't really prove our null hypothesis, we simply fail to reject it.