變異數分析• 檢定 • 類型
– One Way ANOVA– Two way ANOVA– Three way ANOVA– ..five..
3210 : uuuH
公式
1
2
2
NS
xx
變異數的不偏估計數
2
2
:
:
:
xxSSupBetweenGro
ixxSSpWithinGrou
SSSSSStionTotalVaria
ib
ijw
bwt
公式
w
b
wb
w
ww
b
bb
MSMSvalueF
dfdfN
dfssMS
dfssMS
1
假定的評估• 常態性檢定• 變異數同質性 Homogeneity of variance
• 當變異數非同質時 , 資料轉換
Tests of Normality
.227 12 .087 .810 12 .012
.224 12 .097 .868 12 .069
組別AB
成績Statistic df Sig. Statistic df Sig.
Kolmogorov-Smirnova Shapiro-Wilk
Lilliefors Significance Correctiona.
Test of Homogeneity of Variance
.024 1 22 .877
.027 1 22 .870
.027 1 21.720 .870
.015 1 22 .903
Based on MeanBased on MedianBased on Median andwith adjusted dfBased on trimmed mean
成績Levene Statistic df1 df2 Sig.
Spread vs. Level Plot of By 成績 群組
* Plot of LN of Spread vs LN of Level
Slope = .605 Power for transformation = .395
Level
4.44.24.03.83.63.43.2
Spread
3.8
3.6
3.4
3.2
3.0
2.8
2.6
2.4
One Way ANOVA
• 各組人數相等 / 不相等– Question: 是否不同的香水包裝外觀 , 會影響
消費者購買意願– One way: 香水包裝外觀 (factor)– Hypothesis
• Ho: U1=U2=U3 (U1, U2, U3 是不同包裝香水購買的平均數量 )
Cont.
ANOVA
銷售量
503.467 4 125.867 2.708 .0531162.000 25 46.4801665.467 29
Between GroupsWithin GroupsTotal
Sum of Squares df Mean Square F Sig.
Test of Homogeneity of Variances
銷售量
2.643 4 25 .057Levene Statistic df1 df2 Sig.
Descriptives
銷售量
6 21.33 8.98 3.67 11.91 30.76 10 326 14.67 3.72 1.52 10.76 18.57 11 216 20.00 5.51 2.25 14.21 25.79 13 286 27.33 6.28 2.56 20.74 33.93 19 376 19.00 8.25 3.37 10.35 27.65 10 31
30 20.47 7.58 1.38 17.64 23.30 10 37
12345Total
N Mean Std. Deviation Std. Error Lower Bound Upper Bound
95% Confidence Interval forMean
Minimum Maximum
造型
54321
Mean o
f 銷售量
30
28
26
24
22
20
18
16
14
12
Cont.
• Case (One way ANOVA)– Question: 不同心理疾病的人 , 其說話的中斷
次數是否相同– One way: 心理疾病 (factor)– Ho: U1=U2=U3
Test of Homogeneity of Variances
中斷次數
1.450 2 33 .249Levene Statistic df1 df2 Sig.
ANOVA
中斷次數
258.194 2 129.097 23.708 .000179.695 33 5.445437.889 35
Between GroupsWithin GroupsTotal
Sum of Squares df Mean Square F Sig.
One way ANOVA 相依樣本• Question
– 同一群人試驗不同彈藥裝卸的程序 , 是否不同裝卸的程序會有不同的裝卸速度
• Factor: 不同彈藥裝卸的程序• Hypothesis: Ho: U1=U2=U3=U4=U5
Cont.
Within-Subjects Factors
Measure: MEASURE_1
程序一程序二程序三程序四程序五
PROCE12345
DependentVariable
Tests of Within-Subjects Effects
Measure: MEASURE_1
66.867 4 16.717 7.610 .00166.867 2.721 24.574 7.610 .00466.867 4.000 16.717 7.610 .00166.867 1.000 66.867 7.610 .04043.933 20 2.19743.933 13.605 3.22943.933 20.000 2.19743.933 5.000 8.787
Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-boundSphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound
SourcePROCE
Error(PROCE)
Type III Sumof Squares df Mean Square F Sig.
Cont.
Tests of Within-Subjects Contrasts
Measure: MEASURE_1
15.042 1 15.042 9.601 .02716.667 1 16.667 5.515 .06613.500 1 13.500 3.293 .12966.667 1 66.667 13.158 .0157.833 5 1.567
15.111 5 3.02220.500 5 4.10025.333 5 5.067
PROCELevel 1 vs. LaterLevel 2 vs. LaterLevel 3 vs. LaterLevel 4 vs. Level 5Level 1 vs. LaterLevel 2 vs. LaterLevel 3 vs. LaterLevel 4 vs. Level 5
SourcePROCE
Error(PROCE)
Type III Sumof Squares df Mean Square F Sig.
Two Way ANOVA
• 種類– 自變數都是獨立樣本– 自變數都是相依樣本– 混合設計 : 自變數有的是獨立樣本 , 有的是
相依樣本
Two Way ANOVA- 獨立樣本– Question: 不同的戒菸宣導短片對不同性別
的戒菸者是否有同樣的效果– Factor
• 宣導短片• 性別
– Hypothesis• Ho: U1=U2=U3
• Ho’:Uf=Um
Levene's Test of Equality of Error Variancesa
Dependent Variable: 戒煙傾向
.550 5 54 .738F df1 df2 Sig.
Tests the null hypothesis that the error variance of thedependent variable is equal across groups.
Design: Intercept+ + + * 性別 影片 性別 影片a.
Tests of Between-Subjects Effects
Dependent Variable: 戒煙傾向
2164.733a 5 432.947 23.890 .000 .689390426.667 1 390426.667 21544.083 .000 .997
614.400 1 614.400 33.903 .000 .38643.433 2 21.717 1.198 .310 .042
1506.900 2 753.450 41.576 .000 .606978.600 54 18.122
393570.000 603143.333 59
SourceCorrected ModelIntercept性別影片
* 性別 影片ErrorTotalCorrected Total
Type III Sumof Squares df Mean Square F Sig.
Partial EtaSquared
R Squared = .689 (Adjusted R Squared = .660)a.
Multiple Comparisons
Dependent Variable: 戒煙傾向Tukey HSD
-.7000 1.3462 .862 -3.9443 2.5443-2.0500 1.3462 .288 -5.2943 1.1943
.7000 1.3462 .862 -2.5443 3.9443-1.3500 1.3462 .578 -4.5943 1.89432.0500 1.3462 .288 -1.1943 5.29431.3500 1.3462 .578 -1.8943 4.5943
(J) 影片2.003.001.003.001.002.00
(I) 影片1.00
2.00
3.00
Mean Difference(I-J) Std. Error Sig. Lower Bound Upper Bound
95% Confidence Interval
Based on observed means.
Two Way ANOVA 相依樣本– Question: 在農業的實驗之中 , 檢驗光線與水
分 , 強中弱狀態 , 對於玉米是否有影響– Factor
• 光線與水分• 強中弱狀態
– Hypothesis• Ho: U1=U2 ( 控制光線與控制水是一樣的效果 )
• Ho’:Ua=Ub=Uc( 強度不論為何者 , 都是一樣的效果 )
Tests of Within-Subjects Effects
Measure: MEASURE_1
4.800 1 4.800 .783 .426 .164
4.800 1.000 4.800 .783 .426 .164
4.800 1.000 4.800 .783 .426 .164
4.800 1.000 4.800 .783 .426 .164
24.533 4 6.133
24.533 4.000 6.133
24.533 4.000 6.133
24.533 4.000 6.133
101.400 2 50.700 14.520 .002 .784
101.400 1.178 86.070 14.520 .013 .784
101.400 1.379 73.547 14.520 .008 .784
101.400 1.000 101.400 14.520 .019 .784
27.933 8 3.492
27.933 4.712 5.928
27.933 5.515 5.065
27.933 4.000 6.983
42.200 2 21.100 5.199 .036 .565
42.200 1.565 26.961 5.199 .052 .565
42.200 2.000 21.100 5.199 .036 .565
42.200 1.000 42.200 5.199 .085 .565
32.467 8 4.058
32.467 6.261 5.186
32.467 8.000 4.058
32.467 4.000 8.117
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
SourceÀô¹Ò
Error(Àô¹Ò)
±j«×
Error(±j«×)
Àô¹Ò * ±j«×
Error(Àô¹Ò*±j«×)
Type IIISum ofSquares df
MeanSquare F Sig.
EtaSquared
Tests of Within-Subjects Contrasts
Measure: MEASURE_1
3.200 1 3.200 .783 .426 .164
16.356 4 4.089
28.800 1 28.800 4.760 .095 .543
54.450 1 54.450 77.786 .001 .951
24.200 4 6.050
2.800 4 .700
51.200 1 51.200 6.244 .067 .610
88.200 1 88.200 4.846 .093 .548
32.800 4 8.200
72.800 4 18.200
±j«×
Level 2 vs. Level 1
Level 3 vs. Previous
Level 2 vs. Level 1
Level 3 vs. Previous
Level 2 vs. Level 1
Level 3 vs. Previous
Level 2 vs. Level 1
Level 3 vs. Previous
Àô¹ÒLevel 2 vs. Level 1
Level 2 vs. Level 1
Level 2 vs. Level 1
Level 2 vs. Level 1
SourceÀô¹Ò
Error(Àô¹Ò)
±j«×
Error(±j«×)
Àô¹Ò * ±j«×
Error(Àô¹Ò*±j«×)
Type IIISum ofSquares df
MeanSquare F Sig.
EtaSquared
Two Way ANOVA 混合設計– Question: 三部戒菸宣導短片對於不同性別
的戒菸者是否有不同的影響 ( 每個人都對短片說出感想 )
– Factor• 宣導短片• 性別
– Hypothesis• Ho: U1=U2=U3• Ho’: Uf=Um
Tests of Between-Subjects Effects
Measure: MEASURE_1Transformed Variable: Average
390426.667 1 390426.667 25748.705 .000 .999614.400 1 614.400 40.520 .000 .692272.933 18 15.163
SourceIntercept性別Error
Type III Sumof Squares df Mean Square F Sig.
Partial EtaSquared
Tests of Within-Subjects Effects
Measure: MEASURE_1
43.433 2 21.717 1.108 .341 .05843.433 1.810 23.997 1.108 .337 .05843.433 2.000 21.717 1.108 .341 .05843.433 1.000 43.433 1.108 .306 .058
1506.900 2 753.450 38.438 .000 .6811506.900 1.810 832.558 38.438 .000 .6811506.900 2.000 753.450 38.438 .000 .6811506.900 1.000 1506.900 38.438 .000 .681705.667 36 19.602705.667 32.579 21.660705.667 36.000 19.602705.667 18.000 39.204
Sphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-boundSphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-boundSphericity AssumedGreenhouse-GeisserHuynh-FeldtLower-bound
SourceFILM
FILM * 性別
Error(FILM)
Type III Sumof Squares df Mean Square F Sig.
Partial EtaSquared
多重比較• 事前比較
– 正交 / 非正交• 事後 (Pg 7-16)
– Tukey – Scheffee– Bonferroni– New man- Keul– Ducans
事前比較– 正交 / 非正交
4321 0011 XXXX
4321 0101 XXXX
4321 5.05.05.05.0 XXXX
Cont.• Case
– Question: • 四種不同銷售法中 ,A, B 是否會得到不同銷售結果
• 四種不同銷售法中 ,C, D 是否會得到不同銷售結果
• A, B 是舊的銷售法 ,CD 是新的銷售法 , 新舊是否會得到不同銷售結果
4321 0011 XXXX
4321 1100 XXXX
4321 5.05.05.05.0 XXXX
Test of Homogeneity of Variances
銷售量
3.438 3 16 .042Levene Statistic df1 df2 Sig.
ANOVA
銷售量
2984.150 3 994.717 8.426 .0011888.800 16 118.0504872.950 19
Between GroupsWithin GroupsTotal
Sum of Squares df Mean Square F Sig.
Contrast Coefficients
1 -1 0 0Contrast1
1 2 3 4銷售法
Contrast Tests
-2.00 6.87 -.291 16 .775-2.00 4.35 -.460 6.984 .659
Contrast11
Assume equal variancesDoes not assume equalvariances
銷售量
Value ofContrast Std. Error t df Sig. (2-tailed)
Q1
Q2
Test of Homogeneity of Variances
銷售量
3.438 3 16 .042Levene Statistic df1 df2 Sig.
ANOVA
銷售量
2984.150 3 994.717 8.426 .0011888.800 16 118.0504872.950 19
Between GroupsWithin GroupsTotal
Sum of Squares df Mean Square F Sig.
Contrast Coefficients
.5 .5 -.5 -.5Contrast1
1 2 3 4銷售法
Contrast Tests
16.50 4.86 3.396 16 .00416.50 4.86 3.396 6.622 .013
Contrast11
Assume equal variancesDoes not assume equalvariances
銷售量
Value ofContrast Std. Error t df Sig. (2-tailed)
事後比較• Case
– Question1: 不同裝卸彈藥的程序是否會影響執行時間
– Question2: 哪一類卸彈藥的程序比較費時– Factor: 不同裝卸彈藥的程序
Test of Homogeneity of Variances
裝卸次數
.034 4 25 .998Levene Statistic df1 df2 Sig.
ANOVA
裝卸次數
66.867 4 16.717 4.338 .00896.333 25 3.853
163.200 29
Between GroupsWithin GroupsTotal
Sum of Squares df Mean Square F Sig.
Multiple Comparisons
Dependent Variable: 裝卸次數Scheffe
-.3333 1.1333 .999 -4.0981 3.4315-3.0000 1.1333 .170 -6.7648 .7648
.1667 1.1333 1.000 -3.5981 3.9315-3.1667 1.1333 .133 -6.9315 .5981
.3333 1.1333 .999 -3.4315 4.0981-2.6667 1.1333 .268 -6.4315 1.0981
.5000 1.1333 .995 -3.2648 4.2648-2.8333 1.1333 .215 -6.5981 .93153.0000 1.1333 .170 -.7648 6.76482.6667 1.1333 .268 -1.0981 6.43153.1667 1.1333 .133 -.5981 6.9315-.1667 1.1333 1.000 -3.9315 3.5981-.1667 1.1333 1.000 -3.9315 3.5981-.5000 1.1333 .995 -4.2648 3.2648
-3.1667 1.1333 .133 -6.9315 .5981-3.3333 1.1333 .103 -7.0981 .43153.1667 1.1333 .133 -.5981 6.93152.8333 1.1333 .215 -.9315 6.5981.1667 1.1333 1.000 -3.5981 3.9315
3.3333 1.1333 .103 -.4315 7.0981
(J) 程序23451345124512351234
(I) 程序1
2
3
4
5
Mean Difference(I-J) Std. Error Sig. Lower Bound Upper Bound
95% Confidence Interval
裝卸次數
6 18.16676 18.3333 18.33336 18.6667 18.66676 21.3333 21.33336 21.5000
.068 .0686 18.16676 18.33336 18.66676 21.33336 21.5000
.103
程序41235Sig.41235Sig.
Tukey HSDa
Scheffea
N 1 2Subset for alpha = .05
Means for groups in homogeneous subsets are displayed.Uses Harmonic Mean Sample Size = 6.000.a.
Case2
Test of Homogeneity of Variances
中斷次數
1.450 2 33 .249Levene Statistic df1 df2 Sig.
ANOVA
中斷次數
258.194 2 129.097 23.708 .000179.695 33 5.445437.889 35
Between GroupsWithin GroupsTotal
Sum of Squares df Mean Square F Sig.
Case2
Multiple Comparisons
Dependent Variable: 中斷次數Scheffe
4.87* 1.00 .000 2.31 7.436.10* .92 .000 3.74 8.45
-4.87* 1.00 .000 -7.43 -2.311.23 .97 .454 -1.25 3.71
-6.10* .92 .000 -8.45 -3.74-1.23 .97 .454 -3.71 1.25
(J) 患者類型231312
(I) 患者類型1
2
3
Mean Difference(I-J) Std. Error Sig. Lower Bound Upper Bound
95% Confidence Interval
The mean difference is significant at the .05 level.*.
Case2
中斷次數
Scheffea,b
14 5.5710 6.8012 11.67
.451 1.000
患者類型321Sig.
N 1 2Subset for alpha = .05
Means for groups in homogeneous subsets are displayed.Uses Harmonic Mean Sample Size = 11.776.a. The group sizes are unequal. The harmonic mean of thegroup sizes is used. Type I error levels are not guaranteed.
b.
MANOVABetween-Subjects Factors
146154100100
100
8213583
12
學生性別
123
家庭狀況
1.002.003.00
工作投入組別
N
Multivariate Test Results
.084 8.530a 3.000 280.000 .000
.916 8.530a 3.000 280.000 .000
.091 8.530a 3.000 280.000 .000
.091 8.530a 3.000 280.000 .000
Pillai's traceWilks' lambdaHotelling's traceRoy's largest root
Value F Hypothesis df Error df Sig.
Exact statistica.
Levene's Test of Equality of Error Variancesa
1.282 17 282 .2031.054 17 282 .400.687 17 282 .815
數學成就學習信心探究動機
F df1 df2 Sig.
Tests the null hypothesis that the error variance of the dependentvariable is equal across groups.
Design: Intercept+ + + + * 性別 家庭狀況 投入組別 性別 家+ * + * + * 庭狀況 性別 投入組別 家庭狀況 投入組別 性別
* 家庭狀況 投入組別
a.
Tests of Between-Subjects Effects
6085.085a 17 357.946 3.684 .0007227.088b 17 425.123 9.575 .0001784.379c 17 104.963 7.027 .000
170416.108 1 170416.108 1753.729 .000240880.029 1 240880.029 5425.554 .000118914.805 1 118914.805 7960.459 .000
712.926 1 712.926 7.337 .007493.208 1 493.208 11.109 .001
.813 1 .813 .054 .816910.754 2 455.377 4.686 .01067.206 2 33.603 .757 .47010.015 2 5.008 .335 .715
3379.316 2 1689.658 17.388 .0006137.418 2 3068.709 69.119 .0001587.554 2 793.777 53.137 .000107.221 2 53.611 .552 .57754.151 2 27.076 .610 .5443.469 2 1.734 .116 .890
365.195 2 182.598 1.879 .1555.634 2 2.817 .063 .939
10.388 2 5.194 .348 .707452.536 4 113.134 1.164 .327338.959 4 84.740 1.909 .10923.731 4 5.933 .397 .811
437.166 4 109.291 1.125 .34587.303 4 21.826 .492 .74257.724 4 14.431 .966 .426
27402.952 282 97.17412520.042 282 44.3974212.568 282 14.938
216861.000 300276767.000 300132236.000 30033488.037 29919747.130 2995996.947 299
Dependent Variable數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機數學成就學習信心探究動機
SourceCorrected Model
Intercept
性別
家庭狀況
投入組別
* 性別 家庭狀況
* 性別 投入組別
* 家庭狀況 投入組別
* * 性別 家庭狀況 投入組別
Error
Total
Corrected Total
Type III Sumof Squares df Mean Square F Sig.
R Squared = .182 (Adjusted R Squared = .132)a. R Squared = .366 (Adjusted R Squared = .328)b. R Squared = .298 (Adjusted R Squared = .255)c.