版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、a,1,BEO2255 Applied Statistics for Business,Week Six Analyzing categorical data: Chi-squared tests,a,2,This week lecture will cover.,Analysing categorical data (nominal) Chi-square test of differences between proportions Chi-square test of independence,a,3,SPSS单样本非参数检验,总体分布的chi-square检验 (1)目的: 根据样本数
2、据推断总体的分布与某个已知分布是否有显著差异-吻合性检验。 适用于分类资料的统计推断,a,4,SPSS单样本非参数检验,总体分布的chi-square检验 (2)基本假设: H0:总体分布与理论分布无显著差异 (3)基本方法 根据已知总体的构成比计算出样本中各类别的期望频数,计算实际观察频数与期望频数的差距,即:计算卡方值 卡方值较小,则实际频数和期望频数相差较小.如果P大于a,不能拒绝H0,认为总体分布与已知分布无显著差异.反之,a,5,SPSS单样本卡方检验,总体分布的chi-square检验 (4)基本操作步骤: 菜单:analyze-nonparametric test-chi squ
3、are 选定待检验变量入test variable list 框 确定待检验个案的取值范围(expected range) get from data:全部样本 use specified range:用户自定义个案范围 指定期望频数(expected values) all categories equal:所有类别有相同的构成比 value:用户自定义构成比,a,6,Categorical variable,Variables that describe categories of entities Dealing with them all the time in statistics
4、Making comparisons among variables For example, whether consumers prefer a particular brand of a product among other competing brands. Checking whether there is a relationship between two categorical variables Gender and preference for a product, whether the preference for a product is independent f
5、rom gender,a,7,Chi-square test for differences between proportions,This test involves with nominal data produced by multinomial experiment It is a generalisation of a binomial experiment These test the null hypothesis that data in the target population has a particular probability distribution. Exam
6、ple 1 We might test whether consumers are indifferent to which of four materials (glass, plastic, steel or aluminium) that could be used to make soft drink containers. The null hypothesis is that they are indifferent (or that equal numbers prefer glass, plastic, steel and aluminium).,a,8,Example 1,D
7、ata Let pG be the probability that an individual selected at random will nominate glass as his/her preference if required to make a choice. Similarly for pP (plastic), pS (steel) and pA (aluminium) Hypotheses HO: pG = pP = pS = pA = 0.25. HA: at least one pi 0.25. The alternative is that at least on
8、e material is more preferred (or less preferred) than the others.,a,9,Example 1cont.,Procedure: Select a random sample of, say, 100 consumers and determine their preferences. Under the null hypothesis We expect 25 consumers to nominate glass, 25 to nominate plastic, 25 to nominate steel and 25 to no
9、minate aluminium These are the expected frequencies, Ei. Ei = n pi. We compare the expected frequencies with the sample results or the observed frequencies, Oi. If they are approximately the same we would conclude that the null hypothesis is true. Oi Ei HO is probably true.,a,10,Example 1cont., Chi
10、square,We require a test statistic to decide whether the difference is large enough to reject the null hypothesis. We use chi square with G - 1 degrees of freedom where G is the number of groups.,Suppose in our example, 39 prefer glass, 16 prefer plastic, 20 prefer steel and 25 prefer aluminium. Rec
11、all that the expected frequencies were all 25.,a,11,Obtain the critical value of chi square Critical 23 = 7.82. Obtain the critical value at 5% significance level at 3 d.f., (Table E4, page 742, Berenson et.al. 2013) i.e. there is only a 5 percent chance or less that 23 7.82 if HO is true. Compariso
12、n of chi square values 23 = 12.08 7.82 reject HO. Conclusion: at the 5% significance level there is sufficient evidence to reject the null hypothesis. At least one of the probabilities (pi) is different. The sample results indicate that the materials are not equally preferred by consumers in the tar
13、get population. Thus, at least preferences for two materials are different.,a,12,Chi square test using SPSS,Example : Suppose that we want to test whether or not customers have a colour preference for packaging. Three different colours, Blue, Green 不同层为水平数积. (5)是否显示各分组的棒图(display clustered bar chart
14、s ),a,21,产生交叉列联表,进一步计算 cells选项:选择在频数分析表中输出各种百分比. row:行百分比(Row pct); column:列百分比(Col pct); total:总百分比(Tot pct);,a,22,分析列联表中变量间的关系,目的: 通过列联表分析,检验行列变量之间是否独立。 方法: 卡方检验:对品质数据的相关性进行度量,a,23,分析列联表中变量间的关系,卡方检验 年龄与工资收入交叉列联表 低 中 高 青 400 0 0 中 0 500 0 老 0 0 600 低 中 高 青 0 0 500 中 0 600 0 老 400 0 0,a,24,分析列联表中变量间
15、的关系,卡方检验基本步骤 (1)H0:行列变量之间无关联或相互独立 (2)构造卡方统计量 统计量服从(r-1)*(c-1)个自由度的卡方分布 count:观察(实际)频数 expected count:期望频数 (期望频数反映的是H0成立情况下的数据分布特征) Residual:剩余 (观察频数-期望频数),a,25,1、列联表,2、三维柱形图,3、二维条形图,从三维柱形图能清晰看出 各个频数的相对大小。,从二维条形图能看出,吸烟者中 患肺癌的比例高于不患肺癌的比例。,通过图形直观判断两个分类变量是否相关:,a,26,Tests of independence cont,Example 2 S
16、uppose we interviewed 400 people & asked them which of three age groups they are in (under 25, 25 to 60, and over 60). We also ask their response to the statement that “All imports of automobiles should be banned in order to protect the local industry” (agree, no view either way, disagree).,attitude
17、s towards banning imports agree no view disagree Total age group under 25 19 53 25 97 25 - 60 46 94 47 187 over 60 30 56 30 116 Total 95 203 102 400,a,27,Tests of independence cont,Example 2 cont. Null hypothesis: The null hypothesis is that answers to the two questions are independent. Under the nu
18、ll: Probover 60 and agree = Probover 60 Probagree Multiplication rule for independent events Expected frequency= Probover 60 Probagree sample size.,a,28,Procedure We set up a cross-tabulation showing the observed frequencies of answers to the two questions. We calculate the expected frequencies. Tes
19、t Our test is based on a comparison of the observed and expected frequencies. Short-cut for expected frequencies,a,29,Age *attitude to banning imports Cross tabulation,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
20、.0,102.0,400.0,95.0,203.0,102.0,400.0,Count,Expected Count,Count,Expected Count,Count,Expected Count,Count,Expected Count,Under 25,25-60,Over 60,Age,Group,Total,Agree,No view,Disagree,Attitude to ban imports,Total,Calculation for expected frequency of agree and over 60, 95 116 / 400,a,30,Age *attitu
21、de to banning imports Cross tabulation,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,Expected Count,Count,Expected Count,Count,Expected Count,Count,Expected Count,Under 2
22、5,25-60,Over 60,Age,Group,Total,Agree,No view,Disagree,Attitude to ban imports,Total,The count (observed) and the expected are different, but different enough to reject the null?,a,31,Chi-squared test for independence,Rationale: Oij Eij HO is probably true. Test statistic We require a test statistic to decide whether the difference is large enough to reject the null hypothesis.,a,32,Chi-Square Tests,1.438,a,4,.837,1.517,4,.805,1.307,1,.758,400,Pearson Chi-Square,Likelihood Ratio,Linear-by-Linear,Association,N of Valid C
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 教育行业教师专业发展人工智能辅助方案
- 酒店管理服务质量与收益情况绩效衡量表
- 旅游服务主管绩效考评表
- 招聘1人!青海省药学会招聘考试备考试题及答案解析
- 旅游产品策划经理市场竞争力绩效评定表
- 2026重庆沙坪坝区社区选拔专职工作者后备人选(200人)考试备考题库及答案解析
- 电子科技大学航空航天学院二级单位聘用人员招聘(1人)笔试模拟试题及答案解析
- 2026年淮南师范学院应用技术学院招聘教师考试备考试题及答案解析
- 2026年中石油燃料油有限责任公司人员招聘考试备考试题及答案
- 广告策划师广告效果评估考核表
- 青春健康师资考试历年真题
- 2026年4月自考00023高等数学(工本)试题
- 小区消防维修改造工程施工方案投标文件(技术标)
- 超星尔雅学习通《军事理论(上海财经大学)》2026章节测试及答案
- 公司正式运营管理制度
- (2025版)中国成人患者围手术期液体治疗临床实践指南课件
- 2025至2030中国姜黄种植行业调研及市场前景预测评估报告
- 粮仓防水施工方案
- 2025年派出所民警个人年度工作小结(全文)
- 死囚漫步五步陷阱课件
- 2025年国家基本公共卫生服务项目培训试题(附答案)
评论
0/150
提交评论