应用统计学_卡方检验
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
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 & Purple, are considered.
Oi Ei HO is probably true.
Example 1cont.., Chi square
We require a test statistic to decide whether the difference is large enough to reject the null hypothesis.
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 nominate aluminium
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
– 根据已知总体的构成比计算出样本中各类别的期望频 数,计算实际观察频数与期望频数的差距,即:计算卡 方值
– 卡方值较小,则实际频数和期望频数相差较小.如果P大 于a,不能拒绝H0,认为总体分布与已知分布无显著差异. 反之
SPSS单样本卡方检验
总体分布的chi-square检验 (4)基本操作步骤:
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.
df
2
Asymp. Sig.
.291
a. 0 cells (.0%) have expected frequencies less than 5. The minimum expected cell frequency is 30.0.
Chi-square statistic
Ho: Consumers in the target population have no preference for any of three colours of packaging
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 target population. Thus, at least preferences for two materials are different.
The null hypothesis is that they don’t have colour preference.
Use Analyse/Nonparametric tests /Chi-Square.
The default is that the probabilities are equal.
23
(39 25)2 25
பைடு நூலகம்
(16 25)2 25
(20 25)2 25
(25 25)2 25
23 12 .08
Obtain the critical value of chi square
Critical 23 = 7.82. Obtain the critical value at 5% significance level at 3 d.f.,
Numbers of consumers expected to choose particular colours if the null is true.
Blue Green Purple Total
Main display colour
Observed N 26 37 27 90
Expected N 30.0 30.0 30.0
Residual -4.0 7.0 -3.0
Different but different enough to reject the null?
Test Statistics
Chi-Square a
Main Display Colour
2.467
Degrees of freedom, groups - 1
population has a particular probability distribution.
Example 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.
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
Blue Green Purple Total
Observed N 26 37 27 90
Expected N 30.0 30.0 30.0
Residual -4.0 7.0 -3.0
Numbers of consumers actually choosing particular colours.
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 one material is more preferred (or less preferred) than the others.
H1: Consumers in the target population have preference for at least one of three colours of packaging.
Test Statistics
Chi-Square a df Asymp. Sig.
Main Display Colour
(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.
Comparison of chi square values
SPSS单样本非参数检验
总体分布的chi-square检验
(1)目的: 根据样本数据推断总体的分布与某个已知分布是否有显著差异--吻合性检验。
适用于分类资料的统计推断
SPSS单样本非参数检验
总体分布的chi-square检验 (2)基本假设: H0:总体分布与理论分布无显著差异 (3)基本方法
We use chi square with G - 1 degrees of freedom where G is the number of groups.
2G
1
(Oi
Ei)2 Ei
Suppose in our example, 39 prefer glass, 16 prefer plastic, 20 prefer steel and 25 prefer aluminium. Recall that the expected frequencies were all 25.
Example: We test the null hypothesis that consumers in the target population have no preference for any of three colours of packaging.
Main display colour
菜单:analyze->nonparametric test->chi square 选定待检验变量入test variable list 框 确定待检验个案的取值范围(expected range)
get from data:全部样本 use specified range:用户自定义个案范围 指定期望频数(expected values) all categories equal:所有类别有相同的构成比 value:用户自定义构成比
The null hypothesis is that they are indifferent (or that equal numbers prefer glass, plastic, steel and aluminium).
Example 1
Data
Let pG be the probability that an individual selected at random will nominate glass as his/her preference if required to make a choice.
This week lecture will cover...
Analysing categorical data (nominal)
Chi-square test of differences between proportions Chi-square test of independence
Gender and preference for a product, whether the preference for a product is independent from gender
Chi-square test for differences between proportions
Categorical variable
Variables that describe categories of entities Dealing with them all the time in statistics Making comparisons among variables