In this hands-on tutorial session you will perform three exercises on one-way Anova.,

For your reference you can find the code for the prostacyclin case study from the lecture for chapter 7: prostacyclin example

1 The lettuce freshweight dataset

In agriculture, it is important to have a high yield of crops. One way to increase the number of leaves (or better, total leaf weight) is by using a fertilizer.

Here, we consider three types of fertilizers:

  • biochar
  • compost
  • cobc (combination of biochar and compost)

The researchers want to find out if either of these fertilizers have a positive influence on the growth of lettuce plants. To this end, they grew up lettuce plants in a greenhouse. The pots were filled with one of four soil types;

  • Soil only (control)
  • Soil supplemented with biochar (refoak)
  • Soil supplemented with compost (compost)
  • Soil supplemented with both biochar and compost (cobc)

The dataset freshweight_lettuce.txt contains the freshweight for 28 lettuce plants. The researchers want to test if there is an effect of one or more of the treatments on the growth of lettuce plants.

The aims of this exercise are to learn how to:

  • formulate the null and alternative hypotheses for ANOVA

  • assess the assumptions for one-way ANOVA in a data exploration

  • conduct a one-way anova and posthoc tests using a linear model

  • interpret the results from an anova analysis in the context of the research question

Files:

  • Exercise: Exercise1

  • Data path:

    https://raw.githubusercontent.com/statOmics/PSLSData/main/freshweight_lettuce.txt

  • Solution: Solution1


2 The 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. The researchers want to test if the type of foster parent has an effect on the average length of the cuckoo eggs.

  • Exercise: Exercise2

  • Data path:

    https://raw.githubusercontent.com/statOmics/PSLSData/main/Cuckoo.txt

  • Solution: Solution2


3 The NHANES dataset:

The National Health and Nutrition Examination Survey (NHANES) contains data that has been collected since 1960. For this tutorial, we will make use of the data that was collected between 2009 and 2012, for 10.000 U.S. civilians. The dataset contains a large number of physical, demographic, nutritional and life-style-related parameters.

We want to test whether or not the mean systolic blood pressure value (take column BPSys1) is equal between the five self-reported health categories. To this end, we will use an ANOVA analysis.

  • Exercise: Exercise3

  • Data path:

    https://raw.githubusercontent.com/statOmics/PSLSData/main/NHANES.csv

  • Solution: Solution3

LS0tCnRpdGxlOiAiRXhlcmNpc2VzIG9uIGNoYXB0ZXIgNzogQU5PVkEiCmF1dGhvcjogIkxpZXZlbiBDbGVtZW50LCBKZXJvZW4gR2lsaXMgYW5kIE1pbGFuIE1hbGZhaXQiCmRhdGU6ICJzdGF0T21pY3MsIEdoZW50IFVuaXZlcnNpdHkgKGh0dHBzOi8vc3RhdG9taWNzLmdpdGh1Yi5pbykiCi0tLQoKSW4gdGhpcyBoYW5kcy1vbiB0dXRvcmlhbCBzZXNzaW9uIHlvdSB3aWxsIHBlcmZvcm0gdGhyZWUgZXhlcmNpc2VzIG9uIG9uZS13YXkgQW5vdmEuLAoKRm9yIHlvdXIgcmVmZXJlbmNlIHlvdSBjYW4gZmluZCB0aGUgY29kZSBmb3IgdGhlIHByb3N0YWN5Y2xpbiBjYXNlIHN0dWR5IGZyb20gdGhlIGxlY3R1cmUgZm9yIGNoYXB0ZXIgNzogW3Byb3N0YWN5Y2xpbiBleGFtcGxlXSguLzA3X3Byb3N0YWN5Y2xpbl9leGFtcGxlLmh0bWwpCgoKIyBUaGUgbGV0dHVjZSBmcmVzaHdlaWdodCBkYXRhc2V0CgpJbiBhZ3JpY3VsdHVyZSwgaXQgaXMgaW1wb3J0YW50IHRvIGhhdmUgYSBoaWdoIHlpZWxkIG9mIGNyb3BzLiBPbmUgd2F5IHRvCmluY3JlYXNlIHRoZSBudW1iZXIgb2YgbGVhdmVzIChvciBiZXR0ZXIsIHRvdGFsIGxlYWYgd2VpZ2h0KSBpcyBieSB1c2luZyBhCmZlcnRpbGl6ZXIuCgpIZXJlLCB3ZSBjb25zaWRlciB0aHJlZSB0eXBlcyBvZiBmZXJ0aWxpemVyczoKCiAgLSBiaW9ja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