[转载]问题9、如何用SPSS作方差分析比较?(转)
[转载]问题9、如何用SPSS作方差分析比较?(转)
2011年11月17日
问题9、如何用SPSS作方差分析比较?
我们的实例是Kirk (1968, 第一版)的数据库crf24。 这些数据来源于2因素4水平的析因设计,不过仍可以作为单因素方差分析的实例。变量y是因变量。变量a是2水平的自变量,b是4水平的自变量。 显而易见,自变量b的全部F检验都有显著性。现在,设计一些能够进行检验的比较:
(1)第3组与第4组比较
(2)第1,2组的均数与第3,4组的均数比较
(3)第1,2,3组的均数与第4组比较 注意到可对每一因素作多重比较,如下所示。每次比较必须用逗号隔开。当每次检验的差异有显著性时,便不输出t值。若想获得t值,就不得不在比较结果表(K 矩阵)中按标准误将比较的估计值分开。 Contrast Results (K Matrix) Dependent Variable B Special Contrast Y L1 Contrast Estimate -2.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -2.750 Std. Error .605 Sig. .000 95% Confidence Interval for Difference Lower Bound -3.989 Upper Bound -1.511 L2 Contrast Estimate -9.000 Hypothesized Value 0 Difference (Estimate - Hypothesized) -9.000 Std. Error .856 Sig. .000 95% Confidence Interval for Difference Lower Bound -10.753 Upper Bound -7.247 L3 Contrast Estimate -14.500 Hypothesized Value 0 Difference (Estimate - Hypothesized) -14.500 Std. Error 1.482 Sig. .000 95% Confidence Interval for Difference Lower Bound -17.536 Upper Bound -11.464 用双因素方差分析的比较命令: 我们用双因素方差分析对变量b作同样的比较。 Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) 注意到双因素方差分析的F值要比单因素方差分析的F值大。是因为均方残差变小的缘故。
SPSS有许多可用的内置比较方法,每一种都是仅有的(如上例)。下面给出带有解释的比较结果列表以及语句如何执行的实例。比较第1和第2组,第2和第3组,第3和第4组,见比较结果表(K矩阵)。 Name of contrast
Comparison made Simple Compares each level of a variable to the last level (or whichever level is specified). Deviation Compares deviations from the grand mean. Difference Compares levels of a variable with the mean of the previous levels of the variable. Helmert Compare levels of a variable with the mean of the subsequent levels of the variable. Polynomial Orthogonal polynomial contrasts. Repeated Adjacent levels of a variable. Special User-defined contrast. Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Contrast Results (K Matrix) Dependent Variable B Repeated Contrast Y Level 1 vs. Level 2 Contrast Estimate -.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -.750 Std. Error .439 Sig. .100 95% Confidence Interval for Difference Lower Bound -1.656 Upper Bound .156 Level 2 vs. Level 3 Contrast Estimate -2.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -2.750 Std. Error .439 Sig. .000 95% Confidence Interval for Difference Lower Bound -3.656 Upper Bound -1.844 Level 3 vs. Level 4 Contrast Estimate -2.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -2.750 Std. Error .439 Sig. .000 95% Confidence Interval for Difference Lower Bound -3.656 Upper Bound -1.844 用双因素方差分析的比较命令: 我们用双因素方差分析对变量b作同样的比较。 Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) 注意到双因素方差分析的 F值要比单因素方差分析的F值大。这是因为均方残差变小的缘故。
SPSS有许多可用的内置比较方法,每一种都是仅有的(如上例)。下面给出带有解释的比较结果列表以及语句如何执行的实例。比较第1和第2组,第2和第3组,第3和第4组,见比较结果表(K矩阵)。 Name of contrast
Comparison made Simple Compares each level of a variable to the last level (or whichever level is specified). Deviation Compares deviations from the grand mean. Difference Compares levels of a variable with the mean of the previous levels of the variable. Helmert Compare levels of a variable with the mean of the subsequent levels of the variable. Polynomial Orthogonal polynomial contrasts. Repeated Adjacent levels of a variable. Special User-defined contrast. Tests of Between-Subjects Effects
Dependent Variable: Y Source Type III Sum of Squares df Mean Square F Sig. Corrected Model 217.000(a) 7 31.000 40.216 .000 Intercept 924.500 1 924.500 1199.351 .000 A 3.125 1 3.125 4.054 .055 B 194.500 3 64.833 84.108 .000 A * B 19.375 3 6.458 8.378 .001 Error 18.500 24 .771 Total 1160.000 32 Corrected Total 235.500 31 a R Squared = .921 (Adjusted R Squared = .899) Contrast Results (K Matrix) Dependent Variable B Repeated Contrast Y Level 1 vs. Level 2 Contrast Estimate -.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -.750 Std. Error .439 Sig. .100 95% Confidence Interval for Difference Lower Bound -1.656 Upper Bound .156 Level 2 vs. Level 3 Contrast Estimate -2.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -2.750 Std. Error .439 Sig. .000 95% Confidence Interval for Difference Lower Bound -3.656 Upper Bound -1.844 Level 3 vs. Level 4 Contrast Estimate -2.750 Hypothesized Value 0 Difference (Estimate - Hypothesized) -2.750 Std. Error .439 Sig. .000 95% Confidence Interval for Difference Lower Bound -3.656 Upper Bound -1.844