Calculate odds ratio and fisher's exact text

In summary: The numerator represents the number of elements in the left column that are common to both the M1 and M2 lists.
  • #1
hoffmann
70
0
basic statistics question:

i have two variables, M1 and M2. i want to calculate how similar these two variables are using the odds ratio. M1 and M2 are lists of things, with some elements present in both lists. i also have a background list containing the things in M1 and M2, plus more. is this how i calculate the odds ratio? (in a 2x2 table from left to right and top to bottom):

1) a = # of common elements in M1 and background / # elements in background
2) b = 1 - a
3) c = # of common elements in M2 and background / # elements in background
4) d = 1 - c

odds ratio = a*d / b*c, where a is the upper left element of the 2x2 matrix and d is the bottom right.

does this look correct? how would i go about creating a 2x2 table for the fisher exact test? just use the number of common elements without doing the division by the background in the cells?
 
Physics news on Phys.org
  • #2
hoffmann said:
odds ratio = a*d / b*c, where a is the upper left element of the 2x2 matrix and d is the bottom right.

does this look correct? how would i go about creating a 2x2 table for the fisher exact test? just use the number of common elements without doing the division by the background in the cells?

That's the correct calculation the odds ratio (OR) for a 2x2 table. The 2x2 table (constrained by the marginal totals) has a hypergeometric distribution. The exact calculation is only necessary if the data are sparse (a zero in any cell for certain).

[tex] P=\frac{(a+b)!(c+d)!(a+d)!(b+d)!}{a!b!c!d!n!}[/tex]

This is the probability of the data under the null hypothesis. There are calculators for this on line, but you'll have to find them yourself.

EDIT: For the variance of the odds ratio, use the delta method (Woolf) Var ln(OR)=(1/a+1/b+1/c+1/d).

http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1270683/
 
Last edited:
  • #3
SW VandeCarr said:
[tex] P=\frac{(a+b)!(c+d)!(a+c)!(b+d)!}{a!b!c!d!n!}[/tex]

I guess no one is paying attention. There was a mistake in the previous post. This is the corrected version of Fisher's exact test. Can anyone point out the mistake based on first principles and not just comparing the two? (In other words, what does the numerator represent?)
 
Last edited:

What is an odds ratio?

An odds ratio is a measure of the strength of association between two variables. It compares the odds of an event occurring in one group to the odds of the same event occurring in another group. It is commonly used in statistical analysis to evaluate the relationship between a binary outcome and a categorical predictor variable.

How do you calculate odds ratio?

Odds ratio can be calculated by dividing the odds of an event occurring in the first group by the odds of the same event occurring in the second group. This can be done manually using a formula or with the help of statistical software such as SPSS or R.

What is Fisher's exact test?

Fisher's exact test is a statistical test used to determine the significance of the association between two categorical variables. It is commonly used when the sample size is small or when the assumptions for a chi-square test are not met. It calculates the exact probability of obtaining the observed data, assuming a specific null hypothesis.

When should Fisher's exact test be used?

Fisher's exact test should be used when the sample size is small (less than 20) or when the expected values in a contingency table are less than 5. It can also be used when the assumptions for a chi-square test are not met, such as when the data is highly skewed or when there are small expected frequencies.

How do you interpret the results of Fisher's exact test?

The results of Fisher's exact test provide a p-value, which indicates the probability of obtaining the observed data if the null hypothesis is true. A p-value of less than 0.05 is typically considered statistically significant, meaning that there is a low probability that the association between the variables is due to chance. If the p-value is greater than 0.05, the null hypothesis cannot be rejected and it can be concluded that there is not a significant association between the variables.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
756
  • Introductory Physics Homework Help
Replies
4
Views
863
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
2K
Replies
5
Views
354
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
898
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
684
Back
Top