Chi Squared tests Flashcards
how do you make the chi squared statsitic?
- take totals of each row and colum together and the total of columns and row (should be the same number)
- assume that the variables are independant
- calculate the expected frequency table, tottals should be the exact same
- make a contributions table (no totals included)
- calculate the chi squared statstic by summing all the contributions
hypotehsis testing for chi squared tests
- null hypothesis: There is no assocoiation between x and y (in context)
- alternate hypothesis: There is an association between x and y ( in context)
- calculate chi squared statistic ( observed–> expected–> contributions–> sum
- look at degrees of freedom and significance level to find the critical value
- compare to chi square statistic, find if signifucant or not, suffenct/ insufficent evidence to reject H0
- conclulsion in context
what are the degrees of freedom?
v (nu) how many variables (numbers) you need to calculate the total
what are the degrees of freedom formula?
(number of row- 1) x (number of columns - 1)
eg for a 3x3 nof= 4
what do the contrinutions suggest?
how much more was actually observed than expected
* the closer the contrinution to 0 the more similar the observed value was to the expected
what is classified as a small expected frequnecy?
being under 5
* makes contributions larger than should be, infulncing th chi squared value
what do you do when there is a small expected frequency?
combine rows or column dependning on context (gotta redo the whole thing)
what is goodness of fit?
using chi sqaure to see if results can be modelled as different distributions ( poisson/ uniform/binomial)
how do you test for uniform distribution?
- the expected frequencies will be the same for each outcome
- for H0: P=1/n (assumption that it is fair)
- H1: P≠ 1/n (assumption that it is not fair)
- for one row v= n-1
how do you test for poisson distribution?
- finding λ (Σx/n)
- use this to find Expected frequencies, using calculator
- find the contribution and chi squares value
- for degrees of freedom, -1 additional for estimated value of λ, (-2)
- H0: x can be modelled by a poisson distribution (in contexet)
- H1: x cannot be modelled by a poisson distribution (in context)
how do you do goodness of fit test for binomial distribution?
- calculate probability using x̄/n
- value of n is the last value of header or column
how do you do chi square left hand tail?
fit too good, so may have been manipulated to not reject H0 or not all values in sample taken randomly