I just have a question about logistic regression and the 2 by 2 or 3 by 2 or n by 2 contingency table: the table can be found here:
http://en.wikipedia.org/wiki/Contingency_table
My question is when I have a table like this:
Right-handed Left-handed Total
Male 43 9 52
Female 44 4 48
Total 87 13 100
if I want to know if gender is associated with a person being right-handed or left-handed, I can calculate the odd ratio as an indication of whether being male is more likely to be left-handed:
(9/52) / (4/48) = 2.07
Then, I can also test using the Pearson Chi-square test to see if there is significant association? like p-value <0.05 right?
But I can also create an indicator variable with 100 people in the data set, 52 being male, 48 being females, and let 1= left-handed , 0= right-handed. Then get the odd-ratio from the output of the logistic regression.
So my question is, I am not sure which is the right way to find out which group is more likely to be left-handed?
Also is it possible to get some opinions about what is the differences between the two approaches? are they answering the same question?
1) Basically, I just want to know what is the difference between the two approaches here in answering questions? (what kind of question does each approaches designed to answer?).
2) What is the difference between the p-value given by say in this case the 2-by-2 contingency table and the p-value given by the significant test of the parameter estimate of gender(M,F) in the logistic regression?
Could someone kindly explain?
Best Answer
The odds ratio in that table is:
(9/43)/(4/44) = 2.30
What John_w computed was a risk ratio.
Now you can see that the manually computed odds ratio is exactly the same as the one produced by logistic regression. Both tests you suggested test the null-hypothesis that this odds ratio is equal to 1. The p-values should be close enough to not matter. For example doing this in Stata gives the following output:
For fun I also asked for the likelihood ratio chi square statistic after
tab
, to show that test is exactly the same as the one reported by logistic regression (labeledLR chi2(1)
andProb > chi2
in the output oflogit
).