KNOWLEDGEBASE - ARTICLE #1746

Prism 3 -- Two way ANOVA

Last modified September 8, 2011

Step-by-Step Examples:
Two-Way ANOVA with Post Tests in Prism 3

Two-way analysis of variance may be used to examine the effects of two categorical variables (factors), both individually and together, on an experimental response. Suppose you've studied the effects on heart rate of three experimental treatments (factor 1) before and during exercise (factor 2). Two-way ANOVA, in combination with post testing, can answer the following questions:

  • Is there an effect of treatment on heart rate?
  • Is there an effect of exercise on heart rate?
  • Is there interaction between the factors? That is, does the affect of treatment differ between exercise states, or equivalently, does the effect of exercise differ among treatments?
  • At which treatments is there a significant difference between exercise levels?

To learn more about two-way analysis of variance, consult Analyzing Data with GraphPad Prism (pdf) . If you have only two data groups to compare, try the step-by-step example on t tests. If you have more than two groups, but the data are grouped by two factors, refer to step-by-step on one-way ANOVA.

Enter the Data
When you launch Prism, the Welcome to Prism dialog appears. Choose to Create a new project and to Work independently. Uncheck the option box at the bottom of the Welcome dialog to Pop up new user hints.

Data entry for two-way ANOVA in Prism differs from that in most other statistics programs. Other programs require you to enter data in a three-column indexed format-all measurements in one column, and the levels of the two factors in two parallel columns. With Prism, you enter your data onto a table as you'd normally illustrate the results, with the row-and-column position of each datum indicating the factor level.

In the lower half of the Welcome dialog, tell Prism how to format your data table. For the X column, select Text (bar graph). For the Y columns, choose 3 replicates to calculate error bars.

When you leave this dialog box, Prism displays the formatted table. Enter the data as shown below:

Although we instructed Prism to format the table for "3 replicates", in this example, the values in subcolumns Y1, Y2, and Y3 are matched measurements, not simple replicates (we'll indicate that when we enter the two-way ANOVA analysis parameters later). This affects Prism's tolerance for missing values:

  • If you request ordinary two-way ANOVA (no matching), Prism will work even if some values are missing. But you must have at least one value for each condition in each row. For example, if your data table is formatted for triplicate values (as in the example), you can't leave all three values empty.
  • If you specify repeated-measures two-way ANOVA (row or column matching), Prism will not allow any missing values.

You could format the Y columns for entry of mean, either standard deviation or standard error, and N (unless you want to do repeated-measures analysis, in which case you must provide individual replicate measurements).

Click on the yellow Graphs on the toolbar to view the bar chart that Prism has produced automatically.

Note that the error bars on this graph will show standard error (SEM) rather than standard deviation (SD) if that is the default setting in Prism (check this by choosing Tools.. Graph Options..). If you don't want to change the default setting to SD error bars but you do want the error bars to show SD on this graph, double-click on one of the bars to open the Format Bars dialog. Check the box labeled All, and choose to use SD as error values.

Choose the Analysis and the Options
Click on the yellow Data tab to return to the data table. Click Analyze. In the Analyze Data dialog, select Statistical Analyses and Two-way ANOVA. Accept the default setting to analyze All data sets.

If you have three or more data sets, you can choose to limit the analysis to only some of the data sets by choosing Selected data sets and clicking Select to open the Select Data Sets dialog and tell Prism which sets to analyze. In fact, you must choose two data sets at this point if you wish to do a Bonferroni post test.

If you later change your mind about which data sets to analyze, click the Change button and choose Data Analyzed....

In the Parameters: Two-way Analysis of Variance dialog box, enter names for the factors (variable names) defining the columns and the rows. This step is optional-it doesn't affect the computations, it just makes the output easier to follow.

Now tell Prism whether or not you have repeated measures, and if so, whether the measurements are repeated row-wise or column-wise. We'll assume that subjects were assigned to only one of the three treatment groups (None, Lesioned, Lesioned plus drug treated) but that measurements were made on each subject both before and during exercise. This is matching by row—the value in column A, Y1 was obtained from the same subject as the value in column B, Y1.

The dialog setting is...

Note that the Repeated Measures section will be greyed-out if you do not provide individual replicate values.

Finally, select the Bonferroni post-test option (this option won't be available unless you have chosen to analyze only two columns).

You can get more help with these settings by clicking Help me decide at the bottom of the Parameters dialog box.

View the Results
When you leave the Parameters dialog, Prism runs the analysis. The Results page for this example consists of two "views" (you can switch between views by changing the setting in the View drop-down box on the toolbar, and you can get help understanding the results by clicking the Interpret button.

Prism displays the Tabular results view first, indicating significant effects of both exercise and treatment, and interaction between the two factors (the effect of one factor is influenced by the level of the other factor, e.g., the difference in heart rate before exercise and heart rate during exercise is not the same with all treatments).

The results show that, in this case, matching of subjects was not effective in controlling for variability between subjects. If you click the Interpret button and request information on subject matching-choose How to think about results from two-way ANOVA...Subject (matching)—Prism advises you to reconsider using repeated-measures ANOVA.

Further down the "Tabular results" view, the ANOVA table is presented...

...as well as the post test results.

For an easy-to-understand synopsis of the results, switch to the Narrative results view.

Here's a partial illustration of the narrative:

The narrative points out the "extremely significant" interaction (very small interaction P value), which makes the P values for factor (row and column) effects hard to interpret. It is particularly worthwhile in that case to investigate the results of the post tests. If the interaction P value had been high, suggesting a consistent difference from before to during exercise among all treatments, the post tests would not have been very helpful.

If Prism cannot do the analysis (e.g., you request a repeated-measures analysis, but data are missing from one or more cells), the Tabular results view is empty, and you can read an explanation in the Commentary view.

While Prism makes two-way ANOVA very simple, it does not offer all the options of a high-end statistics program. Specifically, Prism cannot do the following:

  • Two-way nonparametric ANOVA
  • Post testing between row means
  • Post testing between column means
  • Post testing between cells when there are more than two columns

Copyright (c) 2002, GraphPad Software Inc. All rights reserved.

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.