ANOVA Test compares three or more groups or Analysis of ...

Post on 02-Jun-2022

2 views 0 download

Transcript of ANOVA Test compares three or more groups or Analysis of ...

1

Analysis of Variance (ANOVA)

Two types of ANOVA tests: Independent measures and Repeated measures

ANOVA Test compares three or more groups or conditions. Focuses on variances instead of means.

Comparing 2 means:

Comparing 3 means (??):

For ANOVA we work with variance (in place of SD used in t-tests)

X 1 = 20X 2 = 30

X 1 = 20X 2 = 30X 3 = 35

Effect of fertilizer on plant height (cm)

Population of seeds

Randomly select

40 seeds

HEI

GH

T of

pla

nt (C

m)

No Fertilizer

10 gm Fertilizer

20 gm Fertilizer

30 gm Fertilizer

(too much of a good thing)

Why use ANOVA: (a) ANOVA can test for trends in our data. (b) ANOVA is preferable to performing many t-tests on the same data (avoids increasing the risk of Type 1 error).

Suppose we have 3 groups. We will have to compare:

group 1 with group 2 group 1 with group 3 group 2 with group 3

Each time we perform a test there is (small) probability of rejecting the true null hypothesis. These probabilities add up. So we want a single test. Which is ANOVA.

2

(c) ANOVA can be used to compare groups that differ on two, three or more independent variables, and can detect interactions between them.

scor

e (e

rror

s)

Age-differences in the effects of alcohol on motor coordination:

Alcohol dosage (number of drinks)

Independent-Measures ANOVA:

Each subject participates in only one condition in the experiment (which is why it is independent measures).

An independent-measures ANOVA is equivalent to an independent-measures t-test, except that you have more than two groups of subjects.

Logic behind ANOVA: Example

Effects of caffeine on memory:

Four groups - each gets a different amount of caffeine, followed by a memory test. Variation in the set of scores comes from TWO

sources:

• Random variation from the subjects themselves (due to individual variations in motivation, aptitude, mood, ability to understand instructions, etc.)

• Systematic variation produced by the experimental manipulation.

3

Random variation

Systematic variation

+ Random variation

Large value of F: a lot of the overall variation in scores is due to the experimental manipulation, rather than to random variation between subjects.

Small value of F: the variation in scores produced by the experimental manipulation is small, compared to random variation between subjects.

systematic variation random variation (‘error’) F =

ANOVA compares the amount of systematic variation to the amount of random variation, to produce an F-ratio:

Analysis of variance implies analyzing or breaking down variance. We start by breaking down ‘Sum of Squares’ or SS.

sum of squares

= (X − X )∑2

We divide SS by the appropriate "degrees of freedom" (usually the number of groups or subjects minus 1) to get variance.

9 calculations

3 3

1 1

1

4

step 1 The null hypothesis:

H0 :µ1 = µ2 = µ3 = µ4

steps 2, 3 & 4 Calculate 3 SS values:

1) Total 2) Within Groups 3) Between Groups

No treatment effect α = .05

Total SS

Three types of SS

= (Xi −G )2∑

step 2

G = 9.5

SSTotal = 297

Within groups SS step 3

SS1 = (Xi − X 1)2∑

SS2 = (Xi − X 2)2∑

SS3 = (Xi − X 3)2∑

SS4 = (Xi − X 4 )2∑

X 1 = 4

X 2 = 9

X 3 =12

X 4 =13

SSwithin groups= 52

Between groups SS

X 1

step 4

X 2

X 3

X 4SSbetween groups

= n (X 1 −G )2 + (X 2 −G )2 + (X 3 −G )2 + (X 4 −G )2[ ]

SSbetween groups= 245

5

Calculating df (total, within groups and between groups)

dftotal = All scores – 1 = 19

dfwithin groups= df1 + df2 + df3 + df4 = 16

dfbetween groups = Number of groups – 1 = 3

step 5

The ANOVA summary table:

Source: SS df MS F Between groups 245.00 3 81.67 25.13 Within groups 52.00 16 3.25 Total 297.00 19

(Total SS) = (Between-groups SS) + (Within-groups SS)

(total df) = (between-groups df ) + (within-groups df )

step 6 Calculating the Within groups and Between

groups Variance or Mean squares (MS)

Computing F and Assessing its significance:

The bigger the F-ratio, the less likely it is to have arisen merely by chance.

Use the between-groups and within-groups df to find the critical value of F.

Your F is significant if it is equal to or larger than the critical value in the table.

step 7

F = MSbetween groups

MSwithin groups

Here, look up the critical F-value for 3 and 16 df

Columns correspond to between-groups df; rows correspond to within-groups df

Here, go along 3 and down 16: critical F is at the intersection.

Our obtained F = 25.13, is bigger than 3.24; it is therefore significant at

p < .05

6

Interpreting the Results: A significant F-ratio merely tells us is that there is a statistically-significant difference between our experimental conditions; it does not say where the difference comes from.

In our example, it tells us that caffeine dosage does make a difference to memory performance.

BUT suppose the difference is ONLY between: Caffeine VERSUS No-Caffeine

AND There is NO difference between: Large dose of Caffeine VERSUS Small Dose of Caffeine

To pinpoint the source of the difference we can do:

(a) planned comparisons - comparisons between (two) groups which you decide to make in advance of collecting the data.

(b) post hoc tests - comparisons between (two) groups which you decide to make after collecting the data: Many different types - e.g. Newman-Keuls, Scheffé, Bonferroni.

Assumptions underlying ANOVA:

ANOVA is a parametric test (like the t-test)

It assumes:

(a) data are interval or ratio measurements;

(b) conditions show homogeneity of variance;

(c) scores in each condition are roughly normally distributed.

Using SPSS for a one-way independent-measures ANOVA on effects of alcohol on time taken on a motor task.

Three groups:

Group 1: two drinks Group 2: one drink Group 3: no alcohol

7

Data Entry

RUNNING SPSS (Analyze > compare means > One Way ANOVA)

8

Click ‘Options…’ Then Click Boxes: Descriptive; Homogeneity of variance test; Means plot

SPSS output

Trend tests:

(Makes sense only when levels of IV correspond to differing amounts of something - such as caffeine dosage - which can be meaningfully ordered).

Linear trend: Quadratic trend:

(one change in direction)

Cubic trend: (two changes in direction)

With two groups, you can only test for a linear trend. With three groups, you can test for linear and quadratic trends. With four groups, you can test for linear, quadratic and cubic trends.

9

Conclusions:

One-way independent-measures ANOVA enables comparisons between 3 or more groups that represent different levels of one independent variable.

A parametric test, so the data must be interval or ratio scores; be normally distributed; and show homogeneity of variance.

ANOVA avoids increasing the risk of a Type 1 error.

New online course evalua/on ques/onnaires 

Please take a few minutes to give us your feedback on your Spring Term Courses. 

Opens:   February 26th 2010 Closes:   March 19th 2010  

Access them via your Course Resources page in Sussex Direct. 

Completely anonymous. 

Your feedback provides invaluable informa/on to guide tutors in teaching and course development.