1 Cuckoo dataset

The common cuckoo does not build its own nest: it prefers to lay its eggs in another birds’ nest. It is known, since 1892, that the type of cuckoo bird eggs are different between different locations. In a study from 1940, it was shown that cuckoos return to the same nesting area each year, and that they always pick the same bird species to be a “foster parent” for their eggs.

Over the years, this has lead to the development of geographically determined subspecies of cuckoos. These subspecies have evolved in such a way that their eggs look as similar as possible as those of their foster parents.

The cuckoo dataset contains information on 120 Cuckoo eggs, obtained from randomly selected “foster” nests. For these eggs, researchers have measured the length (in mm) and established the type (species) of foster parent. The type column is coded as follows:

  • type=1: Meadow pipit
  • type=2: Tree pipit
  • type=3: Dunnock
  • type=4: European robin
  • type=5: White wagtail
  • type=6: Eurasian wren

2 Goal

The researchers want to test if the type of foster parent has an effect on the average length of the cuckoo eggs.

Optimally, they want to study this for all six species. Previously, we looked at a single pairwise comparison between the European robin and the Eurasian wren with a t-test. Here, we will analyse all types simultaneously with ANOVA.

In this short exercise, we perform a hypothesis test on the “cuckoo” dataset.

3 Load the required libraries

4 Import the data

5 Data Exploration

6 Data tidying

Set the type column to factor.

7 Data exploration

How many birds do we have for each type?

Visualize the data

8 Exercises and questions

  1. What do you observe?

  2. How will you model the data?

  3. Translate the research question in a null and alternative hypothesis

  4. Which test will you use to assess the research hypothesis?

  5. Formulate the assumptions of the test and assess the assumptions using diagnostic plots.

  6. If all assumptions to perform the test, complete the entire analysis and formulate a proper conclusion.

LS0tCnRpdGxlOiAiRXhlcmNpc2UgNy4yOiBBTk9WQSBvbiB0aGUgY3Vja29vIGRhdGFzZXQiCmF1dGhvcjogIkxpZXZlbiBDbGVtZW50IGFuZCBKZXJvZW4gR2lsaXMiCmRhdGU6ICJzdGF0T21pY3MsIEdoZW50IFVuaXZlcnNpdHkgKGh0dHBzOi8vc3RhdG9taWNzLmdpdGh1Yi5pbykiCi0tLQoKIyBDdWNrb28gZGF0YXNldAoKVGhlIGNvbW1vbiBjdWNrb28gZG9lcyBub3QgYnVpbGQgaXRzIG93biBuZXN0OiBpdCBwcm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