Chi-squared test Flashcards
What is a chi test?
- Test for an association between 2 categorical variables
- Based on the chi-squared distribution with n degrees of freedom
where n is given by (no. of rows-1) x (no. of columns-1) - Equivalent to the z test for two proportions (where each variable
has only 2 categories) - Gives a P value but no direct estimate or confidence interval for
the estimates
What is the null hypothesis?
In the population where the samples come, there is no association between the two variables
What can be calculated by the Chi test?
- Calculates the expected frequencies if there were no association (i.e. null hypothesis is true)
- Compares the observed frequencies with these expected values
- If the observed frequencies are very different to the expected values this provides evidence that there is an association
- The test uses a formula based on the chi-squared distribution to
give a P value
What are the assumptions of chi test?
- ‘Large sample’ test
Rule of thumb for test to be valid: - at least 80% of expected frequencies must be greater than 5
- For 2x2 test this will be true if all frequencies >5
If assumptions don’t hold, consider collapsing the table if multi-category, or using Fisher’s exact test
Rules of chi squared
- Always use with frequencies, never use percentages for calculations
- Chi-squared test works for all size tables
- The test is usually done with a computer program – the following
calculations are done to show how the test works
What does the small p value mean?
This has degrees of freedom (3-1) x (2-1) = 2 and the P value is <0.0001
* The very small p-value provides
* strong evidence to suggest that there is an association between gender and ice cream flavour preference
* strong evidence to suggest that men and women tend to have different preferences for ice cream flavours