Chi squared Flashcards
Contingency tables
each cell is values that fit y and x row column
with totals at the end of each row and column and full total
Expected and observed values
expected is proportion of x x proportion of y
i.e sum of row x sum of column / full total
expected value = e or fe
observed value is actual value in table - o or fo
Chi squared test
Chi squared value for any cell is (fo-fe)^2/ fe
then for the test sum all the values in all cells
degrees of freedom (v)
number of cells in a table which are fully independent, as once a certain amount are filled the rest are automatically decided
formula is m-1 x n-1
Hypothesis testing with chi squared
H0 is there is no association
H1 is there is an association
if test statistic > crit value then reject H0 as high differences between expected and observed
combining groups
Expected frequency for any cell should be above 5, if this is not the case then combine categories to fix
because small fe means that small variations have large outcomes
Goodness for fit tests
Most distributions do a table of fe and fo and normal chi squared
Use given data to work out a value of average rate/chance of event
then use poisson/binomial formulae to fill in expectancy table
calculate degrees of freedom then subtract an extra one for new v
H0 is test does fit
H1 test doesn’t fit