第10章 方差分析(ANOVA)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
over all groups.
j
Within-Group Variation
MSW SSW nc
For c = 2, this is the pooled-variance in the t-Test.
( n1 1 )S12 ( n2 1 )S22 • • • ( nc 1 )Sc2 ( n1 1 ) ( n2 1 ) • • • ( nc 1 )
The Null Hypothesis is
NOT True
One-Factor ANOVA Partitions of Total Variation
Total Variation SST
= Variation Due to Treatment SSA
+
Variation Due to Random Sampling SSW
SSW
c nj
( X ij
X j )2
j 1i 1
MSW SSW nc
X ij the ith observation in group j
X j the sample mean of group j
Summing the variation within
each group and then adding
Commonly referred to as: Sum of Squares Among, or Sum of Squares Between, or Sum of Squares Model, or Among Groups Variation
Commonly referred to as: Sum of Squares Within, or Sum of Squares Error, or Within Groups Variation
similarly trained &
24.10 23.50
experienced workers, 5 per 23.74 22.75
machine, to the machines. At 25.10 21.60
the .05 level, is there a
difference in mean filling
One-Factor ANOVA Example Solution
H0: 1 = 2 = 3 H1: Not All Equal
= .05
df1= 2 df2 = 12 Critical Value(s):
Test Statistic:
F
MSA
23.5820
25.6
MSW .9211
Decision: Reject at = 0.05
请注意其含义
H1: not all the k are equal
The Null Hypothesis is True
One Factor ANOVA: Treatment Effect Present
H0: 1 = 2 = 3 = ... = c H1: not all the k are equal
= 47.164
SSW = 4.2592+3.112 +3.682 = 11.0532
MSA = SSA/(c-1) = 47.16/2 = 23.5820
MSW = SSW/(n-c) = 11.0532/12 = .9211
Summary Table
Source of Degrees of Sum of Mean
times?
20.00 22.20 19.75 20.60 20.40
One-Factor ANOVA Example: Scatter Diagram
Machine1 Machine2 Machine3
25.40 23.40 20.00 26.31 21.80 22.20 24.10 23.50 19.75 23.74 22.75 20.60 25.10 21.60 20.40
Total
592.400 14
结论:P=0.001<0.05,可以认为不同包装下的饮 料平均销售量整体上表现出统计学意义上的
差。注意,要想知道是哪两种包装之间有差 异,尚须做两量两比较。
One-Factor ANOVA: No Treatment Effect
H0: 1 = 2 = 3 = ... = c
One-Factor ANOVA F Test Example
As production manager, you Machine1 Machine2
want to see if 3 filling
Machine3
machines have different mean 25.40 23.40
filling times. You assign 15 26.31 21.80
One-Factor Analysis of Variance 单因子方差分析
• Evaluate the Difference Among the Means of 2 or More (c) Populations
e.g., Several Types of Tires, Oven Temperature Settings
H0: 1 = 2 = 3 = ... = c
•All population means are equal •No treatment effect (NO variation in means
among groups)
H1: not all the k are equal
•At least ONE population mean is different (Others may be the same!)
Total Variation 总变异
SST
c
nj
( X ij
X
)2
j 1i 1
Xij = the ith observation in group j nj = the number of observations in group j n = the total number of observations in all groups
c = the number of groups
_
Xj the sample mean of group j
__
X the overall or grand mean
j Variation Due to Differences Among Groups.
Within-Group Variation 组内变异
•If more than 2 groups, use F Test.
•For 2 groups, use t-Test. F Test more limited.
j
One-Way ANOVA Summary Table 单因子方差分析表
Source of Degrees
Variation
of
Freedom
• Assumptions:
Samples are Randomly and Independently Drawn (This condition must be met.)
Populations are Normally Distributed (F test is Robust to moderate departures from normality.)
Populations have Equal Variances
多个独立样本均值的比较--单因素方差分析
1、资料类型
样本1 样本2 …… 样本k
x11
x21
x12 ... x1k
x22
...
x2k
... ... ... ...
x
n11
xn2 2
...
xnk
k
注意,k 个样本含量不必相等!!!
68
55
71
63
58
问题:三种包装的日平均销售量是否有显著差异?
方差分析结果 H 0 : 1 2 3
ANOVA for SALE
SS df Mean Square F
Sig.
Between 420.367 2
210.183
14.661 .001
Within 172.033 12 14.336
•There is treatment effect Does NOT mean that all the means are different: 1 2 ... c
3、[实例分析] 三组销售不同包装饮料的商品的日均销售量
瓶装组 罐装组 袋装(老包装)
75
74
60
70
78
64
66
72
65
69
第10章 方差分析(ANOVA) Analysis of Variance
本章概要
• The Completely Randomized Model: One-Factor Analysis of Variance
F-Test for Difference in c Means The Tukey-Kramer Procedure ANOVA Assumptions
Variation Freedom Squares Square
(Variance)
Among
3-1=2
47.1640
23.5820
MSA
F=
(Machines)
MSW
Within (Error)
15 - 3 = 12 11.0532 .9211
= 25.60
Total
15 - 1 = 14 58.2172
k j
1
n
j
(
X
j
X total ) 2
k j 1
( x n j
i1 ij
X
j )2
SSbetween SSint ernal MSb SSbetween /(k 1), MSi SSint ernal /(n k ) F MSb / MSi ~ F (k 1, n k )
One-Factor ANOVA Test Hypothesis
2、总变异的分解……方差分析的关键!!!
k nj
X total [
xij ] / n, n n1 n2 ... nk ;
j 1 i1
X j [
x n j
i1 ij
]/
ቤተ መጻሕፍቲ ባይዱnj,
j
1,2,...,k;
k nj
SStotal [
( xij X total ) 2 ]
j 1 i1
20.00 22.20 19.75 20.60
_
X_ 1 = 24.93
X_ 2 = 22.61 X__ 3 = 20.59 X = 22.71
nj =5 c=3 n = 15
25.10 21.60 20.40
SSA = 5 [(24.93 - 22.71) 2+ (22.61 - 22.71)2 + (20.59 - 22.71) 2]
X = 24.93 X = 22.61 X = 20.59
__
X = 22.71
27
26
_
25 _ X
24
__
23
__
x
22
X
21
_
_ x
20
19
One-Factor ANOVA
Example Computations
Machine1 Machine2 Machine3
25.40 23.40 26.31 21.80 24.10 23.50 23.74 22.75
= 0.05 Conclusion:
There is evidence that at least
0
3.89 F one i differs from the rest.
c = the number of groups
c nj
X ij
X j 1i 1 n
the overall or grand mean
Among-Group Variation 组间变异
SSA
c
nj( X j
X )2
j 1
MSA SSA c 1
nj = the number of observations in group j
• The Factorial Design Model: Two-Way Analysis of Variance
Examine Effect of Factors and Interaction
• Kruksal-Wallis Rank Test for Differences in c Medians
Among (Factor)
c-1
Sum of Squares
SSA
Mean
F Test
Square Statistic
(Variance) MSA =
= MSA MSW
SSA/(c - 1)
Within (Error)
n -c
SSW
MSW =
SSW/(n - c)
Total
n - 1 SST = SSA+SSW