Does pollution AND temperature have an effect on a new found (fake!) aquatic species *Pollutionia vertia*? How do I even test for this interaction? What should I do to test for this interaction? A two-way ANOVA!

A two-way ANOVA is a statistical method that is used to analyze the influence of two categorical independent variables on a continuous dependent variable. It assesses to see if there are significant differences between the means of the dependent variable across the different groups/categories being studied. It also assesses to see if there is an interaction effect between the two independent variables. How? Letâ€™s take a look!

*Prompt:* Fish4Life, a local fisherman group in your area, has approached your company and asked to run a study on aquatic vertebrates and the impact on pollution and temperature levels on their growth. They are particularly interested in the species *Pollutionia vertia*, a new species of fish that is near threatened. To control for various outside variables, you decide to run an experiment in a laboratory setting. You randomly choose 50 individuals to use in your study. You record the temperature (high, low), pollution level (high, moderate, low), and the size of the fish species. After the study, you give the fish a miracle supplement to cleanse them of any negative effects pollution and temperature may have had and then release them into the wild. Below is a snippet of the dataset you collected:

temperature | pollution_level | species_growth |
---|---|---|

low | high | 10.17 |

high | high | 9.40 |

high | high | 10.18 |

high | high | 6.02 |

low | moderate | 9.56 |

low | high | 10.71 |

low | low | 12.96 |

high | low | 8.96 |

high | low | 8.38 |

Determine if there is a significant interaction between temperature and pollution on the growth of *Pollutionia vertia*.

Independent categorical variables are: temperature and pollution_level

Dependent continuous variable is the species_growth

**Assumptions of Two-way ANOVA**

The assumptions of a two-way ANOVA are similar to the one-way ANOVA. Letâ€™s recap:

**1. Independence**

Observations must be independent of one another. For this example, we know it is in laboratory conditions, and for simplicityâ€™s sake we can say that the species were all kept in separate tanks and fed the same amount of food. So in theory, they should have uniform growth (science usually has other plans thoughâ€¦).

Additionally, your errors or residuals should be independent of each other. This is also related to your experimental setup, and we can say that they are for this example.

**2. Normality**

The two-way ANOVA requires normality between the residuals (the differences between the observed and predicted values). Meaning that these differences should be approximately normally distributed for each combination of levels for the independent variables. Letâ€™s test it:

*Prompt: run a normality test on each combination of categorical variables and then a levenes test please on this dataset (leveneâ€™s test results in 3).*

It passes all normality tests!

**3. Homogeneity of Variance (Homoscedasticity)**

The variance of the dependent variable should be equal across all combinations of levels of the independent variables. This is important to test for because unequal variances can inflate Type I error rates (false-positive result), which can affect the power of the analysis.

Our dataset passes this as well!

**4. No significant interaction**

This assumption relates to the interaction effect between the two independent variables. It just makes sure that the effect of one independent variable on the dependent variable is consistent across all levels of the other independent variable. This will be determined when you run the two-way ANOVA: if the p-value is less than 0.05 (also referred to as alpha or Î±) it indicates that there is a significant interaction.

**Letâ€™s perform the test!**

*Question 1: does temperature and/or pollution level affect fish growth?*

*Prompt 1: can you run a two-way anova to test to see if temperature and pollution_level has a significant effect on species_growth?*

Watch this magic:

NICE! Julius has run a lovely two-way ANOVA for us. Iâ€™ll break down the results for us:

Temperature by itself has a significant effect on the growth of our species (F(1,44) = 4.820, p = 0.033). However, pollution level and the interaction between the two (temperature x pollution_level) is not considered statistically significant (Pollution: F(2,44) = 1.257, p = 0.295; Interaction: F(2,44) = 2.105, p = 0.134).

What now? Julius gave me a prompt on â€śexplore the relationship between temperature and species growth in more detailâ€ť. So, me being the nosey little scientist I am, I used that prompt to examine this finding more in detail:

*Prompt: explore the relationship between temperature and species growth in more detail*

The first thing Julius provides me with is a graph (who would have thought!). This bargraph highlights the differences we detected via the two-way ANOVA, comparing species growth between two different temperatures.

*Pollutionia vertia*seems to grow larger at lower temperatures, in comparison to the individuals who were exposed to high temperatures.

Julius then goes into performing a t-test to further compare these differences found between temperature and species growth. The T-test indicated statistically significant results (t(48) = 2.323, p = 0.024).

**Recap of Findings**

We found that only temperature, specifically cooler temperatures, influences the growth of the *Pollutia vertia* species (F(1,44) = 4.820, p = 0.033). We also found that, pollution level and the interaction between the two (temperature x pollution_level) is not considered statistically significant (Pollution: F(2,44) = 1.257, p = 0.295; Interaction: F(2,44) = 2.105, p = 0.134).

We then used a t-test to confirm the relationship between temperature and species growth. The t-test further confirmed our two-way ANOVA results.

Thanks for joining me in another statistical analysis journey!

**Keywords:** AI statistics, AI statistical analysis, two-way anova, interaction effect, normality test, homoscedasticity