1、目录目录v 方差分析的概念方差分析的概念v 简单的一维方差分析简单的一维方差分析v 单因变量多因素方差分析单因变量多因素方差分析操作操作随机区组设计资料的方差分析随机区组设计资料的方差分析2 22 2析因实验方差分析实例析因实验方差分析实例拉丁方区组设计的方差分析实例拉丁方区组设计的方差分析实例协方差分析实例协方差分析实例多维交互效应方差分析实例多维交互效应方差分析实例v 多因变量方差分析多因变量方差分析操作操作实例实例单因素方差分析单因素方差分析-主对话框主对话框 返回返回 对照比较对话框对照比较对话框返回返回 均值多重比较的对话框均值多重比较的对话框 返回返回输出统计量对话框输出统计量对话
2、框 返回返回实例实例1分析输出分析输出1DescriptivesWEIGHT5133.36006.80793.0446124.9068141.8132125.30143.105152.04006.95723.1114143.4015160.6785143.80162.705189.72006.35042.8400181.8350197.6050182.80198.604220.77506.10593.0530211.0591230.4909212.30225.8019171.510534.31147.8716154.9730188.0481125.30225.80ABCDTotalNMeanS
3、td.DeviationStd.ErrorLowerBoundUpperBound95%ConfidenceInterval for MeanMinimumMaximum返回返回描述统计量描述统计量实例实例1分析输出分析输出2Test of Homogeneity of VariancesWEIGHT.024315.995LeveneStatisticdf1df2Sig.A AN NO OV VA Aweight20538.69836846.233157.467.000652.1591543.47721190.85818Between GroupsWithin GroupsTotalSum o
4、fSquaresdfMean SquareFSig.返回返回方差齐性检验结果表方差齐性检验结果表单因素方差分析结果表单因素方差分析结果表实例实例1分析输出分析输出3M Mu ul lt ti ip pl le e C Co om mp pa ar ri is so on ns sDependent Variable:weight-18.68000*4.17024.000-27.5687-9.7913-56.36000*4.17024.000-65.2487-47.4713-87.41500*4.42321.000-96.8428-77.987218.68000*4.17024.0009.791
5、327.5687-37.68000*4.17024.000-46.5687-28.7913-68.73500*4.42321.000-78.1628-59.307256.36000*4.17024.00047.471365.248737.68000*4.17024.00028.791346.5687-31.05500*4.42321.000-40.4828-21.627287.41500*4.42321.00077.987296.842868.73500*4.42321.00059.307278.162831.05500*4.42321.00021.627240.4828-18.68000*4
6、.35318.016-33.7633-3.5967-56.36000*4.16353.000-70.8053-41.9147-87.41500*4.31164.000-103.1431-71.686918.68000*4.35318.0163.596733.7633-37.68000*4.21260.000-52.3109-23.0491-68.73500*4.35904.000-84.6022-52.867856.36000*4.16353.00041.914770.805337.68000*4.21260.00023.049152.3109-31.05500*4.16966.001-46.
7、4051-15.704987.41500*4.31164.00071.6869103.143168.73500*4.35904.00052.867884.602231.05500*4.16966.00115.704946.4051(J)fodderBCDACDABDABCBCDACDABDABC(I)fodderABCDABCDLSDTamhaneMeanDifference(I-J)Std.ErrorSig.Lower BoundUpper Bound95%Confidence IntervalThe mean difference is significant at the.05 leve
8、l.*.返回返回 LSD法和法和Tamhanes T2法进行均值多重比较的结果法进行均值多重比较的结果 实例实例1分析输出分析输出4weightweight5133.365152.045189.724220.771.0001.0001.0001.000fodderABCDSig.Duncana,bN1234Subset for alpha=.05Means for groups in homogeneous subsets are displayed.Uses Harmonic Mean Sample Size=4.706.a.The group sizes are unequal.The h
9、armonic mean of thegroup sizes is used.Type I error levels are not guaranteed.b.返回返回DUNCAN法进行一致性子集检验结果法进行一致性子集检验结果实例1分析输出5返回返回均值散点图均值散点图实例2分析输出1DescriptivesDescriptivesnitrogen528.8205.80022.593921.61836.02219.433.0514.6404.11621.84089.52919.7519.119.4523.9803.77721.689219.29028.67017.727.9519.9201.
10、1300.505418.51721.32318.621.0513.2601.4276.638411.48715.03311.614.4518.7001.6016.716216.71120.68916.920.83019.8876.24221.139717.55622.2189.133.014571330TotalNMeanStd.DeviationStd.ErrorLower BoundUpper Bound95%Confidence Interval forMeanMinimumMaximum描述统计量描述统计量返回返回实例2分析输出2T Te es st t o of f H Ho om
11、mo og ge en ne ei it ty y o of f V Va ar ri ia an nc ce es snitrogen3.145524.025LeveneStatisticdf1df2Sig.ANOVAANOVAnitrogen847.0475169.40914.371.000282.9282411.7891129.97529Between GroupsWithin GroupsTotalSum of SquaresdfMean SquareFSig.方差齐性检验结果方差齐性检验结果 单因素方差分析单因素方差分析 返回返回实例2分析输出3(部分)返回返回实例2分析输出4nit
12、rogennitrogen513.260514.640518.70018.700519.92019.920523.98023.980528.820.053.185.262strain13430751Sig.Tukey HSDaN123Subset for alpha=0.05Means for groups in homogeneous subsets are displayed.Uses Harmonic Mean Sample Size=5.000.a.一致性子集检验结果一致性子集检验结果 返回返回单因变量多因素方差分析返回返回单因变量多因素方差分析过程单因变量多因素方差分析过程主对话框主
13、对话框返回返回定义分析模型对话框定义分析模型对话框返回返回选择对照方法对话框选择对照方法对话框 返回返回选择输出项的对话框选择输出项的对话框 返回返回随机区组设计资料的方差分析随机区组设计资料的方差分析 不同种系、剂量的子宫重量例题数据不同种系、剂量的子宫重量例题数据 方差分析的数据安排方差分析的数据安排 返回返回剂剂 量量种系种系0.2(1)0.4(2)0.8(3)A(1)106116145B(2)4268115C(3)70111133D(4)426387输出输出Tests of Between-Subjects EffectsDependent Variable:WUTERI12531.6
14、67a52506.33327.677.000100467.01100467.01109.452.0006457.66732152.55623.771.0016074.00023037.00033.537.001543.333690.556113542.01213075.00011SourceCorrected ModelInterceptMOUSEETROGENErrorTotalCorrected TotalType IIISum ofSquaresdfMeanSquareFSig.R Squared=.958(Adjusted R Squared=.924)a.主效应方差分析检验结果主效应
15、方差分析检验结果 返回返回2 22 2析因实验方差分析实例析因实验方差分析实例 Tests of Between-Subjects EffectsDependent Variable:红细胞增加数2.963a3.98898.750.00019.507119.507 1950.750.0001.68811.688168.750.000.9071.90790.750.000.3681.36836.750.0008.000E-028 1.000E-0222.550123.04311SourceCorrected ModelInterceptDRUGADRUGBDRUGA*DRUGBErrorTota
16、lCorrected TotalType IIISum ofSquaresdfMeanSquareFSig.R Squared=.974(Adjusted R Squared=.964)a.方差分析表 返回返回均值图均值图 A药效应均值图药效应均值图 B药效应均值图药效应均值图 A、B药对红细胞增加数药对红细胞增加数交互效应边际图交互效应边际图 返回返回拉丁方区组设计的方差分析实例输出拉丁方区组设计的方差分析实例输出Between-Subjects Factors121212121212121212121212121212121212N123456REP123456COL123456VARIE
17、TY因素变量表因素变量表 Tests of Between-Subjects EffectsDependent Variable:YIELD27.717a151.8481.339.21122588.751122588.75116364.072.0004.4605.892.646.6661.6955.339.246.94021.56354.3133.124.01577.302561.38022693.77072105.01971SourceCorrected ModelInterceptREPCOLVARIETYErrorTotalCorrected TotalType III Sumof Sq
18、uaresdfMeanSquareFSig.R Squared=.264(Adjusted R Squared=.067)a.方差分析表 返回返回主效应因素均值表(部分)主效应因素均值表(部分)返回返回P Pa ai ir rw wi is se e C Co om mp pa ar ri is so on ns sDependent Variable:YIELD.192.480.691-.7691.153-.167.480.730-1.128.794-.083.480.863-1.044.878.333.480.490-.6281.294.550.480.256-.4111.511-.192
19、.480.691-1.153.769-.358.480.458-1.319.603-.275.480.569-1.236.686.142.480.769-.8191.103.358.480.458-.6031.319.167.480.730-.7941.128.358.480.458-.6031.319.083.480.863-.8781.044.500.480.302-.4611.461.717.480.141-.2441.678.083.480.863-.8781.044.275.480.569-.6861.236-.083.480.863-1.044.878.417.480.389-.5
20、441.378.633.480.192-.3281.594-.333.480.490-1.294.628-.142.480.769-1.103.819-.500.480.302-1.461.461-.417.480.389-1.378.544.217.480.653-.7441.178-.550.480.256-1.511.411-.358.480.458-1.319.603-.717.480.141-1.678.244-.633.480.192-1.594.328-.217.480.653-1.178.744(J)REP234561345612456123561234612345(I)REP
21、123456MeanDifference(I-J)Std.ErrorSig.aLowerBoundUpperBound95%ConfidenceInterval forDifferenceaBased on estimated marginal meansAdjustment for multiple comparisons:Least SignificantDifference(equivalent to no adjustments).a.协方差分析实例输出协方差分析实例输出 1Between-Subjects FactorsBetween-Subjects Factors大于等于10年1
22、2不足10年1612暴露于镉尘年段Value LabelN因素变量表 Tests of Between-Subjects EffectsDependent Variable:VITALCP11.085a25.54310.073.00141.936141.93676.216.00010.881110.88119.775.000.5421.542.985.33013.75525.550483.6252824.84127SourceCorrected ModelInterceptAGETIMEErrorTotalCorrected TotalType III Sumof SquaresdfMeanS
23、quareFSig.R Squared=.446(Adjusted R Squared=.402)a.方差分析表 返回返回协方差分析实例输出协方差分析实例输出2P Pa ar ra am me et te er r E Es st ti im ma at te es sDependent Variable:肺活量7.977.8868.998.0006.1519.803-8.70E-02.020-4.447.000-.127-4.670E-02.300.303.993.330-.323.9240a.ParameterInterceptAGETIME=1TIME=2BStd.ErrortSig.L
24、ower BoundUpper Bound95%Confidence IntervalThis parameter is set to zero because it is redundant.a.参数估测值的输出结果表 按时间分组的肺活量均值表 暴暴 露露 于于 镉镉 尘尘 年年 段段Dependent Variable:肺活量4.219a.2233.7614.6783.919a.1913.5264.312暴露于镉尘年段大于等于10年不足10年MeanStd.ErrorLower BoundUpper Bound95%Confidence IntervalEvaluated at covar
25、iates appeared in the model:年龄=46.64.a.返回返回多维交互效应方差分析实例输出多维交互效应方差分析实例输出1 Between-Subjects Factorst130t230t330t430d140d240d340l160l2601234target123device12lightValueLabelN因素变量表因素变量表 Tests of Between-Subjects EffectsDependent Variable:SCORE783.467a2334.06446.451.0003162.13313162.133 4312.000.000235.20
26、0378.400106.909.00086.467243.23358.955.00076.800176.800104.727.000104.200617.36723.682.00093.867331.28942.667.000186.933823.36731.864.00070.40096.7334016.000120853.867119SourceCorrected ModelInterceptTARGETDEVICELIGHTTARGET*DEVICETARGET*LIGHTTARGET*DEVICE*LIGHTErrorTotalCorrected TotalType IIISum of
27、SquaresdfMeanSquareFSig.R Squared=.918(Adjusted R Squared=.898)a.方差分析结果方差分析结果 返回返回多维交互效应方差分析实例输出多维交互效应方差分析实例输出2device*light*targetDependent Variable:SCORE2.000.3831.2402.7608.000.3837.2408.7608.800.3838.0409.5607.200.3836.4407.9601.600.383.8402.3604.400.3833.6405.1605.600.3834.8406.3606.800.3836.040
28、7.560.800.3834.E-021.5608.400.3837.6409.1609.600.3838.84010.3609.200.3838.4409.9605.200.3834.4405.9606.400.3835.6407.1604.800.3834.0405.5602.800.3832.0403.5604.000.3833.2404.7605.200.3834.4405.9606.000.3835.2406.7602.000.3831.2402.7603.200.3832.4403.9601.200.383.4401.9604.400.3833.6405.1605.600.3834
29、.8406.360targett1t2t3t4t1t2t3t4t1t2t3t4t1t2t3t4t1t2t3t4t1t2t3t4lightl1l2l1l2l1l2deviced1d2d3MeanStd.ErrorLowerBoundUpperBound95%ConfidenceInterval返回返回各单元格观测量均值(部分)各单元格观测量均值(部分)多维交互效应方差分析实例输出多维交互效应方差分析实例输出2 第一种照度下心理得分第二种照度下心理得分返回返回边际均值图边际均值图多 因 变 量 方 差 分 析返回返回 多因变量线性方差分析主对话框多因变量线性方差分析主对话框 返回返回多因变量方差分
30、析多因变量方差分析OptionsOptions对话框对话框 返回返回多因变量方差分析实例:变量多因变量方差分析实例:变量返回返回变量名变量名标标 签签中文标签中文标签值值值标签值标签值标签值标签(中文中文)losLength of stay住院时间长住院时间长短短costTreatment costs治疗花费治疗花费clotsolvClot-dissolving drugs凝块消溶药凝块消溶药1Streptokinase链激酶链激酶2reteplase瑞替普酶瑞替普酶3alteplase阿替普酶阿替普酶procSurgical treatment手术治疗手术治疗1PTCA经皮冠状动脉成经皮冠状
31、动脉成型术型术2CABG搭桥术搭桥术例题输出例题输出1Between-Subjects FactorsBetween-Subjects Factors经皮冠状动脉成型术907搭桥术574链激酶116瑞替普酶696阿替普酶66912外科手术123凝块消溶药Value LabelND De es sc cr ri ip pt ti iv ve e S St ta at ti is st ti ic cs s4.941.105684.811.0724414.681.0483984.771.0669077.251.263486.621.1372556.481.1352716.601.1635745.9
32、01.6331165.471.3996965.411.3966695.481.422148128.38383.273886829.66743.1809644129.80733.6009439829.63263.3940690744.72255.427804844.62515.2250625544.74325.6308127144.68905.4278957435.14479.1434411635.14768.2702169635.85758.6233766935.46818.503141481凝块消溶药链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Tot
33、al链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Total外科手术经皮冠状动脉成型术搭桥术Total经皮冠状动脉成型术搭桥术Total住院时间(天)治疗花费MeanStd.DeviationN返回返回各单元频数各单元频数描述统计量描述统计量例题输出例题输出4B Bo ox x s s T Te es st t o of f E Eq qu ua al li it ty y o of f C Co ov va ar ri ia an nc ce e M Ma at tr ri ic ce es sa a270.50917.90815358296.5.00
34、0Boxs MFdf1df2Sig.Tests the null hypothesis that the observed covariancematrices of the dependent variables are equal across groups.Design:Intercept+clotsolv+proc+clotsolv*proca.Levenes Test of Equality of Error VariancesLevenes Test of Equality of Error Variancesa a1.50751475.18510.00151475.000住院时间
35、(天)治疗花费Fdf1df2Sig.Tests the null hypothesis that the error variance of thedependent variable is equal across groups.Design:Intercept+proc+clotsolv+proc*clotsolva.返回返回协方差阵的齐性检验协方差阵的齐性检验实例:作图检查变量的正态性不同手术花费直方图不同手术花费直方图住院时间直方图住院时间直方图返回返回注:第注:第3 3版第版第1 1次印刷书中丢掉了这个部分,图标号顺序有误次印刷书中丢掉了这个部分,图标号顺序有误改变分析数据后的分析输
36、出改变分析数据后的分析输出1 1Between-Subjects FactorsBetween-Subjects Factors链激酶68瑞替普酶441阿替普酶398链激酶48瑞替普酶255阿替普酶271123凝块消溶药123凝块消溶药外科手术经皮冠状动脉成型术搭桥术Value LabelND De es sc cr ri ip pt ti iv ve e S St ta at ti is st ti ic cs s4.941.105684.811.0724414.681.0483984.771.0669071.4504.04802681.4700.043924411.4715.0488339
37、81.4692.046719077.251.263486.621.1372556.481.1352716.601.1635741.6478.04796481.6470.045382551.6478.049102711.6474.04731574凝块消溶药链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Total链激酶瑞替普酶阿替普酶Total住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)外科手术经皮冠状动脉成型术搭桥术MeanStd.DeviationN组间因素各单元频数组间因素各单元频数 描述统计量描述统计量 返回返回改变分析数
38、据后的分析输出改变分析数据后的分析输出2 2Boxs Test of Equality of Covariance MatricesBoxs Test of Equality of Covariance Matricesa a12.2082.0216246014.6.0597.8041.2886126223.5.259Boxs MFdf1df2Sig.Boxs MFdf1df2Sig.经皮冠状动脉成型术搭桥术Tests the null hypothesis that the observed covariancematrices of the dependent variables are
39、equal across groups.Design:Intercept+clotsolva.L Le ev ve en ne e s s T Te es st t o of f E Eq qu ua al li it ty y o of f E Er rr ro or r V Va ar ri ia an nc ce es sa a.5452904.5801.9502904.143.5242571.592.8202571.441住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)外科手术经皮冠状动脉成型术搭桥术Fdf1df2Sig.Tests the null hypot
40、hesis that the error variance of the dependentvariable is equal across groups.Design:Intercept+clotsolva.返回返回协方差阵相等的协方差阵相等的Box检验检验误差方差相等的误差方差相等的Leven检验检验改变分析数据后的分析输出改变分析数据后的分析输出3 3Tests of Between-Subjects EffectsTests of Between-Subjects Effects5.725a22.8632.529.080.006.026b2.0136.112.002.01310695.
41、320110695.3209448.8.000.913989.8451989.845458854.000.9985.72522.8632.529.080.006.0262.0136.112.002.0131023.2549041.1321.950904.00221624.0009071959.6769071028.9799061.97690624.504c212.2529.316.000.032.000d2.000.017.984.00014546.869114546.86911061.000.951858.8181858.818382466.000.99924.504212.2529.316
42、.000.032.0002.000.017.984.000750.9315711.3151.282571.00225800.0005741559.156574775.4365731.282573Dependent Variable住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)住院时间(
43、天)治疗花费对数(底10)住院时间(天)治疗花费对数(底10)SourceCorrected ModelInterceptclotsolvErrorTotalCorrected TotalCorrected ModelInterceptclotsolvErrorTotalCorrected Total外科手术经皮冠状动脉成型术搭桥术Type III Sumof SquaresdfMean SquareFSig.Partial EtaSquaredR Squared=.006(Adjusted R Squared=.003)a.R Squared=.013(Adjusted R Squared=
44、.011)b.R Squared=.032(Adjusted R Squared=.028)c.R Squared=.000(Adjusted R Squared=-.003)d.返回返回多元方差分析检验结果多元方差分析检验结果改变分析数据后的分析输出改变分析数据后的分析输出4 4外科手术=经皮冠状动脉成型术外科手术=经皮冠状动脉成型术-.129.02000-.129.020.139.006.351.001-.401.008.143.031-.258.02100-.258.021.140.006.065.001-.532.009.016.033Contrast EstimateHypothes
45、ized ValueDifference(Estimate-Hypothesized)Std.ErrorSig.Lower BoundUpper Bound95%Confidence Intervalfor DifferenceContrast EstimateHypothesized ValueDifference(Estimate-Hypothesized)Std.ErrorSig.Lower BoundUpper Bound95%Confidence Intervalfor Difference凝块消溶药Simple ContrastaLevel 2 vs.Level 1Level 3
46、vs.Level 1住院时间(天)治疗花费对数(底10)Dependent VariableReference category=1a.返回返回不同凝块消溶药对住院时间和治疗花费的影响(不同凝块消溶药对住院时间和治疗花费的影响(PTCAPTCA)改变分析数据后的分析输出改变分析数据后的分析输出5 5外科手术=搭桥术外科手术=搭桥术-.634-.00100-.634-.001.180.007.000.922-.989-.015-.280.014-.774.00000-.774.000.180.007.000.999-1.127-.015-.421.015Contrast EstimateHypo
47、thesized ValueDifference(Estimate-Hypothesized)Std.ErrorSig.Lower BoundUpper Bound95%Confidence Intervalfor DifferenceContrast EstimateHypothesized ValueDifference(Estimate-Hypothesized)Std.ErrorSig.Lower BoundUpper Bound95%Confidence Intervalfor Difference凝块消溶药Simple ContrastaLevel 2 vs.Level 1Leve
48、l 3 vs.Level 1住院时间(天)治疗花费对数(底10)Dependent VariableReference category=1a.返回返回不同凝块消溶药对住院时间和治疗花费的影响(不同凝块消溶药对住院时间和治疗花费的影响(CABG)改变分析数据后的分析输出改变分析数据后的分析输出6 6外科手术=经皮冠状动脉成型术外科手术=经皮冠状动脉成型术Tukey HSDa,b681.45044411.47003981.47151.000.958凝块消溶药链激酶瑞替普酶阿替普酶Sig.N12SubsetMeans for groups in homogeneous subsets are di
49、splayed.Based on Type III Sum of SquaresThe error term is Mean Square(Error)=.002.Uses Harmonic Mean Sample Size=153.957.a.Alpha=.05.b.外科手术=搭桥术外科手术=搭桥术Tukey HSDa,b2551.64702711.6478481.6478.993凝块消溶药瑞替普酶阿替普酶链激酶Sig.N1SubsetMeans for groups in homogeneous subsets are displayed.Based on Type III Sum of
50、SquaresThe error term is Mean Square(Error)=.002.Uses Harmonic Mean Sample Size=105.467.a.Alpha=.05.b.返回返回治疗花费(对数)的一致性子集治疗花费(对数)的一致性子集重复测量设计的方差分析 返回返回重复测量的重复测量的 数据及文件结构数据及文件结构 返回返回原始数据原始数据数据文件结构数据文件结构定义组内因素的对话框定义组内因素的对话框返回返回重复测量方差分析主对话框重复测量方差分析主对话框返回返回重复测量方差分析模型定义对话框重复测量方差分析模型定义对话框 返回返回重复测量方差分析实例:数据