anova step by step

7
ANOVA STEP-BY-STEP The Sums of Squares : 1) Computing SS total : The SS total is the SS based on the entire set of scores in the study. So computing this SS is the same as if you just stacked your different treatment samples together to form a single sample and then computed the Sum of Squares on that one larger sample. In terms of our new notation: So for the Alcohol data, you first need to make X 2 columns for each of the treatment levels, then add up the columns and then add the three ΣX 2 's together. Then you subtract G 2 /N: 1oz X 2 3oz X 2 5oz X 2 0 0 2 4 4 16 1 1 3 9 6 36 0 0 0 0 3 9 2 4 3 9 2 4 1 1 1 1 3 9 4 6 9 23 18 74 k = 3, n = 5, N = 15, T 1 = 4, T 2 = 9, and T 3 = 18, and G = 31 ΣX 2 = sum of the ΣX 2 for each level of the factor = 6 + 23 + 74 = 103 So SS total = 103 - 31 2 = 103 - 961/15 = 38.933 15 2) Computing SS within : PSY295-001 1 of 7 Spring 2003

Upload: sami119

Post on 20-Apr-2017

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ANOVA Step by Step

ANOVA STEP-BY-STEP

The Sums of Squares: 1) Computing SStotal: The SStotal is the SS based on the entire set of scores in the study. So computing this SS is the same as if you just stacked your different treatment samples together to form a single sample and then computed the Sum of

Squares on that one larger sample. In terms of our new notation:So for the Alcohol data, you first need to make X2 columns for each of the treatment levels, then add up the columns and then add the three ΣX2 's together. Then you subtract G2/N:

1oz X 2 3oz X 2 5oz X 2 0 0 2 4 4 16 1 1 3 9 6 36 0 0 0 0 3 9 2 4 3 9 2 4 1 1 1 1 3 9 4 6 9 23 18 74

k = 3, n = 5, N = 15, T1 = 4, T2 = 9, and T3 = 18, and G = 31 ΣX2 = sum of the ΣX2 for each level of the factor = 6 + 23 + 74 = 103

So SStotal = 103 - 31 2 = 103 - 961/15 = 38.933 15

2) Computing SSwithin:

To compute SSwithin you first need to compute the SSwithin each level of the IV using the regular SS formula:

Then to get SSwithin you simply add up the SS from within each level of the IV:SSwithin = ΣSS

PSY295-001 1 of 4Spring 2003

Page 2: ANOVA Step by Step

ANOVA STEP-BY-STEP

So for the Alcohol data there are three SS you need to compute first, one for each level:

SS1 = 6 - 42/5 = 2.800 SS2 = 23 - 92/5 = 6.800 SS3 = 74 - 182/5 = 9.200

Then you add these three SS up to get SSwithin:

SSwithin = 2.800 + 6.800 + 9.200 = 18.800

3) Computing SSbetween:

Recall that the variance between treatments measures the differences or variancebetween the treatment means. This implies one way we could find the SSbetween would be to compute a SS using the X's as the scores. That is, we could consider our deviations (that we will square and sum) as the deviation of each individual mean from the grand mean (the grand mean is the over all mean of the entire set of data or G/N). Of course, there is a computational formula that looks different from that, but is much easier to use:

So for the Alcohol data,

SSbetween = (42/5 + 92/5 + 182/5) - 312/15 = 84.2 - 64.067 = 20.133

Note: You should Always check to see if: SStotal = SSbetween + SSwithin If this check does not come out right - you have made a mistake in your calculations.

So for the Alcohol data:

Does 20.133 + 18.8 = SStotal? Yes 38.933 = 38.933.

PSY295-001 2 of 4Spring 2003

Page 3: ANOVA Step by Step

ANOVA STEP-BY-STEP

In computing the degrees of freedom, you should keep in mind that:

1) Each df is associated with a specific SS2) The df are approximately equal to the number of items that went into computing the corresponding SS minus 1. So if n things went in, then df = n - 1.

Computing the df:Because SStotal was computed using the entire set of N scores.

So for the Alcohol study, dftotal = 15 - 1 = 14

2) dfwithin = N - k To get the SSwithin we first computed the SS for each level and then added them up. This is the same for dfwithin in a sense. For each level we have "n - 1" degrees of freedom. Then we sum those n - 1 degrees of freedom across the levels: (n - 1) + (n - 1) + (n - 1) + ... If you simplify this, you get N - k which is the right number for the dfwithin.

So for the Alcohol study, dfwithin = 15 - 3 = 12. 3) dfbetween = k - 1 Because SSbetween is really based on the deviations of each treatment mean from the grand mean, the number of items in this SS is the number of treatment means = k. So the dfbetween = k - 1.

So for the Alcohol study, dfbetween = 3 - 1 = 2.

Note: You should Always check to see if: dftotal = dfbetween + dfwithin

If this check does not come out right - you have made a mistake in your calculations.

For the Alcohol study: does 2 + 12 = dftotal? Yes 14 = 14!

So now we have the 3 SS and the corresponding 3 df. What we need now is to compute the variances.

PSY295-001 3 of 4Spring 2003

Page 4: ANOVA Step by Step

Computing the between and within variances:Recall that a variance is SS/df. In Anova the variances we compute are called Mean Squares, symbolized "MS" (Because they are essentially mean squared deviations)

So we can compute:

MSbetween = SSbetween = the variance between treatments dfbetween

and

MSwithin = SSwithin = the variance within treatments dfwithin

So for the Alcohol study,

MSbetween = 20.133/2 = 10.067

MSwithin = 18.800/12 = 1.567

Note: In general we do not compute MStotal. Also, it is NOT TRUE that MStotal = MSbetween + MSwithin.

Finally, because the F test is the variance between divided by the variance within, we get our F-ratio:

F = MSbetween

MSwithin

So for the Alcohol study, F = 10.067/1.567 = 6.426.

Finally, you should always present what is called an Anova Summary Table that contains the results of all of these calculations. It should look like:

Source SS df MS F_____________________________________________________________Between 20.133 2 10.067 6.426Within 18.800 12 1.567Total 38.933 14

_____________________________________________________________