W3: Tests of Association Flashcards
Another possibility is that response we are interested in is in the form of a count, examples of count variables are (2)
- number of students with graduate jobs
- number of individuals passing a test
One question of interest is if the counts change (Y) based on
one or more binary covariates (X)
We are interested whether there is an association between
a binary factor and their response –> not regression
Suppose we are interested in association of binary factor and response, summarise in table below:
If there is no association between binary factor (e.g., degree = psych, enginerring) and response (yes/no to having a grad job) then expect
proportion of a/g to be similar to the proportion b/h
Formally test the contigency table of whether proportion are similar or not using
Chi-squared tets for independence
The null hypothesis for this test is that
There is no association between the factor and response
Alternative hypothesis is that
There is an association between factor and response
Example of null and alternate hypothesis (2) using this table:
Chi squared
HO: No association between region and access to services
H1: Association between region and access to services
Calculate expected frequencies for each cell of the contigency table assuming no association (H0 is true) using formula:
Whats column and whats row?
Chi squared
How to calculate overall total of a table? - for example in this table?
10 + 5 + 2 +27 + 25 + 8 = 77
How to note down E while doing it for each cell?
ETL
EBL
EBR
ETR
EMR
T = top
B = Bottom
L = Left
R = Right
M = Middle
After hypothesis and expected frequencies, we calculate the test statistic
Formula is:
We do it for each cell in table for observed (O) then expected frequencies we just calculated and add it together
Chi-squared test formula still holds the same when response and/or factorrs have
more than two levels
After calculating x^2 chi-squared statistic, we calculate degrees of freedoom by:
R = no. of rows in contigency actual table
C = no. of columns in contigency actual table.
Calculate DF for this table
Chi squared
r = 3
c = 2
(3 - 1) * (2 - 1) = 2 * 1 = 2
For tables with 2 rows and 2 columns we use the
Chi squared
x2/1 disturbition