您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 质量控制/管理 > 应用统计学_卡方检验
WeekSix–Analyzingcategoricaldata:Chi-squaredtestsThisweeklecturewillcover...Analysingcategoricaldata(nominal)Chi-squaretestofdifferencesbetweenproportionsChi-squaretestofindependenceSPSS单样本非参数检验总体分布的chi-square检验(1)目的:根据样本数据推断总体的分布与某个已知分布是否有显著差异---吻合性检验。适用于分类资料的统计推断SPSS单样本非参数检验总体分布的chi-square检验(2)基本假设:H0:总体分布与理论分布无显著差异(3)基本方法–根据已知总体的构成比计算出样本中各类别的期望频数,计算实际观察频数与期望频数的差距,即:计算卡方值–卡方值较小,则实际频数和期望频数相差较小.如果P大于a,不能拒绝H0,认为总体分布与已知分布无显著差异.反之SPSS单样本卡方检验总体分布的chi-square检验(4)基本操作步骤:菜单:analyze-nonparametrictest-chisquare选定待检验变量入testvariablelist框确定待检验个案的取值范围(expectedrange)getfromdata:全部样本usespecifiedrange:用户自定义个案范围指定期望频数(expectedvalues)allcategoriesequal:所有类别有相同的构成比value:用户自定义构成比CategoricalvariableVariablesthatdescribecategoriesofentitiesDealingwiththemallthetimeinstatisticsMakingcomparisonsamongvariablesForexample,whetherconsumerspreferaparticularbrandofaproductamongothercompetingbrands.CheckingwhetherthereisarelationshipbetweentwocategoricalvariablesGenderandpreferenceforaproduct,whetherthepreferenceforaproductisindependentfromgenderChi-squaretestfordifferencesbetweenproportionsThistestinvolveswithnominaldataproducedbymultinomialexperimentItisageneralisationofabinomialexperimentThesetestthenullhypothesisthatdatainthetargetpopulationhasaparticularprobabilitydistribution.Example1Wemighttestwhetherconsumersareindifferenttowhichoffourmaterials(glass,plastic,steeloraluminium)thatcouldbeusedtomakesoftdrinkcontainers.Thenullhypothesisisthattheyareindifferent(orthatequalnumberspreferglass,plastic,steelandaluminium).Example1DataLetpGbetheprobabilitythatanindividualselectedatrandomwillnominateglassashis/herpreferenceifrequiredtomakeachoice.SimilarlyforpP(plastic),pS(steel)andpA(aluminium)HypothesesHO:pG=pP=pS=pA=0.25.HA:atleastonepi0.25.Thealternativeisthatatleastonematerialismorepreferred(orlesspreferred)thantheothers.Example1cont..Procedure:Selectarandomsampleof,say,100consumersanddeterminetheirpreferences.UnderthenullhypothesisWeexpect25consumerstonominateglass,25tonominateplastic,25tonominatesteeland25tonominatealuminiumThesearetheexpectedfrequencies,Ei.Ei=npi.Wecomparetheexpectedfrequencieswiththesampleresultsortheobservedfrequencies,Oi.Iftheyareapproximatelythesamewewouldconcludethatthenullhypothesisistrue.OiEiHOisprobablytrue.Example1cont..,ChisquareE)EO(i221GiiWerequireateststatistictodecidewhetherthedifferenceislargeenoughtorejectthenullhypothesis.WeusechisquarewithG-1degreesoffreedomwhereGisthenumberofgroups.Supposeinourexample,39preferglass,16preferplastic,20prefersteeland25preferaluminium.Recallthattheexpectedfrequencieswereall25.08.1225)2525(25)2520(25)2516(25)2539(23222223ObtainthecriticalvalueofchisquareCritical23=7.82.Obtainthecriticalvalueat5%significancelevelat3d.f.,(TableE4,page742,Berensonet.al.2013)i.e.thereisonlya5percentchanceorlessthat237.82ifHOistrue.Comparisonofchisquarevalues23=12.087.82rejectHO.Conclusion:atthe5%significancelevelthereissufficientevidencetorejectthenullhypothesis.Atleastoneoftheprobabilities(pi)isdifferent.Thesampleresultsindicatethatthematerialsarenotequallypreferredbyconsumersinthetargetpopulation.Thus,atleastpreferencesfortwomaterialsaredifferent.ChisquaretestusingSPSSExample:Supposethatwewanttotestwhetherornotcustomershaveacolourpreferenceforpackaging.Threedifferentcolours,Blue,Green&Purple,areconsidered.Thenullhypothesisisthattheydon’thavecolourpreference.UseAnalyse/Nonparametrictests/Chi-Square.Thedefaultisthattheprobabilitiesareequal.Maindisplaycolour2630.0-4.03730.07.02730.0-3.090BlueGreenPurpleTotalObservedNExpectedNResidualExample:Wetestthenullhypothesisthatconsumersinthetargetpopulationhavenopreferenceforanyofthreecoloursofpackaging.Numbersofconsumersactuallychoosingparticularcolours.Numbersofconsumersexpectedtochooseparticularcoloursifthenullistrue.Maindisplaycolour2630.0-4.03730.07.02730.0-3.090BlueGreenPurpleTotalObservedNExpectedNResidualDifferentbutdifferentenoughtorejectthenull?TestStatistics2.4672.291Chi-SquareadfAsymp.Sig.MainDisplayColour0cells(.0%)haveexpectedfrequencieslessthan5.Theminimumexpectedcellfrequencyis30.0.a.Degreesoffreedom,groups-1Chi-squarestatisticTestStatistics2.4672.291Chi-SquareadfAsymp.Sig.MainDisplayColourCheckthistotestthenull.Ho:ConsumersinthetargetpopulationhavenopreferenceforanyofthreecoloursofpackagingH1:Consumersinthetargetpopulationhavepreferenceforatleastoneofthreecoloursofpackaging.CheckthesigvaluetotestHoCannotrejectthenull(Ho)thatallthreecoloursareequallypreferredbecauseSig0.05.Conclusion:At5%significancelevelthereisnosufficientevidencetoconcludethatconsumersinthetargetpopulationhavepreferenceforatleastoneofthreecoloursofpackaging.TestsofindependenceChi-squaredtestofacontingencytableThistestsatisfiestwodifferentproblemobjectives:Aretwonominalvariablesrelated?Aretheredifferencesamongtwoormorepopulationofnominalvariables?Considerthefollowing3featuresHeightincentimetres,Weightinkilograms&Colourofeyes.Whilstsomepeoplearetallandthin,onaveragetallerpeopleweigh
本文标题:应用统计学_卡方检验
链接地址:https://www.777doc.com/doc-3681710 .html