Packet'6:'Chi-Square'Test'for'Independence' Aftercompletingthismaterial,youshouldbeableto: calculatetheexpectedcountforanycellofacontingencytable. Textbookpages:18 24;624 631 findmarginaldistributionsforacontingencytableandusethosetoconstructasidedbydsidebargraph. computechidsquarecontributionsforanycellofacontingencytable. conductthechisdsquaretest(withtheaidofstatcrunchoutput)todetermineiftwocategoricalvariablesare related. The legalization of medicinal marijuana has been a hotly contested subject. A survey conducted in April 2015 was undertaken to investigate whether a relationship exists between feelings on the legalization of medicinal marijuana (for/against)andpoliticalparty(republican/democrat/independent). During this study, a total of 500 individuals were surveyed. For each American adult, what variables were recorded?arethesevariablescategoricalorquantitative? Becausetwovariableswererecordedforeachindividual,weneedawaytoorganizethisdata.Acontingency'table categorizes counts on two (or more) categorical variables in other words, this table summarizes the number of individualsinallpossiblecombinationsofcategories.wecansummarizetheresponsestothesurveyinthetablebelow: Legalization'of'Marijuana' Supports' Does'not'support' Political'Party' Democrat' Republican' Independent' Instead of looking at the counts, let s split the table into marginal( distributions that is, what percentage of each politicalpartysurveyedgaveeachofthetworesponses? '
page2 Inordertodetermineifthedifferencesaresignificant,weneedtoconductahypothesistest.One'can'never'simply' examine' sample' data' and' draw' some' conclusion' about' the' population' ' we' need' to' conduct' a' hypothesis' test' in' order'to'determine'if'the'results'are'significant. Whatisthegoalofthechi-square'test'for'independence? Ifwewantedtoconductthistestonthelegalizationofmarijuanadata,whathypotheses'wouldbetested? Inordertoconductahypothesistest,weneedsomequantitytocomparetheobservedcountsfromthesurveyto.This isreferredtoastheexpected'count(inotherwords,whatshouldwehaveobservedifthenullhypothesisweretrue). Fillinthetablebelowwiththeexpectedcounts. Political'Party' Observed'' Counts' Legalization'of'Marijuana' Supports' Does'not'support' Democrat' 116 84 Republican' 74 126 Independent' 59 41 Expected' Counts' Legalization'of'Marijuana' Supports' Does'not'support' Democrat' Political'Party' Republican' Independent' Whatdoyounoticewhentheobserved(toptable)andexpectedcounts(bottomtable)arecompared? ' STA205Notes Buckley Fall2016
page3 Thetest'statisticforthechiDsquaretestforindependencecomparestheobservedandexpectedcounts.Itsformulais thefollowing: Let slookathowthisteststatisticiscalculatedbygoingbacktothemarijuanaexample: What'is'the'Chi-Square'distribution?' HowisthechiDsquaredistributionusedtofindaprobability? In statistical inference, there are several common distributions used for inference. In addition to the normal distribution (which we have already used), the chidsquare distribution is also a common distribution used for inference. Thisformulawillbegivenon theformulasheet. Formula'Alert' Chi-Square Distn, df=3 0 2 4 6 8 10 12 14 Ingeneral,wewon tcalculatethechidsquareteststatistic(thecalculationcanbetedious)orthepdvalueassociatedwith thetest.instead,wewillrelyonstatcrunchoutputforourcalculations.let slookatthestatcrunchoutputforthe legalizationofmarijuanaexample: STA205Notes Buckley Fall2016
page4 Completetheappropriatehypothesistestusingasignificancelevelof0.05todetermineifpoliticalpartyandsupportof legalizationofmarijuanaarerelated. Example:All new drugs must go through a drug study before being approved by the FDA. A drug study typically includesclinicaltrialswherebyparticipantsarerandomizedtoreceivedifferentdosagesaswellasaplacebo.tocontrol asmanyfactorsaspossible,itisbesttoassignparticipantsrandomlyacrossthetreatments.arecentstudyforanew drugconsistedoftwodosages(10mg,20mg)andaplacebo.thosewhodesignedthestudywouldliketoknowifthe dosageassignedwasrelatedtotheparticipants gender.theresponsesaresummarizedinthestatcrunchoutputbelow: Findthemarginaldistributionforeachgenderbyfillinginthetablesbelow. Computetheexpectednumberoffemalesreceivingtheplacebo.Whatdoes thisquantitymean? Dosage' 10mg' 20mg' Placebo' Female' ' ' ' Dosage' 10mg' 20mg' Placebo' Male' ' ' ' Basedonthesedistributions,doyoubelievegender issomehowrelatedtodosage?explain. STA205Notes Buckley Fall2016
page5 Computethechi-square'contributionformaleparticipantswhoweregiven10mgofthedrug. UsingtheStatCrunchoutputbelow,conducttheappropriatetesttodetermineifthereisarelationshipbetweengender andthedosagereceived.useasignificancelevelof0.01. WhatassumptionsmustbesatisfiedforthechiDsquaretestofindependencetobevalid? STA205Notes Buckley Fall2016
page6 Example:' A sample of 1000 traffic crashes occurring in either Kentucky or OhiowasselectedfromtheNationalHighwaySafetyTrafficAdministration database.foreachcrash,itwasnotedwhetherornotalcoholwasinvolved in the accident. A reporter has questioned whether there is a relationship betweenalcoholinvolvementandthestateinwhichtheaccidentoccurred. TheinformationgatheredissummarizedintheStatCrunchoutputprovided. Computethenumberofaccidentsonewouldexpecttoinvolvealcoholin KYifthereisnorelationship. Fill in the tables below with the marginal distributions for each state. Then create a sidedbydside bar graph comparingthepercentagesforthetwostates. ' Alcohol yes Alcohol no KY ' ' ' Alcohol yes Alcohol no OH ' ' ' Conducttheappropriatetesttoaddresstheconjecturemadebythereporter.Useasignificancelevelof0.05. STA205Notes Buckley Fall2016