应用统计学_卡方检验

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

WeekSix–Analyzingcategoricaldata:Chi-squaredtestsThisweeklecturewillcover...Analysingcategoricaldata(nominal)Chi-squaretestofdifferencesbetweenproportionsChi-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:用户自定义构成比CategoricalvariableVariablesthatdescribecategoriesofentitiesDealingwiththemallthetimeinstatisticsMakingcomparisonsamongvariablesForexample,whetherconsumerspreferaparticularbrandofaproductamongothercompetingbrands.CheckingwhetherthereisarelationshipbetweentwocategoricalvariablesGenderandpreferenceforaproduct,whetherthepreferenceforaproductisindependentfromgenderChi-squaretestfordifferencesbetweenproportionsThistestinvolveswithnominaldataproducedbymultinomialexperimentItisageneralisationofabinomialexperimentThesetestthenullhypothesisthatdatainthetargetpopulationhasaparticularprobabilitydistribution.Example1Wemighttestwhetherconsumersareindifferenttowhichoffourmaterials(glass,plastic,steeloraluminium)thatcouldbeusedtomakesoftdrinkcontainers.Thenullhypothesisisthattheyareindifferent(orthatequalnumberspreferglass,plastic,steelandaluminium).Example1DataLetpGbetheprobabilitythatanindividualselectedatrandomwillnominateglassashis/herpreferenceifrequiredtomakeachoice.SimilarlyforpP(plastic),pS(steel)andpA(aluminium)HypothesesHO:pG=pP=pS=pA=0.25.HA:atleastonepi0.25.Thealternativeisthatatleastonematerialismorepreferred(orlesspreferred)thantheothers.Example1cont..Procedure:Selectarandomsampleof,say,100consumersanddeterminetheirpreferences.UnderthenullhypothesisWeexpect25consumerstonominateglass,25tonominateplastic,25tonominatesteeland25tonominatealuminiumThesearetheexpectedfrequencies,Ei.Ei=npi.Wecomparetheexpectedfrequencieswiththesampleresultsortheobservedfrequencies,Oi.Iftheyareapproximatelythesamewewouldconcludethatthenullhypothesisistrue.OiEiHOisprobablytrue.Example1cont..,ChisquareE)EO(i221GiiWerequireateststatistictodecidewhetherthedifferenceislargeenoughtorejectthenullhypothesis.WeusechisquarewithG-1degreesoffreedomwhereGisthenumberofgroups.Supposeinourexample,39preferglass,16preferplastic,20prefersteeland25preferaluminium.Recallthattheexpectedfrequencieswereall25.08.1225)2525(25)2520(25)2516(25)2539(23222223ObtainthecriticalvalueofchisquareCritical23=7.82.Obtainthecriticalvalueat5%significancelevelat3d.f.,(TableE4,page742,Berensonet.al.2013)i.e.thereisonlya5percentchanceorlessthat237.82ifHOistrue.Comparisonofchisquarevalues23=12.087.82rejectHO.Conclusion:atthe5%significancelevelthereissufficientevidencetorejectthenullhypothesis.Atleastoneoftheprobabilities(pi)isdifferent.Thesampleresultsindicatethatthematerialsarenotequallypreferredbyconsumersinthetargetpopulation.Thus,atleastpreferencesfortwomaterialsaredifferent.ChisquaretestusingSPSSExample: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.TestsofindependenceChi-squaredtestofacontingencytableThistestsatisfiestwodifferentproblemobjectives:Aretwonominalvariablesrelated?Aretheredifferencesamongtwoormorepopulationofnominalvariables?Considerthefollowing3featuresHeightincentimetres,Weightinkilograms&Colourofeyes.Whilstsomepeoplearetallandthin,onaveragetallerpeopleweigh

1 / 33
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功