Presentation is loading. Please wait.

Presentation is loading. Please wait.

Statistics 04 ANOVA. Analysis of Variance (ANOVA) Z test or t test is used to test whether two sample means are sufficiently different to indicate the.

Similar presentations


Presentation on theme: "Statistics 04 ANOVA. Analysis of Variance (ANOVA) Z test or t test is used to test whether two sample means are sufficiently different to indicate the."— Presentation transcript:

1 Statistics 04 ANOVA

2 Analysis of Variance (ANOVA) Z test or t test is used to test whether two sample means are sufficiently different to indicate the samples are from populations with different population means. When more than two different groups are involved, we need to depend on ANOVA for the inference.

3 Cases of more than two groups Vocabulary test of candidates from four different regions (Europe, South America, North Africa, Far East) Different parts of a test (listening, reading, vocabulary, Cloze, translation) Different teaching methods (three textbooks)

4 Problems with Z test 1. Tedious computation: number of computation=N(N-1)/2 Vocabulary test on regions: 4(4-1)/2=6 Europe : South America Europe : North Africa Europe : Far East South America : North Africa South America : Far East North Africa : Far East 2. greater Type I error : α n

5 Principles of ANOVA Two kinds of differences in a test: systematic differences and random errors Systematic differences are caused by different experimental conditions. Random errors are caused by any factors other than experimental conditions. The total variance between different groups represents systematic differences The total variance within the group is random errors. The ratio of these two variances follows the F distribution. F=S b 2 /S w 2 Null hypothesis: S b 2 is not larger than S w 2 Large values of the F statistic throw doubt on the validity of the null hypothesis.

6 Principles of ANOVA The ratio of these two variances follows the F distribution. F=S b 2 /S w 2 Null hypothesis: S b 2 is not larger than S w 2 Large values of the F statistic throw doubt on the validity of the null hypothesis.

7 Types of ANOVA One-way ANOVA: the comparison of the means of groups which are classified according to a single criterion variable. Two-way ANOVA: when affected by more than one factor

8 Calculation of ANOVA F=S b 2 /S w 2 S b 2 (MS b ): mean between-groups sum of squares S w 2 (MS w ): mean within-groups sum of squares BSS (SS b ): between-groups sum of squares RSS (SS w ): within-groups sum of squares or residual sum of squares TSS (SS t ): total sum of squares TSS=BSS+RSS S b 2 = SS b / df b S w 2 = SS w / df w

9 Example Methods Subjects ABCm=3 110 15 2121420 361217 41288 5101115 X-jX-j 101115 Mt=12 T505575

10 Total sum of Squares (TSS) Need to compute: ΣX CF ΣX 2 X - j

11 Computation of ΣX ΣX : the sum of the all observations ΣX = X 1,1 +X 2,1 + … X 1,2 +X 2,2 + … + X i,j Example ΣX = 10+12+ … +10+14+ … + 8+15 =180

12 Computation of Correction Factor (CF) CF=( ΣX) 2 /mn m: the number of samples n: the size of each sample Example: (ΣX) 2 =180 2 = 32400 CF= 32400/(3*5)= 2160

13 Computation of ΣX 2 ΣX 2 : the sum of the squared observations ΣX 2 = X 1,1 2 +X 2,1 2 + … +X 1,2 2 +X 2,2 2 + … +X ij 2 Example: ΣX 2 = 10 2 +12 2 + … +10 2 +14 2 + … +8 2 +15 2 =2352

14 Computation of TSS TSS=ΣX 2 - CF (Woods) SS t =ΣX 2 - (ΣX) 2 /N (where: N=mn) ( 韩宝 成 ) The sum of all squared observations minus the correction factor Example: TSS=2352 - 2160=192

15 Computation of BSS BSS= Σ X j 2 /n - CF (Woods) SS b = Σ T 2 /n - (ΣX) 2 /N (where: T=total of a group, N=mn) ( 韩宝成 ) The sum of the totals of each group divided by the size of the sample (all samples are of the same size), then minus the correction factor Example: BSS=(50 2 +55 2 +75 2 )/5 - 2160=11150/5 - 2160=2230 - 2160=70

16 Computation of RSS RSS=TSS-BSS Example RSS=192 - 70=122

17 Computation of Degree of Freedom df t : degree of freedom of the total df t =mn - 1 product of the size of the sample and the number of the samples minus 1 Example: df t =mn - 1=3*5=15

18 Computation of Degree of Freedom df b : degree of freedom of the between- groups df b =m-1 the number of samples minus 1 Example: df b =m-1=3 - 1=2

19 Computation of Degree of Freedom df w : degree of freedom of the within-group df w =m(n-1) the number of the samples times the size of the sample minus 1 Example: df w =m(n-1)=3*(5-1)=12

20 Computation of S b 2 and S w 2 (mean sums of squares 均方 ) S b 2 =BSS/ df b Example: S b 2 =70/2=35

21 Computation of S b 2 and S w 2 (mean sums of squares 均方 ) S w 2 =RSS/ df w Example: S w 2 =122/12=10.17

22 Computation of F-ratio F=S b 2 /S w 2 Example: F=35/10.17= 3.44

23 Inference for the significant difference Look up for F α (m-1,m(n-1)) in the Table of F- distribution e.g.: F 0.05(2,3*(10-1)) = F 0.05(2,27) =3.35 ( 韩宝成: p.192, 分子: 2 ,分母: 27) ( Woods: p. 304, n1=2, n2=30 )

24 Compare F with F α (m-1,m(n-1)) e.g. F=3.44 F 0.05(2,27) =3.35 F> F 0.05(2,27) Conclusion: p<0.05 (H 0 rejected)

25 ANOVA Table (English) Source dfSSMSS F-ratio Confidence Level Between groupsm-1BSSS b 2 S b 2 / S w 2 p< α Within groups m(n-1)RSSS w 2 (residual) Total mn-1 TSS

26 ANOVA Table (Chinese) 变异来源 平方和 自由度 均方 F 显著性水平 组间 BSS m-1 S b 2 S b 2 / S w 2 p< α 组内 RSS m(n-1) S w 2 总变异 TSSmn-1

27 ANOVA Table (Example) Source df SSMSS F-ratio Confidence Level Between groups 2 70 35 3.44 p< 0.05 Within groups 27 122 10.17 (residual) Total 14 192

28 Steps of the Computation 1. Computation of sums of squares: TSS, BSS, RSS 2. Determination of degrees of freedom: df t, df b, df w 3. Computation of mean sums of squares: S b 2, S w 2 4. F testing: F, F α (m-1,m(n-1)) 5. Output an ANOVA table

29 Consistence of variances F max =S 2 max /S 2 min Check the Table of Critical Value of F max ( 韩宝成: p.198) If F max > F maxα, there is inconsistency among the variances. If F max < F maxα, there is no significant difference among the variances

30 完全随机化设计的方差分析( complete randomized design ) 随机区组实验设计的方差分析 (randomized block design) 多个平均数之间的比较

31 完全随机化设计的方差分析 ( complete randomized design ) 样本容量相同 样本容量不同

32 样本容量相同 5 steps 1. Compute for ΣX, (ΣX)2, ΣX2, k, n, N(N=mn) 2. Compute for sum of squares ( 离差平方和 ) (total, between-groups, within-groups) SSt=ΣX2 - (ΣX)2/N (where: N=mn) SSb=ΣT2/n - (ΣX)2/N (where: T=total of a group, N=mn) SS w =SS t - SS b

33 样本容量相同 3 . Determine the degrees of freedom df t =N-1 df b =k-1 df w =df t -df b 4. Compute for mean sum of squares S b 2 =SS b / df b S w 2 =SS w / df w 5. Compute for F ratio F=S b 2 /S w 2

34 样本容量不同 5 steps 1. Compute for ΣX, (ΣX) 2, ΣX 2, k, n, N(N=mn) 2. Compute for sum of squares ( 离差平方和 ) (total, between-groups, within-groups) SSt=ΣX 2 - (ΣX) 2 /N (where: N=mn) SSb=Σ(T 2 /n) - (ΣX) 2 /N (where: T=total of a group, N=mn) SS w =SS t - SS b

35 样本容量不同 3 . Determine the degrees of freedom dft=N-1 dfb=k-1 dfw=dft-dfb 4. Compute for mean sum of squares Sb2=SSb/ dfb Sw2=SSw/ dfw 5. Compute for F ratio F=Sb2/Sw2

36 Two-way ANOVA Variations in the case of error gravity scores: 1. Variation between m groups of judges (horizontal) 2. Variation between n different errors (vertical) 3. Residuals

37 Procedure of Calculation Calculations of TSS, ESS, GSS and Residual Calculations of degrees of freedom: between errors, between groups of judges, residual Calculation of mean sum of squares: S e 2, S g 2, S r 2 Calculation of F-ratio: S e 2 / S r 2, S g 2 / S r 2 Comparison of F and F α

38 Calculation of CF CF=(ΣX) 2 /mn =2462 2 /3*32 =63140.04

39 Calculation of TSS, ESS, GSS TSS=ΣY ij 2 - CF ESS: between errors sum of squares ESS=ΣY i 2 /m - CF GSS: between groups sum of squares GSS=ΣY j 2 /n - CF The divisor is the number of observations that have gone into each of the values being squared.

40 Calculation of degree of freedom df between errors : n-1 df between groups : m-1 df residual : (m-1)(n-1), or (mn-1)-(n-1)-(m-1) df total : mn-1

41 Calculations of MSS MSS between errors = ESS/ df between errors MSS between groups = GSS / df between groups MSS residual = RSS/ df residual

42 Calculation of F-ratio F between errors = MSS between errors / MSS residual Degree of freedom: df between errors, df residual Fbetween groups = MSS between groups / MSS residual Degree of freedom: df between groups, df residual

43 ANOVA table Source dfSSMSS F-ratio Confidence Level Between errorsn-1ESSESS/(n-1) EMSS/ RMSS p< α Between groups m-1GSSGSS/(m-1) GMSS/RMSS p< α Residual m(n-1) RSS RSS/m(n-1) Total mn-1 TSS

44 Factorial analysis Factors: Variants that affect the scores Level of the factor: different values of each factor Two null hypotheses in Two-way ANOVA e.g. 1. Mean scores are the same between geographical origins 2. Mean scores are the same between sexes


Download ppt "Statistics 04 ANOVA. Analysis of Variance (ANOVA) Z test or t test is used to test whether two sample means are sufficiently different to indicate the."

Similar presentations


Ads by Google