Presentation is loading. Please wait.

Presentation is loading. Please wait.

ANALYSIS OF VARIANCE (ANOVA)

Similar presentations


Presentation on theme: "ANALYSIS OF VARIANCE (ANOVA)"— Presentation transcript:

1 ANALYSIS OF VARIANCE (ANOVA)
In spite of its name it serves for comparing means, not for comparing variances. ANOVA1

2 Remember: Two-sample t test
Two independent samples Assuming the equality of variance for the two populations: ANOVA1

3 One-way ANOVA Several independent samples of size ANOVA1

4 The sample means are different, even if there is no difference between groups
ANOVA1

5 The sample means are more different. Is the difference significant?
group ANOVA1

6 order of experiments is important
Example 51 (Box-Hunter-Hunter: Statistics for Experimenters, J. Wiley, 1978, p. 165) Blood coagulation times (seconds) with four different diets order of experiments is important ANOVA1

7 ANOVA1

8 ANOVA1

9 Open Data Table: blood.xls Analyze>Fit Y by X Y: CTIME X: DIET
click on the red triangle, choose Display options error bar ANOVA1

10 The variance within the i-th group
(deviations from the group mean) The pooled within-groups variance (if constant across groups): ANOVA1

11 Variance of the group mean, if there is no real difference (H0)
but sampling fluctuation repetitions as it is estimated from the group means (if p=const) more generally (if pconst) ANOVA1

12 if there exists real difference (H1)
(between) (within) if there exists real difference (H1) ANOVA1

13 The ANOVA Table Effect of factor A is significant (H0 hypothesis is rejected) if ANOVA1

14 Balanced design: p1=p2=...=pr=p
ANOVA1

15 Click on the red triangle, choose Means/Anova
Example (cont.) Click on the red triangle, choose Means/Anova F0 between p within decision? ANOVA1

16 Minitab>Stat>ANOVA>One-Way
between within decision? ANOVA1

17 pi different ANOVA1

18 Statistics>Advanced Linear/Nonlinear Models>
>General Linear Models>One-way ANOVA ANOVA1

19 Summary tab: Descriptive cell statistics
Summary tab: Test all effects between within ANOVA1

20 Assumptions expected value of the ij experimental errors is zero
the ij experimental errors are independent both within groups (across j) and between groups (across i) the variance of experimental errors is constant the ij experimental errors follow normal distribution to be checked! In order to avoid misunderstanding for error variance will be used ANOVA1

21 experimental error (not just measurement error)
i-th level of the factor (i-th diet) j-th repetition in the i-th group Model experimental error (not just measurement error) measured value true value expected value ANOVA1

22 i effect of the i-th level (i-th diet)
means model i effect of the i-th level (i-th diet)  is a common value; r+1 parameters i=1,…,r sum to zero set to zero effects model ANOVA1

23 effect, only r-1 independent
Estimates grand mean effect, only r-1 independent group mean ANOVA1

24 Estimation =0 grand mean ANOVA1

25 effect, only r-1 of them are independentfüggetlen
mean of the i-th group ANOVA1

26 Fisher-Cochran-theorem
all ANOVA1

27 Summary tab: Coefficients
sum to zero sigma-restricted set to zero ANOVA1

28 Summary tab: Coefficients sigma-restricted
set to zero ANOVA1

29 Confidence interval for the expected value of group means
Point estimator: Interval estimator : degrees of freedom: Confidence interval for thee expected value of the i-th group: ANOVA1

30 ANOVA1

31 All of them are different?
rejected All of them are different? Comparisons: planned, post hoc ANOVA1

32 df would be only n2+n3-2=6+6-2=10 and pooling
df for is LSD test (Least Significant Difference) ANOVA1

33 cik contrast coefficients
Generalisation: (kth null hypothesis) cik contrast coefficients contrast c11=0, c21=1, c31=-1, c41=0 ANOVA1

34 orthogonal contrasts if kl independent comparisons
ANOVA1

35 ? ANOVA1

36 for a comparison α* (e.g. 0.05) (individual error rate)
comparisons (1-2, 1-3, 1-4, 2-3, 2-4, 3-4) for a comparison α* (e.g. 0.05) (individual error rate) not committing type I error: 1- α* not committing type I error at any of r independent comparisons: committing type I error at some comparison: (family error rate) e.g. ANOVA1

37 In case of non-independent comparisons
Bonferroni inequality e.g. for 6 non-independent comparisons 60.05=0.3 ANOVA1

38 Post hoc comparisons ANOVA1

39 B-A C-A D-A C-B D-B D-C ANOVA1

40 B-A C-A D-A C-B D-B D-C Minitab12

41 Post-hoc tab: Bonferroni
Post hoc comparisons Post-hoc tab: LSD Post-hoc tab: Bonferroni ·6= ANOVA1

42 Planned comparisons Planned comps tab: Specify contrasts
ANOVA1

43 ANOVA1

44 Calculate the effect estimates:
ANOVA1

45 ANOVA1

46 is rejected None of them are equal? further questions: ANOVA1

47 Click on the red triangle next to Oneway analysis,
choose Compare Means, Each Pair, Student’s t threshold in t (LSD) significant: C-A, C-D,... C and B are connected by A ANOVA1

48 Click on the red triangle next to Oneway analysis,
choose Compare Means, All Pairs, Tukey HSD more conservative (less easily states significance) ANOVA1

49 Power: probability of detecting an existing difference
Click on the red triangle next to Oneway analysis, choose Power If =2.5, with 20 experiments (5 for each diet) we will be able to detect Delta as large as 3 with 98.6% probability ANOVA1

50 E.g. if 1=-3, 2=3, 3= 4=0 ANOVA1

51 The size of detectable difference
Statistics>Power Analysis>Several Means, ANOVA 1-Way ANOVA1

52 E.g. if 1=-3, 2=3, 3= 4=0 ANOVA1

53 The size of detectable difference
Minitab>Power and Sample Size>One-Way ANOVA ANOVA1

54 Required sample size for detecting difference of 5 units
ANOVA1

55 Checking the assumption on homogeneity of variances
click on the red triangle, choose Unequal Variances p ANOVA1

56 Contrast analysis click LSMeans Contrast ANOVA1

57 A+, B+, C-, D- ANOVA1

58 Homogeneity of (within-group) variance
Minitab>Stat>ANOVA>Homogeneity of variance sensitive to the normaality assumption ANOVA1

59 Homogeneity of (within-group) variance
Minitab>Stat>ANOVA>Homogeneity of variance sensitive to the normality assumption ANOVA ANOVA

60 Checking residuals (Graphs) ANOVA ANOVA

61 ANOVA ANOVA

62 ANOVA ANOVA

63 ANOVA ANOVA

64 Homogeneity of variance
? More results>Assumptions tab: Homogeneity of variances ... Bartlett test sensitive to normality Levene test ANOVA1

65 Checking assumptions by examining the residuals
Residuals 1 tab Normality Pred & resids Predicted results (histogram) ANOVA1

66 Residuals 2 tab X: Order Y: Resids ANOVA1

67 Checking residuals Graphs>Four in One ANOVA1

68 Two-way ANOVA All levels of the first factor are combined with all levels of the second factor equal number of repetitions in each cell (balanced design). The structure of the design ensures the orthogonality. ANOVA1

69 Survival time of animals
Example 52 (Box-Hunter-Hunter: Statistics for Experimenters, J. Wiley, 1978, p. 228) Survival time of animals ANOVA1

70 ANOVA1

71 ANOVA1

72 poison (i) treatment (j)
i=1,…,r; j=1,…,q, k=1,…,p Model repetition (k) poison (i) treatment (j) means model (all are equal) ANOVA1

73 effect of the i-th poison j-th treatment interaction
Model effect of the i-th poison j-th treatment interaction effects model ANOVA1

74 The ANOVA Table 34(4-1)=36 ANOVA1

75 Open Data Table: poison.xls, (poison, treatment Nominal)
Analyze>Fit Model Y: survival Add: poison, treatment (Macros, Full factorial) Emphasis: Minimal Report N! ANOVA1

76 Click on the red triangle next to Response SURVIVAL,
choose Factor Profiling, Profiler and Interaction Plots ANOVA1

77 34(4-1)=36 ANOVA1

78 (r-1)(q-1)=(3-1)(4-1)=6 independent
r-1=3-1=2 independent q-1=4-1=3 independent (r-1)(q-1)=(3-1)(4-1)=6 independent ANOVA1

79 Minitab>Stat>ANOVA>Two-Way
poison.mtw Minitab>Stat>ANOVA>Two-Way ANOVA1

80 Minitab>Stat>ANOVA>Main Effects Plot

81 Minitab>Stat>ANOVA>Interactions Plot

82 Advanced Linear/Nonlinear Models>
Statistics> Advanced Linear/Nonlinear Models> >General Linear Models>Factorial ANOVA> Means tab: Observed, unweighted, Plot Summary tab: All effects ANOVA1

83 Checking the assumptions by plotting residuals
Click on the red triangle next to Response SURVIVAL, choose Row Diagnostics, Plot Residual by Predicted is not justified ANOVA1

84 Box-Cox transformation
Click on the red triangle next to Response SURVIVAL, choose Factor Profiling, Box-Cox Y transformation variance stabilising transformation ANOVA1

85 Homogeneity of variance
? More results>Assumptions tab: Homogeneity of variances sensitive to normality ANOVA1

86 Checking the assumptions by plotting residuals
Residuals1 tab: Pred. & resid. is not justified ANOVA1

87 Checking the assumptions by plotting residuals
satisfied? ANOVA1

88 ANOVA1

89 Box-Cox transformation
File>Open: (Program Files>StatSoft>Statistica8>Examples>Macros> >Analysis Examples>BoxCox) variance stabilising transformation ANOVA1

90 ANOVA1

91 if ANOVA1

92 straight line is fitted
ANOVA1

93 ANOVA1

94 New column: recsurv=1/survival Repeat the analysis not transformed
ANOVA1

95 Click on the red triangle next to Response SURVIVAL,
choose Save Columns, Residuals Analyze: Distributions, Normal Quantile Plot random fluctuation around the line: Normal ANOVA1

96 Minitab>Stat>Basic Statistics>Store Descriptive Statistics
Mean, Standard Deviation ANOVA1

97 ANOVA1

98 Minitab>Stat>Regression
ANOVA1

99 Box-Cox transformation
Minitab>Control Charts>Box-Cox transformation ANOVA1

100 ANOVA1

101 ANOVA1

102 ANOVA1

103 The effects are more convincing (F values are larger), p for interaction is 0.112 → 0.387
ANOVA1

104 The residuals ANOVA1

105 Minitab>Stat>ANOVA>Interactions Plot
y to 1/y Minitab>Calc Minitab>Stat>ANOVA>Interactions Plot ANOVA1

106 ANOVA1

107 Minitab>Stat>ANOVA>Two-Way

108 Checking residuals Graphs>Four in One ANOVA1

109 Comparisons Do Poisons 1 and 2 differ? Planned comparisons fülön
Compute ANOVA1

110 estimated effect ANOVA1


Download ppt "ANALYSIS OF VARIANCE (ANOVA)"

Similar presentations


Ads by Google