多元统计 方差分析

更新时间:2024-03-24 23:12:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

合肥学院

2015-2016第二学期

《多元统计分析》课程论文

论文题目 方差分析

姓 名 郑宁

学 号 1307021001

专 业 数学与应用数学(1)

成 绩

2016.4

方差分析

——以南极的1951-1980的3、6、9、12月的各温度的相关数据为基础,建立方差分析模型进行分析。

摘要:单因素方差分析(ANOVA)是用来研究一个分类型自变量的不同水平对一个数值型因变量的影响。方差分析不仅可以提高检验的效率,而且可以提高检验的可靠性。本论文为了研究南极的1951-1980的3、6、9、12月的各温度有无显著性变化。根据假设检验的原理,运用SAS软件,以南极的3、6、9、12月各温度作为实验因素,建立方差分析模型,最后在给定的显著性水平下,判断出各实验因素之间有无显著性差异,从而得出实验因素之间的方差分析模型,即确定了南极的1951-1980的3、6、9、12月的温度之间有没有显著性变化。

关键词:方差分析模型 SAS软件

一、问题提出与分析

现有南极的1951-1980的3、6、9、12月各温度的相关数据,请用方差分析研究南极的3、6、9、12月的各温度有没有显著性差异。数据资料如表1所示,其中,各指标含义如下:实验因素:a(表示3月)、b(表示6月)、c(表示9月)、d(表示12月)。

表1 南极的1951-1980的3、6、9、12月的各温度数据

1951 1952 a a 9 7.3 b b 4.9 4 c c 4.9 6.6 d d 8.3 9.5 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1951 1952 1953 1954 1955 1956 a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 8 9.9 7.9 7.6 10.2 8.4 8.3 8.6 7.5 9.2 8.2 7.9 9.4 8.4 8.9 8.8 7.5 8.6 9.1 8.7 9.2 8.4 9.8 8.5 8.7 8.5 8.6 9.6 9 7.3 8 9.9 7.9 7.6 b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 4.6 4.4 3.4 5.5 4.4 4.9 5.1 5.4 4.8 6 4.6 4.8 5 4.7 5.3 5.4 4.1 5.7 4.9 3 5.5 4.3 4.8 4 4.2 4.6 6.7 5.5 4.9 4 4.6 4.4 3.4 5.5 c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c 4.8 5.1 5.3 5.6 6.1 6 5.6 5.7 4.9 6 5.3 5.6 5.7 5.7 5 5.2 6.4 4.3 4.8 5.1 6.1 6.5 5.6 5.8 5.6 6.5 5.7 6.4 4.9 6.6 4.8 5.1 5.3 5.6 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 8.6 8.2 9.6 10 8.3 8.7 8.4 7.9 9.3 9.5 7 9.4 7.3 7.8 8.4 9.3 9.5 11.9 9.1 7.9 8.5 10.2 7.1 9.8 9.4 8.7 9.2 8.1 8.3 9.5 8.6 8.2 9.6 10 要求:

(1) 会对实际问题建立有效的方差回归模型;

(2) 学会利用SAS输出结果对模型作出结论式的分析,能对方差模

型进行运用,对实际问题的各因素进行有无显著性差异的判断。 二、模型建立

1.单因素试验的方差分析模型

设因素A有s个水平A1,A2,...,AS,在水平Aj(j?1,2,...,s)下,进行nj(nj?2)次独立实验,得到如下结果:

观察结果 A1 X11 X21 ... Xn11 我们假设:

(1)各个水平Aj(j?1,2,...,s)下的样本X1j,X2j, · · · ,Xnjj是来自具有相同方差?2; (2)均值分别为?j(j?1,2,...,s)的正态分布N(?j,?2),其中?j,?2未知; (3)设不同水平Aj下的样本之间相互独立;

由于Xij??j?N(0,?2),故Xij??记Xij??j??ij,则得到: j可看成是随机误差。

?Xij??j??ij?N(0,?2)??2??ij?N(0,?),各?ij相互独立 ?i?1,2,...,nj,j?1,2,3...,s.??A2 X21 X22 ... Xn22 … · · · · · · · · · · · · As X1s X2s ... Xnss 其中?j与?2均为未知参数。

方差分析有两个任务:对上述模型检验个s总体的均值是否相等核对未知参数

?1,?2,...,?k,?2。即检验如下假设问题:

?H0:?1??2?...??k ??H1:?1,?2,...,?k不全相等三、模型的检验与分析

data a;

input month $ tempreture @@;

cards;

a 9 b 4.9 c 4.9 d 8.3 a 7.3 b 4 c 6.6 d 9.5 a 8 b 4.6 c 4.8 d 8.6 a 9.9 b 4.4 c 5.1 d 8.2 a 7.9 b 3.4 c 5.3 d 9.6 a 7.6 b 5.5 c 5.6 d 10 a 10.2

b 4.4 c 6.1 d 8.3

a 8.4 b 4.9 c 6 d 8.7 a 8.3 b 5.1 c 5.6 d 8.4 a 8.6 b 5.4 c 5.7 d 7.9 a 7.5 b 4.8 c 4.9 d 9.3 a 9.2 b 6 c 6 d 9.5 a 8.2 b 4.6 c 5.3 d 7 a 7.9 b 4.8 c 5.6 d 9.4 a 9.4 b 5 c 5.7 d 7.3 a 8.4 b 4.7 c 5.7 d 7.8 a 8.9 b 5.3 c 5 d 8.4 a 8.8 b 5.4 c 5.2 d 9.3 a 7.5 b 4.1 c 6.4 d 9.5 a 8.6 b 5.7 c 4.3 d 11.9 a 9.1 b 4.9 c 4.8 d 9.1 a 8.7 b 3 c 5.1 d 7.9 a 9.2 b 5.5 c 6.1 d 8.5 a 8.4 b 4.3 c 6.5 d 10.2 a 9.8 b 4.8 c 5.6 d 7.1 a 8.5 b 4 c 5.8 d 9.8 a 8.7 b 4.2 c 5.6 d 9.4 a 8.5 b 4.6 c 6.5 d 8.7 a 8.6 b 6.7 c 5.7 d 9.2 a 9.6 b 5.5 c 6.4 d 8.1; proc anova data=a; class month;

model tempreture=month; run;

SAS 日 星期五 上午10时38分35秒 1

The ANOVA Procedure

Class Level Information

Class Levels Values

系统 2016年04月29

month 4 a b c d

Number of Observations Read 120 Number of Observations Used 120

The ANOVA Procedure

Dependent Variable: tempreture

Sum of

Source DF Squares Mean Square F Value Pr > F

Model 3 381.4786667 127.1595556 204.16 <.0001

Error 116 72.2480000 0.6228276

Corrected Total 119 453.7266667

R-Square Coeff Var Root MSE tempreture Mean

0.840768 11.32815 0.789194 6.966667

Source DF Anova SS Mean Square F Value Pr > F

month 3 381.4786667 127.1595556 204.16 <.0001

The ANOVA Procedure

t Tests (LSD) for tempreture

NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate.

Alpha 0.05 Error Degrees of Freedom 116 Error Mean Square 0.622828 Critical Value of t 1.98063

Least Significant Difference 0.4036

Means with the same letter are not significantly different.

t Grouping Mean N month

A 8.8300 30 d A

A 8.6233 30 a

B 5.5967 30 c

C 4.8167 30 b

该SAS程序运行给出了南极的温度方差分析结果,容易看出效应平方和为381.4786667,误差平方和为72.2480000,总偏差平方和453.7266667,效应、误差和总偏差的自由度分别s-1= 3,n-s=116 ,n-1=119,由最后一行可知F值为204.16,相应的P值(Pr?F) 为?.0001,可以得出南极不同月份的温度是有显著性差异

2,

data a;

input month $ tempreture @@; cards;

a 9 b 4.9 c 4.9 d 8.3 a 7.3 b 4 c 6.6 d 9.5 a 8 b 4.6 c 4.8 d 8.6 a 9.9 b 4.4 c 5.1 d 8.2 a 7.9 b 3.4 c 5.3 d 9.6 a 7.6 b 5.5 c 5.6 d 10 a 10.2

b 4.4 c 6.1 d 8.3

a 8.4 b 4.9 c 6 d 8.7 a 8.3 b 5.1 c 5.6 d 8.4 a 8.6 b 5.4 c 5.7 d 7.9 a 7.5 b 4.8 c 4.9 d 9.3 a 9.2 b 6 c 6 d 9.5 a 8.2 b 4.6 c 5.3 d 7 a 7.9 b 4.8 c 5.6 d 9.4 a 9.4 b 5 c 5.7 d 7.3 a 8.4 b 4.7 c 5.7 d 7.8 a 8.9 b 5.3 c 5 d 8.4 a 8.8 b 5.4 c 5.2 d 9.3

a 7.5 b 4.1 c 6.4 d 9.5 a 8.6 b 5.7 c 4.3 d 11.9 a 9.1 b 4.9 c 4.8 d 9.1 a 8.7 b 3 c 5.1 d 7.9 a 9.2 b 5.5 c 6.1 d 8.5 a 8.4 b 4.3 c 6.5 d 10.2 a 9.8 b 4.8 c 5.6 d 7.1 a 8.5 b 4 c 5.8 d 9.8 a 8.7 b 4.2 c 5.6 d 9.4 a 8.5 b 4.6 c 6.5 d 8.7 a 8.6 b 6.7 c 5.7 d 9.2 a 9.6 b 5.5 c 6.4 d 8.1 ;

proc anova data=a; class month;

model tempreture=month; means month/t; run;

The ANOVA Procedure

Class Level Information

Class Levels Values

month 4 a b c d

Number of Observations Read 120 Number of Observations Used 120

The ANOVA Procedure

Dependent Variable: tempreture

Sum of

Source DF Squares Mean Square F Value Pr > F

Model 3 381.4786667 127.1595556 204.16 <.0001

Error 116 72.2480000 0.6228276

Corrected Total 119 453.7266667

R-Square Coeff Var Root MSE tempreture Mean

0.840768 11.32815 0.789194 6.966667

Source DF Anova SS Mean Square F Value Pr > F

month 3 381.4786667 127.1595556 204.16 <.0001

The ANOVA Procedure

t Tests (LSD) for tempreture

NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate.

Alpha 0.05 Error Degrees of Freedom 116 Error Mean Square 0.622828 Critical Value of t 1.98063 Least Significant Difference 0.4036

Means with the same letter are not significantly different.

t Grouping Mean N month

A 8.8300 30 d A

A 8.6233 30 a

B 5.5967 30 c

C 4.8167 30 b

结果分析:该SAS程序运行给出了南极的温度数据多重比较检验结果。对输出

的结果说明如下:

Alpha=给出检验的alpha水平。缺省的错误率为0.005,即100次中有5次犯错机会。

Df=给出检验的自由度。对均衡的样本,自由度应为组数与样本量减1的乘积。检验的自由度为20。

Critical Value of T=列出检验使用的均方误差和临界值。均方误差为0.622828,临界值为1.98063。

Least significant Difference=给出在由Alpha=指定的水平下两均值间有显著性差异时的最小可能差值。最小可能差值水平是在0.4036。

四、总结

方差分析就是要判断试验中是否存在系统性变异,即试验因素的水平对试验指标是否产生显著性影响。用于检验变量间是否有显著性差异的F值由最后一行可知F值为204.16,相应的P值(Pr?F) 为?.0001,,相应的P值(Pr?F) 为?.0001,效应平方和为381.4786667,误差平方和为72.2480000,总偏差平方和453.7266667,效应、误差和总偏差的自由度分别s-1= 3,n-s=116 ,n-1=119,均方误差为0.622828,临界值为1.98063。Alpha=指定的水平下两均值间有显著性差异时的最小可能差值为0.05。因此可以得出南极1951-1980年份的不同月份的温度是没有显著性差异。

本文来源:https://www.bwwdw.com/article/dw68.html

Top