1、单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,8 Analysis of variance,(,ANOVA,),方差分析,Example,Tab 8-1 the weight difference between the pre and post feeding in three calcium levels on 36 rats,Can we use t test to compare each pair of groups,No.Why?,If m=3,there are m(m-1)/2 hypotheses we need to test.,W
2、hat is the probability of a Type I error?,If H0 is true and we use an,=0.05 to test each,the,probability we do not reject all 3 is(independence?),(1-0.05),3,=0.857,So,=1-0.857=0.143,0.143 0.05.Multiple comparisons problem!,Simutation study,xN(10,5,2,),number of samples is 10,each sample size is 20,,
3、means and SDs are listed in table,5/45,0.110.05,Analysis of variance(ANOVA),Test involving 3 or more means,Developed by R.A.Fisher,Statistician from Britain.,8.1 ANOVA for completely randomized design,Also called one-way analysis of variance,Terminology,术语,Factor and level,因素与水平,A,factor,is a varia
4、ble(,变量),that may affect the,response(,结果,),of an experiment.,In general,a factor has more than one,level,and the experimenter is interested in testing or comparing the effects of the different levels of a factor.,factor:calcium;response:weght changes;level:normal,median,high;,Random and Fixed Facto
5、rs,A factor can be classified as either fixed or random,depending on,how,its levels are,chosen,.,A,fixed factor,has levels that are determin-ed by the experimenter.,A,random factor,has levels that are chosen randomly from the population of all,possible levels,Balanced and Unbalanced Designs,An exper
6、iment is,balanced,if all treatment level combinations have the same number of experimental units.Otherwise,the,experiment is,unbalanced,.,The v,ariation is,sum of square(SS),Variance is mean square(MS,),What is variation,?,基本思想,the basic idea of,ANOVA,处理的作用 个体差异,SST,SSB,SSW,df:,K-1,(n,i,-1)=N-K,MS,B
7、MS,W,The F,formula is listed below,It is real means that,if there is little or no difference between the means,then MSB will be approximately equal to MSW and the test statistic F will be approximately 1.,F close to 1 suggest you should fail to reject the null Hypo.however,if one mean differs signi
8、ficantly from the others,MSB will be great than MSW and F will be great than 1.then you reject H0.,As such,Anova tests are,right-tailed tests,.,If F value greater than critical value,H0 will be rejected.See P469,F table,Basic steps-Null Hypothesis,H,0,:,1,=,2,=,k,(all population means are equal).,H1
9、not all population means,i,are equal.,(Can also be stated as,at least,two population,means are different,.),0.05,Basic steps-test statistic,MS,B,measure the differences related to the treatment given to each sample and some times called the mean square between.,MS,W,measure the differences related
10、 to the entries within the same sample,mean square within.,Solution to example,H,0,:,1,=,2,=,3,three population means are equal,H,1,:at least one of the means,is different from the others;,0.05,。,Calculate SS,df,MS,1,SST,:,总,=36-1,35,2,SSB,1,=,B,=k-1=3-1=2,3,SSW,47758.66-31291.79,16466.87,W,=,n-k,=3
11、6-3=33,4,、,calculate,F,value,:,Variance source,SS,df,MS,F,P,total,47758.32,35,between,31291.67,2,15645.83,31.36,0.01,within,16466.65,33,498.99,reject H0,that means we have enough evidence to conclude that there is difference in weght changes of three populations.,Compare F value with F table,and the
12、n make the decision,Relationships between t and F,Same points,1.Equality of variance(homoscedasticity).,hmusidstisti,2.Normality:Data are approximately normally distributed,or Sample size is large.,3.Independence:k samples drawn independently,Different points,Number of means,t test can be used to bo
13、th One-side test and two-side test,but anova only to two-side test.,F=t,2,when,number of,sample means equal to 2,ANOVA,One-way ANOVA is used to compare means for k,2,independent normal populations with equal variances,When k=2,the F test reduces to the two-sample equal variance t-test,Multiple compa
14、risons is a major issue that must be,addressed to maintain overall level,One-way ANOVA can be extended to(two-way,interactions,.),8.3 ANOVA for,randomized block design,ex8-2,为探索丹参对肢体缺血再灌注损伤的影响,将,30,只纯种新西兰实验用大白兔,按,窝别相同、体重相近,划分为,10,个区组。每个区组,3,只大白兔随机采用,A,、,B,、,C,三种处理方案,问,A,、,B,两方案分别与,C,方案的处理效果是否不同?,表,8
15、4,三种方案处理后大白兔血中白蛋白减少量(,g/L,),区组因素,处理因素,一、建立假设检验,确定检验水准,1,处理间,H,0,:,三种方案的处理效果相同,H,1,:,三种方案的处理效果不全相同。,2,区组间,H,0,:10,个区组的处理效果相同,H,1,:10,个区组的处理效果不全相同,=0.05,二、,计算检验统计量,F,值,变异的分解,处理间的变异,区组间的变异,随机误差的变异,SS,总,=,SS,处理,+,SS,区组,+,SS,误差,本例中,处理个数为,k=3,区组个数为,b=10,公式见,127,128,表,8-6,随机区组设计方差分析表,三、,确定,P,值并作出推断结论:,以自由度,2,和,18,及,9,和,18,,查附表,3,F,值表得,P,0.05,,可认为三个总体的方差齐性。,(,2,),Levene,检验,资料为,任意分布,的方差齐性检验,为离差,有四种计算方式。,统计软件做,SPSS,分析,SAS,分析结果,三 考察前提条件的残差图,方差齐性一个直观的判断方法是残差图,(residual plot),完全随机设计,随机区组设计,四 数据变化,正态性不满足,方差齐性不满足,可对数据进行变换或改用其它统计方法,常用数据变换方法,对数变换,对数正态分布资料;标准差与均数成比例,平方根变换,方差与均数成比例,(Poisson),平方根反正弦变换,百分比的资料,






