Matching Heszel Test

Embed Size (px)

Citation preview

  • 8/13/2019 Matching Heszel Test

    1/9

    CochranMantelHaenszeltest for repeated tests of

    independence

    When to use itYou use the CochranMantelHaenszel test (which is sometimes

    called the MantelHaenszel test) for repeated tests of independence.There are three nominal variables; ou want to !now whether two ofthe variables are independent of each other" and the third variable

    identifies the repeats. The most common situation is that ou havemultiple #$# tables of independence" so that%s what &%ll tal! abouthere. There are versions of the CochranMantelHaenszel test for annumber of rows and columns in the individual tests of independence"but & won%t cover them.

    ' pon wearin pin! lewarmers.

    or e*ample" let%s sa ou%ve found several hundred pin! !nitpolester lewarmers that have been hidden in a warehouse since thewent out of stle in +,-. You decide to see whether the reduce thepain of an!le osteoarthritis b !eepin the an!les warm. &n the winter"ou recruit /0 volunteers with an!le arthritis" randoml assin #1 towear the lewarmers under their clothes at all times while the other +0don%t wear the lewarmers" then after a month ou as! them whethertheir an!les are pain2free or not. 3ith 4ust the one set of people" ou%dhave two nominal variables (lewarmers vs. control" pain2free vs.pain)" each with two values" so ou%d analze the data with isher%se*act test.

    http://udel.edu/~mcdonald/statvartypes.html#nominalhttp://udel.edu/~mcdonald/statfishers.htmlhttp://udel.edu/~mcdonald/statfishers.htmlhttp://udel.edu/~mcdonald/statfishers.htmlhttp://udel.edu/~mcdonald/statfishers.htmlhttp://udel.edu/~mcdonald/statvartypes.html#nominal
  • 8/13/2019 Matching Heszel Test

    2/9

    However" let%s sa ou repeat the e*periment in the sprin" with 51new volunteers. Then in the summer ou repeat the e*periment aain"with #- new volunteers. You could 4ust add all the data toether anddo isher%s e*act test on the ++ total people" but it would be better to

    !eep each of the three e*periments separate. Mabe the first time oudid the e*periment there was an overall hiher level of an!le pain thanthe second time" because of the different time of ear or the differentset of volunteers. You want to see whether there%s an overall effect oflewarmers on an!le pain" but ou want to control for possibilit ofdifferent levels of an!le pain at the different times of ear.

    Null hypothesisThe null hpothesisis that the two nominal variables that are tested

    within each repetition are independent of each other; havin one valueof one variable does not mean that it%s more li!el that ou%ll have onevalue of the second variable. or our imainar lewarmerse*periment" the null hpothesis would be that the proportion ofpeople feelin pain was the same for lewarmer2wearers and non2lewarmer wearers" after controllin for the time of ear. Thealternative hpothesis is that the proportion of people feelin pain wasdifferent for lewarmer and non2lewarmer wearers.

    Technicall" the null hpothesis of the CochranMantelHaenszel test is that the odds ratioswithin each repetition are e6ual to +. The odds ratio is e6ual to + when the proportions are the same"

    and the odds ratio is different from + when the proportions are different from each other. & thin!

    proportions are easier to rasp than odds ratios" so &%ll put everthin in terms of proportions.

    How it works&f the four numbers in a #$# test of independence are labelled li!e

    this7

    a b

    c d

    and (a8b8c8d)9n" the e6uation for the CochranMantelHaenszeltest statistic can be written li!e this7

    2

    MH

    = {|[a(a+b)(a+c)/n]|0.5}2

    http://udel.edu/~mcdonald/stathyptesting.html#nullhttp://udel.edu/~mcdonald/stathyptesting.html#null
  • 8/13/2019 Matching Heszel Test

    3/9

    (a+b)(a+c)(b+d)(c+d)/(n3n2)

    The numerator contains the absolute value of the differencebetween the observed value in one cell (a) and the e*pected valueunder the null hpothesis" (a8b)(a8c):n" so the numerator is thes6uared sum of deviations between the observed and e*pected values.&t doesn%t matter how ou arrane the #$# tables" an of the fourvalues can be used as a. The 1.5 is subtracted as a continuitcorrection. The denominator contains an estimate of the variance ofthe s6uared differences.

    The test statistic" #MH" ets bier as the differences between theobserved and e*pected values et larer" or as the variance etssmaller (primaril due to the sample size ettin bier). &t is chi2s6uare distributed with one deree of freedom.

  • 8/13/2019 Matching Heszel Test

    4/9

    oal is estimation@ou want to estimate how well lewarmers wor!and come up with a number li!e Apeople with an!le arthritis are 51Bless li!el to feel pain if the wear fluorescent pin! polester !nitlewarmersA@then it would be inappropriate to combine the data

    usin the CochranMantelHaenszel test. &f lewarmers reduce painb 1B in the winter" 51B in the sprin" and /1B in the summer" itwould be misleadin to sa that the reduce pain b 51B; instead" itwould be better to sa that the reduce pain" but the amount of painreduction depends on the time of ear.

    ExamplesMc

  • 8/13/2019 Matching Heszel Test

    5/9

    non2, 5 /1+

    'lsea , / 05

    non2, + ,

    Dmp6ua , + -

    non2, 55 -

    'pplin the formula iven above" the numerator is /55.-" thedenominator is 1." so the result is #MH95.15" + d.f." F91.1#5. Youcan re4ect the null hpothesis that the proportion ofLap,alleles is thesame in the marine and estuarine locations.

    Ganon et al. (#11) studied el! use of wildlife underpasses on ahihwa in 'rizona. Dsin video surveillance cameras" the recorded

    each el! that started to cross under the hihwa. 3hen a car or truc!passed over while the el! was in the underpass" the recorded whetherthe el! continued throuh the underpass (AcrossinA) or turnedaround and left (AretreatA). The overall traffic volume was divided intolow (fewer than vehicles per minute) and hih. There are threenominal variables7 vehicle tpe (truc! or car)" traffic volume (low orhih)" and el! behavior (crossin or retreat). The 6uestion is whethertruc!s or cars are more li!el to scare el! out of underpasses.

    Crossin !etreat

    Eow traffic Car #- 5

    Truc! 1 #

    Hih traffic Car #/ 5#

  • 8/13/2019 Matching Heszel Test

    6/9

    Truc! 5 +#

    The result of the test is #MH9#./," + d.f." F9.,$+12. More el! arescared out of the underpasses b truc!s than b cars.

    "raphin the resultsTo raph the results of a CochranMantelHaenszel test" pic! one

    of the two values of the nominal variable that ou%re observin andplot its proportions on a bar raph" usin bars of two differentpatterns.

    Eap,allele proportions in themusselMytilus trosulusat four bas in

    ?reon. Gra bars are marine samples andempt bars are estuarine samples. rror

    bars are ,5B confidence intervals.

    #imilar tests=ometimes the CochranMantelHaenszel test is 4ust called the

    MantelHaenszel test. This is confusin" as there is also a test for

    homoeneit of odds ratios called the MantelHaenszel test" and aMantelHaenszel test of independence for one #$# table. Mantel andHaenszel (+,5,) came up with a fairl minor modification of the basicidea of Cochran (+,5)" so it seems appropriate (and somewhat lessconfusin) to ive Cochran credit in the name of this test.

    &f ou have at least si* #$# tables" and ou%re onl interested inthe directionof the differences in proportions" not the size of thedifferences" ou could do a sin test.=ee the sin test web paefor ane*ample of an e*periment with a ver similar desin to

    theLapinMytilus trossuluse*periment described above" where

    http://udel.edu/~mcdonald/statsign.htmlhttp://udel.edu/~mcdonald/statsign.html#mpihttp://udel.edu/~mcdonald/statsign.htmlhttp://udel.edu/~mcdonald/statsign.html#mpi
  • 8/13/2019 Matching Heszel Test

    7/9

    because of the different biolo of the oranism" a sin test was moreappropriate.

    The CochranMantelHaenszel test for nominal variables isanaloous to a two2wa anovaorpaired t2testfor a measurement

    variable" or a3ilco*on sined2ran! testfor ran! data. &n the arthritis2lewarmers e*ample" if ou measured an!le pain on a +12point scale(a measurement variable) instead of cateorizin it as pain:no pain"ou%d analze the data with a two2wa anova.

    How to do the test

    #preadsheet&%ve written a spreadsheet to perform the CochranMantel

    Haenszel test.&t handles up to 51 #$# tables (and ou should be ableto modif it to handle more" if necessar).

    We$ paes&%m not aware of an web paes that will perform the Cochran

    MantelHaenszel test.

    #A#Here is a ='= proram that uses FI?C IJ for a Cochran

    MantelHaenszel test. &t uses the mussel data from above. &n theT'>E= statement" the variable that labels the repeats is listed first;in this case it is E?C'T&?K.

    data lap;

    np!t l"cat"n # $abtat # all%l% # c"!nt;

    ca&d';

    lla""* a&n% , 5-

    lla""* %'t!a&n% , -

    lla""* a&n% n"n, ,0

    lla""* %'t!a&n% n"n,

    a1!na a&n% , -

    a1!na %'t!a&n% , 25

    a1!na a&n% n"n, 5

    a1!na %'t!a&n% n"n, 30

    l'%a a&n% , 3

    l'%a %'t!a&n% , -5l'%a a&n% n"n,

    http://udel.edu/~mcdonald/stattwoway.htmlhttp://udel.edu/~mcdonald/statpaired.htmlhttp://udel.edu/~mcdonald/statsignedrank.htmlhttp://udel.edu/~mcdonald/statcmh.xlshttp://udel.edu/~mcdonald/statcmh.xlshttp://udel.edu/~mcdonald/stattwoway.htmlhttp://udel.edu/~mcdonald/statpaired.htmlhttp://udel.edu/~mcdonald/statsignedrank.htmlhttp://udel.edu/~mcdonald/statcmh.xlshttp://udel.edu/~mcdonald/statcmh.xls
  • 8/13/2019 Matching Heszel Test

    8/9

    l'%a %'t!a&n% n"n,

    4p1!a a&n% ,

    4p1!a %'t!a&n% , ,

    4p1!a a&n% n"n, 55

    4p1!a %'t!a&n% n"n, ,;

    p&"c 6&%1 data=lap;

    7%8$t c"!nt / 9%&"';

    tabl%' l"cat"n:$abtat:all%l% / c$;

    &!n;

    There is a lot of output" but the important part loo!s li!e this7

    "c$&an

  • 8/13/2019 Matching Heszel Test

    9/9

    !eferencesFicture of lashprance the pon from Fon Faradise.

    Cochran" 3.G. +,5. =ome methods for strenthenin the common

    #

    tests. >iometrics +17 +25+.Ganon" L.3." T.C. Theimer" K.E.