应用统计学_卡方检验.ppt_第1页
应用统计学_卡方检验.ppt_第2页
应用统计学_卡方检验.ppt_第3页
应用统计学_卡方检验.ppt_第4页
应用统计学_卡方检验.ppt_第5页
已阅读5页,还剩28页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

BEO2255AppliedStatisticsforBusiness WeekSix Analyzingcategoricaldata Chi squaredtests Thisweeklecturewillcover Analysingcategoricaldata nominal Chi squaretestofdifferencesbetweenproportionsChi squaretestofindependence SPSS单样本非参数检验 总体分布的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 VariablesthatdescribecategoriesofentitiesDealingwiththemallthetimeinstatisticsMakingcomparisonsamongvariablesForexample whetherconsumerspreferaparticularbrandofaproductamongothercompetingbrands CheckingwhetherthereisarelationshipbetweentwocategoricalvariablesGenderandpreferenceforaproduct whetherthepreferenceforaproductisindependentfromgender Chi squaretestfordifferencesbetweenproportions ThistestinvolveswithnominaldataproducedbymultinomialexperimentItisageneralisationofabinomialexperimentThesetestthenullhypothesisthatdatainthetargetpopulationhasaparticularprobabilitydistribution Example1Wemighttestwhetherconsumersareindifferenttowhichoffourmaterials glass plastic steeloraluminium thatcouldbeusedtomakesoftdrinkcontainers Thenullhypothesisisthattheyareindifferent orthatequalnumberspreferglass plastic steelandaluminium Example1 DataLetpGbetheprobabilitythatanindividualselectedatrandomwillnominateglassashis herpreferenceifrequiredtomakeachoice SimilarlyforpP plastic pS steel andpA aluminium HypothesesHO pG pP pS pA 0 25 HA atleastonepi 0 25 Thealternativeisthatatleastonematerialismorepreferred orlesspreferred thantheothers Example1cont Procedure Selectarandomsampleof say 100consumersanddeterminetheirpreferences UnderthenullhypothesisWeexpect25consumerstonominateglass 25tonominateplastic 25tonominatesteeland25tonominatealuminiumThesearetheexpectedfrequencies Ei Ei n pi Wecomparetheexpectedfrequencieswiththesampleresultsortheobservedfrequencies Oi Iftheyareapproximatelythesamewewouldconcludethatthenullhypothesisistrue Oi Ei HOisprobablytrue Example1cont Chisquare Werequireateststatistictodecidewhetherthedifferenceislargeenoughtorejectthenullhypothesis WeusechisquarewithG 1degreesoffreedomwhereGisthenumberofgroups Supposeinourexample 39preferglass 16preferplastic 20prefersteeland25preferaluminium Recallthattheexpectedfrequencieswereall25 ObtainthecriticalvalueofchisquareCritical 23 7 82 Obtainthecriticalvalueat5 significancelevelat3d f TableE4 page742 Berensonet al 2013 i e thereisonlya5percentchanceorlessthat 23 7 82ifHOistrue Comparisonofchisquarevalues 23 12 08 7 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 Example Wetestthenullhypothesisthatconsumersinthetargetpopulationhavenopreferenceforanyofthreecoloursofpackaging Numbersofconsumersactuallychoosingparticularcolours Numbersofconsumersexpectedtochooseparticularcoloursifthenullistrue Degreesoffreedom groups 1 Chi squarestatistic Ho Consumersinthetargetpopulationhavenopreferenceforanyofthreecoloursofpackaging H1 Consumersinthetargetpopulationhavepreferenceforatleastoneofthreecoloursofpackaging CheckthesigvaluetotestHo Cannotrejectthenull Ho thatallthreecoloursareequallypreferredbecauseSig 0 05 Conclusion At5 significancelevelthereisnosufficientevidencetoconcludethatconsumersinthetargetpopulationhavepreferenceforatleastoneofthreecoloursofpackaging Testsofindependence Chi squaredtestofacontingencytableThistestsatisfiestwodifferentproblemobjectives Aretwonominalvariablesrelated Aretheredifferencesamongtwoormorepopulationofnominalvariables Considerthefollowing3featuresHeightincentimetres Weightinkilograms Colourofeyes Whilstsomepeoplearetallandthin onaveragetallerpeopleweighmorethanshorterpeople Weightandheightarenotindependent Itseemsunlikelythatpeoplewithblueeyesweighmore onaverage thanpeoplewithbrowneyes Weightandeyecolourarealmostcertainlyindependent 交叉分组下的频数分析 目的了解不同变量在不同水平下的数据分布情况例 学习成绩与性别有关联吗 两变量 例 职业 性别 爱逛商店有关联吗 三变量 分析的主要步骤产生交叉列联表分析列联表中变量间的关系 产生交叉列联表 什么是列联表 列变量 行变量 地区 控制变量 频数 产生交叉列联表 基本操作步骤 1 菜单选项 analyze descriptivestatistics crosstabs 2 选择一个变量作为行变量到row框 3 选择一个变量作为列变量到column框 4 可选一个或多个变量作为控制变量到layer框 控制变量的层次设置 同层为水平数加 不同层为水平数积 5 是否显示各分组的棒图 displayclusteredbarcharts 产生交叉列联表 进一步计算cells选项 选择在频数分析表中输出各种百分比 row 行百分比 Rowpct column 列百分比 Colpct total 总百分比 Totpct 分析列联表中变量间的关系 目的 通过列联表分析 检验行列变量之间是否独立 方法 卡方检验 对品质数据的相关性进行度量 分析列联表中变量间的关系 卡方检验年龄与工资收入交叉列联表低中高青40000中05000老00600低中高青00500中06000老40000 分析列联表中变量间的关系 卡方检验基本步骤 1 H0 行列变量之间无关联或相互独立 2 构造卡方统计量统计量服从 r 1 c 1 个自由度的卡方分布count 观察 实际 频数expectedcount 期望频数 期望频数反映的是H0成立情况下的数据分布特征 Residual 剩余 观察频数 期望频数 1 列联表 2 三维柱形图 3 二维条形图 从三维柱形图能清晰看出各个频数的相对大小 从二维条形图能看出 吸烟者中患肺癌的比例高于不患肺癌的比例 通过图形直观判断两个分类变量是否相关 Testsofindependencecont Example2Supposeweinterviewed400people askedthemwhichofthreeagegroupstheyarein under25 25to60 andover60 Wealsoasktheirresponsetothestatementthat Allimportsofautomobilesshouldbebannedinordertoprotectthelocalindustry agree novieweitherway disagree attitudestowardsbanningimportsagreenoviewdisagreeTotalagegroupunder251953259725 60469447187over60305630116Total95203102400 Testsofindependencecont Example2cont Nullhypothesis Thenullhypothesisisthatanswerstothetwoquestionsareindependent Underthenull Prob over60andagree Prob over60 Prob agree MultiplicationruleforindependenteventsExpectedfrequency Prob over60 Prob agree samplesize ProcedureWesetupacross tabulationshowingtheobservedfrequenciesofanswerstothetwoquestions Wecalculatetheexpectedfrequencies TestOurtestisbasedonacomparisonoftheobservedandexpectedfrequencies Short cutforexpectedfrequencies Age attitudetobanningimportsCrosstabulation 19 0 53 0 25 0 97 0 23 0 49 2 24 7 96 9 46 0 94 0 47 0 187 0 44 4 94 9 47 7 187 0 30 0 56 0 30 0 116 0 27 6 58 9 29 6 116 1 95 0 203 0 102 0 400 0 95 0 203 0 102 0 400 0 Count ExpectedCount Count ExpectedCount Count ExpectedCount Count ExpectedCount Under25 25 60 Over60 Age Group Total Agree Noview Disagree Attitudetobanimports Total Calculationforexpectedfrequencyofagreeandover60 95 116 400 Age attitudetobanningimportsCrosstabulation 19 0 53 0 25 0 97 0 23 0 49 2 24 7 96 9 46 0 94 0 47 0 187 0 44 4 94 9 47 7 187 0 30 0 56 0 30 0 116 0 27 6 58 9 29 6 116 1 95 0 203 0 102 0 400 0 95 0 203 0 102 0 400 0 Count ExpectedCount Count ExpectedCount Count ExpectedCount Count ExpectedCount Under25 25 60 Over60 Age Group Total Agree Noview Disagree Attitudetobanimports Total Thecount observed andtheexpectedaredifferent butdifferentenoughtorejectthenull Chi squaredtestforindependence Rationale Oij Eij HOisprobablytrue TeststatisticWerequireateststatistictodecidewhetherthediffere

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论