Presentation is loading. Please wait.

Presentation is loading. Please wait.

Comparing Several Means: ANOVA

Similar presentations


Presentation on theme: "Comparing Several Means: ANOVA"— Presentation transcript:

1 Comparing Several Means: ANOVA
Understand the basic principles of ANOVA Why it is done? What it tells us? Theory of one-way independent ANOVA Following up an ANOVA: Planned contrasts/comparisons Choosing contrasts Coding contrasts Post hoc tests Slide 1

2 When and Why When we want to compare means we can use a t-test. This test has limitations: You can compare only 2 means: often we would like to compare means from 3 or more groups. It can be used only with one predictor/independent variable. ANOVA Compares several means. Can be used when you have manipulated more than one independent variable. It is an extension of regression (the general linear model). Slide 2

3 ANOVA Fisher: British statistician and geneticists. Introduced this analysis Let us assume that we test four different feeds and want to see if the body weights in pigs changes using the different feeds. We are going to test the effect of one factor – feed type. The analysis is termed a one-factor test or one-way ANOVA. A population of pigs is assigned, at random to each of the four treatments. To be specific there are four treatment levels. Parametric test

4 Why Not Use Lots of t-Tests?
If we want to compare several means why don’t we compare pairs of means with t-tests? Can’t look at several independent variables Inflates the Type I error rate Type one error rate = 1 – 0.95n

5 What Does ANOVA Tell Us? Null hypothesis: Experimental hypothesis:
Like a t-test, ANOVA tests the null hypothesis that the means are the same. Experimental hypothesis: The means differ. ANOVA is an omnibus test It test for an overall difference between groups. It tells us that the group means are different. It doesn’t tell us exactly which means differ. Slide 5

6 What Does ANOVA Tell Us? If H0 is rejected, there is al least one difference among the four means.

7 ANOVA as Regression

8 Placebo Group

9 High Dose Group

10 Low Dose Group

11 Output from Regression

12 Experiments vs. Correlation
ANOVA in regression: Used to assess whether the regression model is good at predicting an outcome. ANOVA in experiments: Used to see whether experimental manipulations lead to differences in performance on an outcome. By manipulating a predictor variable can we cause (and therefore predict) a change in behavior? Same question is of interest in regression and experimental maniupulations: In experiments we systematically manipulate the predictor, in regression we don’t. Slide 12

13 Theory of ANOVA We calculate how much variability there is between scores Total sum of squares (SST). We then calculate how much of this variability can be explained by the model we fit to the data How much variability is due to the experimental manipulation, model sum of squares (SSM)... … and how much cannot be explained How much variability is due to individual differences in performance, residual sum of squares (SSR). Slide 13

14 Theory of ANOVA We compare the amount of variability explained by the model (experiment), to the error in the model (individual differences) This ratio is called the F-ratio. If the model explains a lot more variability than it can’t explain, then the experimental manipulation has had a significant effect on the outcome. Slide 14

15 Theory of ANOVA If the experiment is successful, then the model will explain more variance than it can’t SSM will be greater than SSR Slide 15

16 ANOVA by Hand Testing the effects of Viagra on libido using three groups: Placebo (sugar pill) Low dose viagra High dose viagra The outcome/dependent variable (DV) was an objective measure of libido. Slide 16

17 The Data Slide 17

18

19 Step 1: Calculate SST ** where the mean is the grand mean

20 Total Sum of Squares (SST):
Grand Mean Slide 20

21

22 SST = sum((observed – Grand Mean)2)
SST = S2(N-1)

23 Degrees of Freedom Degrees of freedom (df) are the number of values that are free to vary. In general, the df are one less than the number of values used to calculate the SS. DFTotal = N - 1 Slide 23

24 Model Sum of Squares (SSM):
Difference between the model estimate and the mean (or “Grand Mean”)

25 Model Sum of Squares (SSM):
Grand Mean Slide 25

26 Step 2: Calculate SSM Slide 26

27 Model Degrees of Freedom
How many values did we use to calculate SSM? We used the 3 means. Slide 27

28 Residual Sum of Squares (SSR):
Grand Mean Df = 4 Slide 28

29 Step 3: Calculate SSR SSR = sum([xi – xi]2)

30 Step 3: Calculate SSR 2.5 Slide 30

31 Residual Degrees of Freedom
How many values did we use to calculate SSR? We used the 5 scores for each of the SS for each group. Slide 31

32 Double Check SST = SSR + SSM 43.74 = 20.14 + 23.60 DFT = DFR + DFM
14 = Slide 32

33 Step 4: Calculate the Mean Squared Error
Slide 33

34 Step 5: Calculate the F-Ratio
Slide 34

35 Step 6: Construct a Summary Table
Source SS df MS F Model 20.14 2 10.067 5.12* Residual 23.60 12 1.967 Total 43.74 14 Slide 35

36 Multiple-comparison tests
The anova that you examined is used to test the hypothesis that there is no difference in the sample means among k treatment levels However we cannot conclude, after doing the test, which of the mean values are different from one-another.

37 Tukey Test Tukey test – balanced, orthogonal designs
Step one: is to arrange and number all five sample means in order of increasing magnitude Calculate the pairwise difference in sample means. We use a t-test “analog” to calculate a q-statistic

38 Tukey Test S2 is the error mean sqare by anova computation
n is the of data in each of groups B and A Remember this is a completely balanced design.

39 Tukey Test Start with the largest mean, vs. the smallest mean. Then when the first largest mean has been compared with increasingly large second means, use the second largest mean. If the null hypothesis is accepted between two means then all other means within that range cannot be different.


Download ppt "Comparing Several Means: ANOVA"

Similar presentations


Ads by Google