Topic 3: ANOVAs in jamovi


Welcome to Computer Lab 3 for the Data Analysis (DA) component of BIO2POS!

In DA Topic 3, we introduced one-way ANOVA (analysis/analyses of variance) and repeated measures ANOVA, which can be viewed respectively as generalisations of the two sample \(t\)-tests and paired samples \(t\)-tests we discussed in the previous topic. We covered the assumptions of these different tests and the relevant post-hoc testing procedures, and also outlined the corresponding non-parametric tests.

In this computer lab, you will continue to learn how to use the statistical software jamovi, and conduct various ANOVA and the equivalent non-parametric tests using real data sets. You will also learn how to interpret and summarise jamovi output for these tests.

Learning Outcomes

These labs are designed to provide you with plenty of opportunities to practice different aspects of the statistical content covered in the lectures.

Each lab consists of core questions (with the 🌱 symbol) and extension questions (with the 🌳 symbol).

  • We recommend that you aim to complete at least the core component question(s) within the scheduled lab time
  • If you have time, you can work through the extension component question(s) either during the lab, or later in your own time
  • We recommend that you aim to complete all questions before the next DA lecture

Having completed this lab, you will be able to conduct the following tests and calculations in jamovi:

  • one-way ANOVA
  • one-way repeated measures ANOVA
  • ANOVA post-hoc testing
  • Kruskal-Wallis test
  • Friedman test

You will also be able to interpret the results of the above statistical techniques, check the assumptions of the tests, and provide clear summary statements highlighting the key statistical outputs of the models.


Before you begin, please check the following:

  1. Have you attended this week’s lectures/watched the lecture recordings?
  2. Have you completed this week’s DA online learning activity (if applicable)?
  3. Have you completed this week’s DA Quiz (if applicable)?

Please complete at least step 1. first, as doing so will help you to better understand the concepts you will need for this computer lab.

Preparations: Wolf River Data

For the first question in this computer lab we will analyse data on the distribution of toxic substances in the Wolf River in Tennessee, USA, collected by Jaffe et al. (1982). The concentration levels of certain hydrophobic substances, which are toxic to the environment through bioaccumulation, were recorded at different depth levels in the river. These substances include Aldrin, a toxic pesticide now banned in most countries, and Hexachlorobenzene (HCB), a toxic fungicide now banned worldwide. The variables in the data include:

  • Aldrin: Concentration level of Aldrin (ng/L)
  • HCB: Concentration level of HCB (ng/L)
  • Depth: Depth level at which recordings were taken (1 = surface, 2 = mid-depth, 3 = bottom).

Note that Depth is a fixed factor since recordings have been made at specific depth levels.

<span style='font-size:10px;'>Note. From File:Wolf-river-york-tn1.jpg, by [Brian Stansberry](https://commons.wikimedia.org/wiki/User:Bms4880), 2009, Wikimedia Commons ([https://commons.wikimedia.org/](https://commons.wikimedia.org/)). [CC BY 3.0 DEED](https://creativecommons.org/licenses/by/3.0/deed.en)</span>

Figure 0.1: Note. From File:Wolf-river-york-tn1.jpg, by Brian Stansberry, 2009, Wikimedia Commons (https://commons.wikimedia.org/). CC BY 3.0 DEED

a.

The Wolf River data is available in this week’s tile on LMS, in the file wolf_river.omv. Download this file now, and save it on your computer. Also open up a Word document, in which you can write down your responses and save your jamovi output as you work through the lab.

You may like to save the data and Word document to your OneDrive, so you can access them easily at a later date.

b.

Open up jamovi and load in the wolf_river.omv file.


1 Wolf River ANOVA 🌱

Suppose that we are interested in determining if the concentration level of the toxic substance Aldrin in Wolf River is different at different depth levels. Having more information on this could lead to a better understanding of how best to improve the health of the river.

1.1

Over the next few steps, we will conduct a one-way ANOVA in jamovi, to determine whether there is a difference in the mean Aldrin concentration levels at different depths in Wolf River.

As you progress, copy the relevant output into your Word document.

If you would like to refresh your memory on one-way ANOVAs, check the Topic 3A lecture.

1.2

Write out an appropriate null hypothesis and alternative hypothesis for this one-way ANOVA, and make sure to define any notation you introduce.

1.2.1

To begin the analysis, click on the Analyses tab, and then click on ANOVA and select One-Way ANOVA.

Since we are interested in the Aldrin values, drag the Aldrin variable across to the Dependent Variables box. To separate the Aldrin results by the different Depth specifications, drag the Depth variable across to the Grouping Variable box.

Make sure at this stage to have the Assume equal (Fisher's) box selected.

You will see that some automatic results will already appear in the Results section - the initial stage for our one-way ANOVA is already complete!

1.2.2

Before we begin interpreting the one-way ANOVA results, we should also obtain some other details.

Under the Additional Statistics heading, select Descriptives table and Descriptives plots

What do you notice about the change in the mean Aldrin levels across the different river depth levels? Based solely on the descriptives outputs, does it appear that there is a significant difference in means?

1.2.3

Identify the number of categories \(c\) and the sample size \(n\), and use these values to compute \(df_1\) and \(df_2\) for this one-way ANOVA.

Verify that your calculations are correct by checking the jamovi output.

1.2.4

Before we proceed further, we should confirm if the Fisher’s \(F\)-test version of the one-way ANOVA is appropriate to use.

Under the Assumption Checks heading, select Homogeneity test. Based on the Levene’s test result, should we use the Fisher’s or Welch’s \(F\)-test here?

1.2.5

At this stage, we should also check the ANOVA assumption of normality. We have a couple of options here, but at this stage will keep it simple - under the Assumption Checks heading, select the Normality test and Q-Q Plot boxes, and assess the results.

1.2.6

Regardless of your previous findings, assume for the remainder of this question that the one-way ANOVA has produced a statistically significant result, and that all test assumptions have been satisfied.

The next step is to conduct a post-hoc test. Click on the Post-Hoc Tests section, and select the appropriate option under the Post-Hoc Test heading.

Which specific pairwise comparison(s) is/are statistically significant? Make sure to explain your reasoning clearly.

If our ANOVA yields a statistically significant result, our work is not yet done - we need to conduct post-hoc tests to identify the specific statistically significant difference(s).

1.2.7

Write a clear summary based on your one-way ANOVA and post-hoc test results, in the style presented in the lectures. Make sure to summarise your conclusions about the ANOVA assumptions, and to note key details such as \(p\)-values.

2 Wolf River ANOVA #2 🌱

In jamovi, there are actually two ways to conduct a one-way ANOVA. You have just completed the simpler process in Question 1, using the One-Way ANOVA section.

Over the next few steps, we will repeat the one-way ANOVA analysis from Question 1, this time using the second process.

This process will yield the same results, but provides options for the inclusion of additional details, like effect sizes.

As you progress, copy the relevant output into your Word document.

2.1

In the Analyses tab in the top menu bar, click on ANOVA and select ANOVA. This will open a new section, with some new choices.

To begin, drag Aldrin to the Dependent Variable box, and drag Depth across to the Fixed Factors box.

You should see some automatic results appear in the Results section.

2.1.1

Check the \(F\) and \(p\)-values in the ANOVA results, and confirm that they match the results you obtained in part 1.2.1.

2.1.2

Select the \(\eta^2\) box under the Effect Size heading, and interpret the result.

To refresh your memory on the \(\eta^2\) effect size, check slides 17-18 of the DA Topic 3B lecture.

2.1.3

When checking the ANOVA normality assumption, it can be helpful to produce a histogram of the residuals.

  1. Down the bottom of the ANOVA section, click on Save, and select the Residuals box.
  2. Navigate to the Exploration -> Descriptives section - you should see that you now have a new variable, Residuals, in your data set.
  3. Create a histogram and Q-Q plot using the Residuals data, and verify that the Q-Q plot is identical to the one you obtained in part 1.2.5

Does the histogram of residuals support the assumption of normality?

When conducting one-way ANOVA analyses in jamovi, we recommend that you use the approach described in part 1.2.1, and supplement the results by obtaining the effect size and residuals histogram via the second approach described here.

3 Wolf River Kruskal-Wallis test 🌱

Suppose that after conducting your analysis in parts 1.2.1 and 2 you have some lingering concerns that the one-way ANOVA assumptions have been violated. Therefore, you decide to conduct a Kruskal-Wallis test, the non-parametric alternative test.

3.1

To begin, write out an appropriate null hypothesis and alternative hypothesis, given we are testing Aldrin levels across different Depth levels.

3.2

In the Analyses tab in the top menu bar in jamovi, click on ANOVA and select One-Way ANOVA - Kruskal Wallis, under the Non-Parametric subsection.

You will see that the options available are fairly sparse, which makes the analysis process here straightforward.

To begin, just as in the previous analyses, drag Aldrin and Depth across to the appropriate boxes.

Also select DSCF pairwise comparisons.

Do not worry about selecting Effect size, as this will be a different effect size to both Cohen’s \(d\) and \(\eta^2\), and we have not covered this in the lectures.

3.2.1

Write a clear summary of the Kruskal-Wallis analysis, in the style presented in the lectures.


4 Noise Data Repeated Measures ANOVA 🌱

<span style='font-size:10px;'>Note. From File:Colour soundwave.svg, by [KMpumlwana (WMF)](https://commons.wikimedia.org/wiki/User:KMpumlwana_(WMF)), 2022, Wikimedia Commons ([https://commons.wikimedia.org/](https://commons.wikimedia.org/)). [CC0 1.0 DEED](https://creativecommons.org/publicdomain/zero/1.0/deed.en)</span>

Figure 4.1: Note. From File:Colour soundwave.svg, by KMpumlwana (WMF), 2022, Wikimedia Commons (https://commons.wikimedia.org/). CC0 1.0 DEED

In this question we will consider data provided by Walker (2008) on people’s performance of a task under various levels of background noise. The variables in the data include:

  • Subject: The subject number assigned to an individual in the study
  • Sex: The sex of the individual (1 = male, 2 = female)
  • None: Performance with no background noise
  • Low: Performance with low background noise
  • Medium: Performance with medium background noise
  • High: Performance with high background noise

Since we have multiple recordings for the same individual here, a one-way ANOVA is not appropriate to apply to this data. Instead, we can use a Repeated Measures ANOVA.

4.1

The noise data is available in this week’s tile on LMS, in the file noise_data.omv. Download this file now, and open it in jamovi.

Over the next few steps, we will conduct a one-way repeated measures ANOVA in jamovi, to determine whether there is a difference in people’s performance scores under different noise conditions.

As you progress, copy the relevant output into your Word document.

If you would like to refresh your memory on repeated measures ANOVAs, check the Topic 3B lecture.

4.2

Write out an appropriate null hypothesis and alternative hypothesis for this one-way repeated measures ANOVA analysis.

4.3

As a quick initial check, create a descriptives table for the 4 noise levels in the Exploration section. What do you notice about the mean performance scores across the 4 noise levels?

4.4

To begin the analysis, click on the Analyses tab, and then click on ANOVA and select Repeated Measures ANOVA.

The layout here can appear a little daunting at first, but we will take it a step at a time.

4.4.1

In the Repeated Measures Factors box, you will see RM Factor 1, with Level 1 and Level 2 listed, and Level 3 greyed out. It is in this section that we list all the recordings settings for our data.

  1. Click on RM Factor 1 and change it to Noise Level
  2. Click on and replace Level 1, Level 2 etc with the 4 levels None, Low, Medium and High.
  3. Drag the 4 variables across to the relevant lines in the Repeated Measures Cells box.

You should see some automatically generated results appear in the Results section.

4.4.2

Identify the number of categories \(k\) and the sample size \(n\), and use these values to compute \(df_1\) and \(df_2\) for this one-way repeated measures ANOVA.

Verify that your calculations are correct by checking the jamovi output.

4.4.3

Under the Assumptions Checks section, select Sphericity tests to conduct the Mauchly’s sphericity test, as well as the Greenhouse-Geisser and Huynh-Feldt tests simultaneously.

Based on the output, what can you conclude about the sphericity assumption? Can we use the default \(F\) test here, or do we need to apply a correction?

If you believe a correction is required, select the appropriate box under the Sphericity corrections subheading before continuing.

4.4.4

Select the \(\eta^2\) effect size box, and interpret the output.

4.4.5

Regardless of your previous findings, asssume that post-hoc tests are justified for this analysis.

In the Post Hoc Tests section, drag Noise Level to the right-hand-side box, and select both the Tukey and Bonferroni boxes under the Corrections subheading.

Compare the results. At the 5% level of significance, are there any pairwise comparisons which are only statistically significant according to one of these two methods?

4.4.6

Write a clear summary based on your one-way repeated measures ANOVA and post-hoc test results, in the style presented in the lectures. Make sure to discuss each of the pairwise comparisons.


5 Noise Data Friedman Test 🌱

Suppose that a non-parametric test is more appropriate for your analysis of the noise_data.omv data set. Using Analyze > Nonparametric Tests > Related Samples, carry out a Friedman test to compare the performance scores across the four noise levels.

5.1

To begin, write out an appropriate null hypothesis and alternative hypothesis, given we are testing performance scores across different noise levels.

5.2

In the Analyses tab in the top menu bar in jamovi, click on ANOVA and select Repeated Measures ANOVA - Friedman, under the Non-Parametric subsection.

You will see that the options available are fairly sparse, which makes the analysis process here straightforward.

To begin, drag the 4 noise variables across to the Measures box.

Also select the Pairwise comparisons (Durbin-Conover), Descriptives and Descriptive plot - medians boxes.

5.2.1

Write a clear summary of the Friedman analysis, in the style presented in the lectures.


If you have made it to this stage by the end of the lab, that’s great! This was quite a long lab. Completing the core questions will prepare you well for upcoming assessments. The following extension questions will help consolidate and extend your understanding of the material.


6 Pea Plant Data 🌳

Recall that in DA Computer Lab 1 we introduced a raw, messy data set on dwarf pea plant seedlings, which had been collected as part of an experiment in an LTU BIO1AP lab class in 2022. Figure 5.2 below contains this data.

Previously, we produced descriptive statistics and some initial plots of this data, and then conducted some \(t\)-tests on this data in DA Computer Lab 2. However, using the two sample \(t\)-tests, we were limited to comparing two groups at once. Now, using the ANOVA procedures we have learnt, we can compare all three groups of seedlings at once.

<span style='font-size:10px;'>Note. From File:Leaves of Pisum sativum (2).JPG, by [Chmee2](https://commons.wikimedia.org/wiki/User:Chmee2), 2011, Wikimedia Commons ([https://commons.wikimedia.org/](https://commons.wikimedia.org/)). [CC BY 3.0 DEED](https://creativecommons.org/licenses/by/3.0/deed.en)</span>

Figure 6.1: Note. From File:Leaves of Pisum sativum (2).JPG, by Chmee2, 2011, Wikimedia Commons (https://commons.wikimedia.org/). CC BY 3.0 DEED

Background Information

To recap, in this experiment dwarf pea plant (Pisum sativum) seedlings were exposed to different concentrations of gibberellic acid (GA), in order to study the effect of GA application on plant growth. These dwarf pea plants are naturally deficient in GA, due to a mutation of a gene in the pathway for biosynthesis of GA. Therefore it is of interest to determine if application of GA to the seedlings has an impact.

For the experiment, each pea plant seedling was assigned to one of three groups, and then carefully sprayed:

  • C: a control group, were sprayed with water
  • TA: a treatment group, were sprayed with a 25mg/L solution of GA
  • TB: a treatment group, were sprayed with a 50mg/L solution of GA

The height of the seedlings was then recorded at a later date. The pea plant data in Figure 5.2 has pea plant height (in mm) recordings, for the three treatments, across 7 different benches.

Note that the number of seedlings (1 to 6) in each of the three groups varied between benches, and that some recordings were crossed or scribbled out (perhaps due to the seedling being damaged or dying).

<span style='font-size:10px;'>Pea Plant Raw Data</span>

Figure 6.2: Pea Plant Raw Data

6.1

In DA Computer Lab 1 or DA Computer Lab 2 you should have created a data file in jamovi containing the cleaned pea plant data. If for whatever reason you do not have this data file saved, you can find a copy of the data in this week’s tile on LMS, in the file pea_plant_seedlings_data.omv.

6.2

Suppose that we are interested in comparing the growth of the seedlings in the three different groups. Using an appropriate ANOVA method, test in jamovi if there is a difference in the mean height, at time of measurement, of the pea plant seedlings in the different groups (C, TA, TB).

Write a clear summary statement, and make sure to copy the relevant jamovi output to your Word document.

Assume that this mean value is for seedlings which have been growing for the same amount of time as the seedlings in the the BIO1AP experiment had been, when their data was recorded in Figure 5.2.


Make sure you check any relevant test assumptions before concluding your test.

6.3

Do you think it would be worthwhile to also conduct an ANOVA across the different lab benches? Discuss this with other students and/or your lab demonstrator.


7 Wolf River HCB ANOVA 🌳

Conduct an appropriate analysis of the HCB variable in the wolf_river.omv data set.


Well done! That concludes the DA Topic 3 jamovi computer lab.


Before you finish up, make sure to save both your Word document and your pea plant jamovi file to your OneDrive, for future reference.


References

Jaffe, P. R., Parker, F. L., and Wilson, D. J. (1982). Distribution of toxic substances in rivers. Journal of the Environmental Engineering Division, 108(4), 639-649.

Walker, I. (2008). Repeated-measures/split-plot ANOVA: noisedata [Data file]. https://web.archive.org/web/20210506222824/https://people.bath.ac.uk/pssiw/stats2/page16/page16.html


These notes have been prepared by Rupert Kuveke and other members of the Department of Mathematical and Physical Sciences. The copyright for the material in these notes resides with the authors named above, with the Department of Mathematical and Physical Sciences and with the Department of Environment and Genetics and with La Trobe University. Copyright in this work is vested in La Trobe University including all La Trobe University branding and naming. Unless otherwise stated, material within this work is licensed under a Creative Commons Attribution-Non Commercial-Non Derivatives License BY-NC-ND.