The Cochran Mantel Haensel test is aimed at identifying association between variables in K strata. The categorization of subjects into strata helps better to identify association. The CMH test is used to test for independence of a contingency table with two experimental variables and one control variable.
The initial data are represented as a series of K RxC contingency table s, where K is the number of strata and at least one of the variables ("group", "response") takes on more than 2 values. The null hypothesis is that the two nominal variables that are tested within each repetition are independent of each other; having one value of one variable does not mean that it's more likely that you'll have one value of the second variable
M² = [|Σk(n11k- n1+k/ n++k)|-1/2]² / [Σk(n1+kn2+kn+1kn+2k)/( n++k²( n++k²-1))]
The numerator is the difference between observed and expected value and becomes bigger when the difference becomes bigger or variance gets smaller. The null hypothesis is rejected if the proportions remain the same.
McDonald and Siebenaller (1989) surveyed allele frequencies at the Lap locus in the musselMytilus trossulus on the Oregon coast. At four estuaries, samples were taken from inside the estuary and from a marine habitat outside the estuary. There were three common alleles and a couple of rare alleles; based on previous results, the biologically interesting question was whether the Lap94 allele was less common inside estuaries, so all the other alleles were pooled into a "non-94" class.
There are three nominal variables: allele (94 or non-94), habitat (marine or estuarine), and area (Tillamook, Yaquina, Alsea, or Umpqua). The null hypothesis is that at each area, there is no difference in the proportion of Lap94 alleles between the marine and estuarine habitats, after controlling for area.
This table shows the number of 94 and non-94 alleles at each location. There is a smaller proportion of 94 alleles in the estuarine location of each estuary when compared with the marine location; we wanted to know whether this difference is significant.
Applying the formula given above, the numerator is 355.84, the denominator is 70.47, so the result is χ2MH=5.05, 1 d.f., P=0.025. You can reject the null hypothesis that the proportion ofLap94 alleles is the same in the marine and estuarine locations.