ANOVA

Explanation: one way Explanation: two way Calculation: one-way
Computation: one-way Computation: two-way


What is it?

An ANOVA (Analysis of Variance), sometimes called an F test, is closely related to the t test. The major difference is that, where the t test measures the difference between the means of two groups, an ANOVA tests the difference between the means of two or more groups.

A one-way ANOVA, or single factor ANOVA, tests differences between groups that are only classified on one independent variable. You can also use multiple independent variables and test for interactions using factorial ANOVA (see below). The advantage of using ANOVA rather than multiple t-tests is that it reduces the probability of a type-I error. Making multiple comparisons increases the likelihood of finding something by chance—making a type-I error. Let’s use socioeconomic status (SES) as an example. I have 8 levels of SES and I want to see if any of the eight groups are different from each other on their average happiness. In order to compare all of the means to each other, you would have to run 28 t tests. If your alpha is set at .05 for each test, times 28 tests, the new p is 1.4—you are virtually assured of making a type-I error. So, you across all those 28 tests you would find some significant differences between groups, but there are likely due to error. An ANOVA controls the overall error by testing all 8 means against each other at once, so your alpha remains at .05.

One potential drawback to an ANOVA is that you lose specificity: all an F tells you is that there is a significant difference between groups, not which groups are significantly different from each other. To test for this, you use a post-hoc comparison to find out where the differences are – which groups are significantly different from each other and which are not. Some commonly used post-hoc comparisons are Scheffe’s and Tukey’s.

(back to top)


Calculation (one way):

Computation by hand of a One-way ANOVA is tedious; computation of a two-way ANOVA is nearly impossible. Here is a general overview of how to do it:

Set up a data table to help keep track of the data

Col 1 Col 2 Col 3 Col 4 Col 5 Col 6
Group A data Group B data Group C data A^2 B^2 C^2
Sum A Sum B Sum C (sum A)^2 (sum B)^2 (sum C)^2
Mean A Mean B Mean C      


  1. Compute the total sum of squares (SST)
  2. Compute the between groups sum of squares (SSB)
  3. Compute the within groups sum of squares (SSW)
  4. Calculate the degrees of freedom for between groups:
    Df = number of groups – 1 = (N)
  5. Calculate the degrees of freedom for the total:
    Df = total participants – 1 = (D-1) = O
  6. Calculate the degrees of freedom for the within groups:
    Df = (df total – df between groups)
  7. Compute the mean squares for each (MSB, MSW)
  8. Compute the value for F by dividing the mean square for between groups by the mean square for within groups
  9. And finally: Determine whether F is significant:
    • The columns on the critical values table are labeled “degrees of freedom associated with the between groups degrees of freedom,” which, in this case, would be the N variable.
    • The rows are labeled “degrees of freedom associated with the within groups degrees of freedom. ”
    • Find the point at which these two values intersect. This is the critical value of F. If your value is greater than the critical value, reject the null hypothesis. If it is not, do not reject the null hypothesis

(back to top)


Computation:

Excel

  1. Enter data into data table. (see Excel Tutorial for help)
  2. Go to TOOLS > DATA ANALYSIS
  3. Select “ANOVA single”
  4. Enter input range—this will be all of your data (you can simply draw a box around your data table)
  5. Check how the data is grouped—probably by columns
  6. Check the box that says “labels in first row” if your columns are headed with anything (e.g. A1 says “age” and A2-30 has your participants’ ages)
  7. Set alpha (it’s preset to .05)
  8. Set output—where do you want your data to go? It can either go on the same sheet, on a different sheet, or in a whole new workbook.
  9. Hit “OK”

SPSS

  1. Enter data into data table. (see SPSS tutorial for help)
  2. Go to ANALYZE > COMPARE MEANS > ONE WAY ANOVA
  3. Enter dependent variable in Dependent List
  4. Enter independent variable in Factor
  5. Ignore Contrasts and Post-Hoc buttons
  6. Options:
    • Statistics: Descriptive (yes); Homogeneity of variance (no)
    • Means Plot (yes)
  7. Continue – OK
  8. Output:
    • (a) Descriptives (N, Mean, Std. Dev, etc)
      This will give you a chart that has the between groups and within groups sum of squares, the degrees of freedom, the mean squares, the F, and the significance.
  9. If the significance is less than .05, you may reject the null hypothesis

(back to top)


Factorial (two way) ANOVA

What is it?

A factorial ANOVA can examine data that are classified on multiple independent variables. For example, a two-way ANOVA (two factor ANOVA) can measure both the difference among treatments and among age of participants simultaneously. You can use more than two independent variables in an ANOVA (e.g., three-way, four-way).

A factorial ANOVA can show whether there are significant main effects of the independent variables and whether there are significant interaction effects between independent variables in a set of data. Interaction effects occur when the impact of one independent variable depends on the level of the second independent variable. Computation can be done on statistical software.

Example:

We wanted to see how studying method affected grades on a World Civilizations midterm for underclassmen and upperclassmen. Regardless of prior study preference, equal amounts of students were assigned randomly to one of the two categories. This is a two way ANOVA with two independent variables: Year in school (underclass versus upperclass) and Study type (along versus group). The dependent variable is grades (measured on a scale of 0 to 100)

  Type of studying
  Alone In a group Row Means
Underclassmen 85 88 86.5
Upperclassmen 90 86 88
Column means 87.5 87

It seems from this data that there is a main effect for type of studying, because on average the “alone” studiers scored higher (87.5) than the “group” studiers (87), and the upper classmen, on average, scored higher (88) than the underclassmen (86.5). There is also an interaction effect, because while the upperclassmen who studied alone scored an average of five points higher than underclassmen who studied alone, upperclassmen who studied in a group scored an average of two points lower than underclassmen who studied in a group. The effect of Year in school on grades depends on type of studying.

A two-way ANOVA would test whether the possible main effects and interaction effects are statistically significant—that the results aren’t from sampling error alone.

(back to top)


Computation:

Excel

  1. Enter data into data table
  2. Go to TOOLS > DATA ANALYSIS and select Anova: two factor without replication
  3. Highlight the data you're looking at and check "labels" if necessary
  4. Check the "new worksheet ply" box and hit OK
  5. The results will show up on a new spreadsheet

SPSS

  1. With your data entered, go to ANALYZE > GENERAL LINEAR MODEL > UNIVARIATE
  2. Enter dependent variable in Dependent List
  3. Enter independent variables in Factor
  4. Continue – OK
  5. Output:
    (A) Descriptives (N, Mean, Std. Dev., etc)

This will give you a table. On the right hand side, the significances will be listed, along with the F values. On the far left side, under the column “source,” your variables will be listed. The corresponding F values and significances are for main effects and interaction effects. If the significance reading is less than .05, you are able to reject the null hypothesis.

(back to top)

Back to Inferential Statistics

References:

Patten, Mildred L. (2002). Understanding research methods: An Overview of the essentials (3rd ed.). Los Angeles: Pyrczak Publishing.

Pavkov, Thomas W., & Pierce, Kent A. (2003). Ready, set, go! A Student guide to SPSS(R) 11.0 for Windows. Boston: McGraw-Hill.

Pyrczak, Fred. (2002). Success at statistics: A Worktext with humor (2nd ed.). Los Angeles: Pyrczak Publishing.

Solso, Robert L., Johnson, Homer H., & Beal, M. Kimberly. (1998). Experimental psychology: a case approach (6th ed.). New York: Longman.

Yates, Daniel, Moore, David, & McCabe, George. (1999). The Practice of statistics: TI-83 graphing calculator enhanced . New York: W.H. Freeman and Company.