C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null...

30
C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture • Partitioning Evaluating the Null Hypothesis • ANOVA • Basic Ratios • Sums of Squares • Mean Squares • Degrees of Freedom • F-Ratio Evaluating the F-Ratio Analytical Comparisons

Transcript of C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null...

Page 1: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 1

Overview of Lecture

• Partitioning

• Evaluating the Null Hypothesis

• ANOVA

• Basic Ratios

• Sums of Squares

• Mean Squares

• Degrees of Freedom

• F-Ratio

• Evaluating the F-Ratio

• Analytical Comparisons

Page 2: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 2

Partitioning the Deviations

0 2 4 6 8 10

AS25 A2 T

AS25 - A2 A2 - T

AS25 - T

Within Subjects deviation

Between Subjects deviation

Page 3: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 3

Evaluating the Null Hypothesis

• If we consider the ratio of the between groups variability and the within groups variability

• Then we have

Differences among treatment means

Difference among subjects treated alike

Experimental Error + Treatment Effects

Experimental Error

Page 4: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 4

Evaluating the Null Hypothesis

• If the null hypothesis is true then the treatment effect is equal to zero:

• If the null hypothesis is false then the treatment effect is greater than zero:

Experimental Error + 0

Experimental Error=1

Experimental Error + Treatment Effects

Experimental Error>1

Page 5: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 5

ANOVA

• Analysis of variance uses the ratio of two sources of variability to test the null hypothesis

• Between group variability estimates both experimental error and treatment effects

• Within subjects variability estimates experimental error

Page 6: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 6

From Deviations to Variances

• In order to evaluate the null hypothesis, it is necessary to transform the between group and within-group deviations into more useful quantities, namely, variances.

• For this reason the statistical analysis involving the comparison of variances reflecting different sources of variability is called the analysis of variance.

• For the purposes of analysis of variance a variance is defined as follows

Variance =Sum of Squared Deviations from the Mean

Degrees of Freedom

Page 7: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 7

The Sums of Squares

• From the basic deviations

• A similar relationship holds for the sum of squares

• In other words

ASij −T = (ASij

− A i )+(A i −T )

ASij −T( )∑2

= ASij − Ai( )∑2

+ Ai −T( )∑2

SStotal = SSwithin +SSbetween

Page 8: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 8

Example Data

Basic Scores

or

Observations

Treatment Sums

Treatment Means

Grand Sum

FACTOR A

Level

AS11

=16

AS12

=18

AS13

=10

AS14

=12

AS15

=19

=75

= 15

= 75 + 30 + 45

= 150

Level

AS21 =4

AS22 =6

AS23 =8

AS24 =10

AS25=2

=30

= 6

Grand Mean

Level

AS31 =2

AS32 =10

AS33=9

AS34=13

AS35=11

=45

= 9

= 10

IV: Lecturer, DV: Exam Score

Page 9: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 9

Basic Ratios:

• A Basic Ratio is defined as:

• The numerator term for any basic ratio involves two steps:• the initial squaring of a set of quantities• summing the squared quantities if more than one is

present.• The denominator term for each ratio is the number of items

that contribute to the sum or score.• Basic Ratios make the calculation of the sum of squares

relatively simple

(score or sum)2

divisor∑

Page 10: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 10

The Notation for Basic Ratios

• To emphasise the critical nature of these basic ratios, we will use a distinctive symbol to designate basic ratios and to distinguish among them

[AS]

[A]

[T]

Special Code Score or Sum

AS (the basic observations or scores)

A (the treatment sums)

T (the grand sums)

Page 11: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 11

Calculating the Basic Ratios

• Starting with the basic score, AS, and substituting into the formula for basic ratios:

• The second basic ratio involves the sums of the treatment conditions.

• The final basic ratio we require involves the grand sum.

[AS] =AS( )

2

1∑ =162 +182 +102 +....+ 92 +132 +112 =1880

[A] =A( )

2

s∑ =

152 + 62 + 92

5=1710

[T ] =T( )

2

as∑ =

1502

(3)(5)=1500

Page 12: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 12

Calculating the Sums of Squares

• The sums of squares can be calculated by combining these basic ratios.

• Total Sum of Squares

• Between Group Sum of Squares

• Within Group Sum of Squares

[AS]−[T ] =1880 −1500 = 380

[A]−[T ] =1710 −1500 = 210

[AS]−[A] =1880 −1710 =170

Page 13: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 13

Variance Estimates: Mean Squares

• The ratio we are interested in is the ratio of the between groups variability and the within groups variability

• In this context, the variability is defined by the equation.

• where SS refers to the component sums of squares and df represent the degrees of freedom associated with the SS.

SSdf

Page 14: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 14

Degrees of Freedom

• The degrees of freedom associated with a sum of squares correspond to the number of scores with independent information which enter into the calculation of the sum of squares.

• Degrees of freedom are the number of observations that are free to vary when we know something about those observations.

Page 15: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 15

Degrees of Freedom

• The Between Group Degrees of Freedom

• The Within Group Degrees of Freedom

• The Total Degrees of Freedom

dfA = a−1= 3−1= 2

dfS /A = as− a = a(s−1) = 3(5 −1) =12

dfT = as−1= (3)(5)−1=14

Page 16: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 16

Mean Squares

• The Between Group Mean Square

• The Within Group Mean Square

MSA =SSAdfA

=210

2=105

MSS /A =SSS /A

dfS /A

=17012

=14.17

Page 17: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 17

The F-Ratio

• The F-Ratio is defined as

F =MSAMSS /A

=105

14.17= 7.41

Page 18: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 18

The Anova Summary Table

• The results of the Anova are usually displayed by computers programs in a summary table:

A

S/A

Total

Source SS df Mean Square F ratio

210

170

380

2

12

14

105

14.17

7.41

Page 19: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 19

Testing the Null Hypothesis

• In order to decide whether or not the null hypothesis is rejected we need to find out what value of F is necessary to reject the null hypothesis.

• There is a simple rule for this.

• Reject H0 when Fobserved> Fcritical otherwise do not reject H0

• We obtain a value for Fcritical by looking it up in the F tables.

Page 20: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 20

The Critical F-Value

• To find the critical value

• Take the degrees of freedom for the effect (A) and look along the horizontal axis of the F table.

• Take the degrees of freedom for the error term (S/A) and look down the vertical axis of the F table.

• The place were the column for the degrees of freedom of the effect A meets the row for the degrees of freedom of the error (S/A) is the critical value of F.

• For these data Fcritical =3.89 so we can reject the null hypothesis

Page 21: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 21

The Omnibus F

• The F-ratio includes information about all the levels of the independent variable that we have manipulated.

• The F-ratio for an overall difference between the means as reported in the ANOVA summary table is known as the Omnibus F-ratio.

• The best the Omnibus F-ratio can tell us is that there are differences between the means.

• It cannot tell us that what those differences are.

Page 22: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 22

Analytical Comparisons

• With a nonsignificant omnibus F we are prepared to assert that there are no observed differences among the means.

• We can stop the analysis there.

• A significant omnibus F demands further analysis of the data.

• Which differences between the means are real and which are not?

Level a1 Level a2 Level a34

6

8

10

12

14

16

Mean Score

Factor A

Page 23: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 23

Analytical Comparisons

• There are two basic approaches to solving the problem.

• Before we set out to collect the data, we could have made specific predictions about the direction of the effects

• In this case we can use a technique known as planned (a priori) comparisons.

• We might have designed an experiment where we couldn't be precise enough to say what the differences would be.

• In this case we use post hoc (after the event) comparisons.

Page 24: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 24

Planned (A Priori) Comparisons

• For example, assume the three levels of the independent variable are lecturer style:

• A1: Lectures with worksheets.

• A2: Lectures only.

• A3: No lectures, only worksheets.

• From previous research, we anticipate that A1 > A2, A1 > A3 (we are making no predictions about A2 vs A3).

• Does the data support this?

Page 25: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 25

Differences as the sum of weighted means

• Let us adopt the symbol to represent the difference we are interested in:

A1 – A2

• We can rewrite this as:

1 A1 +(–1) A2

• Including all the means in the experiment:

1 A1 +(–1) A2 +(0) A3

Page 26: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 26

Sum of Squares for a planned comparison

• Planned comparisons are based on the calculation of an F-ratio.

• This requires us to calculate the variability inherent in the comparison

• We calculate a sum of squares associated with the comparison. This is given by:

SSAcomp =n ( )2

c2∑

= the difference between the compared means

n= the number of subjects that contribute to the mean

c= the coefficient with which we weight the mean

Page 27: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 27

Sum of Squares of a planned comparison

• The sum of squares of the comparison is given by

SSAcomp =n ( )2

c2∑

SSAcomp=5 (1)(15) + (−1)(6) + (0)(9)( )2

(1)2 +(−1)2 + (0)2

SSAcomp=5 9( )2

2=202.5

Page 28: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 28

Testing the planned comparison

• A F ratio is calculated to test the comparison. For this a mean square is required.

• The mean square for the comparison is calculated by:

• All planned comparisons have on 1 degree of freedom.

• The F-ratio is calculated by:€

MSAcomp =SSAcompdfAcomp

=SSAcomp

1= 202.5

FAcomp =MSAcompMSS /A

=202.514.17

=14.29

Page 29: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 29

Evaluating the planned comparison’s null hypothesis

• Critical F's for comparisons use the degrees of freedom for the numerator and the denominator of the F-ratio.

• There are 1 and 12 degrees of freedom for this comparison.

• Fcritical(1, 12) for p≤0.05=4.75

• Given that Fobservedl=14.29, we can reject the null hypothesis and conclude that A1 (lectures with worksheets) leads to better scores than A2 (lectures only).

Page 30: C82MST Statistical Methods 2 - Lecture 3 1 Overview of Lecture Partitioning Evaluating the Null Hypothesis ANOVA Basic Ratios Sums of Squares Mean Squares.

C82MST Statistical Methods 2 - Lecture 3 30

Next Week

• Post hoc comparisons

• Testing the assumptions that underlie ANOVA

• Two computer programs for analysing a one-way between groups analysis of variance