1 Background

In agriculture, it is important to have a high yield of crops. For lettuce plants, plants with many leaves are known to be preferred by the consumers.

One way to increase the number of leaves (or better, total leaf weight) is by using a fertilizer. Recently, there is a tendency to rely more on natural fertilizers, such as compost. Near Ghent, the institute of research for agriculture and fishery is testing new, natural fertilization methods. One of these new fertilizers is called biochar. Biochar is a residual product from pyrolysis, a process in which biomass is burned under specific conditions (such as high pressure) in order to produce energy. Biochar is similar to charcoal, but has some very useful properties, such as retaining water in the soil. It also has a positive influence on the soil microbiome.

2 The lettuce dataset

The researcher hypothesize that biochar, compost and a combination of both biochar and compost can have a different 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;

  1. Soil only (control)
  2. Soil supplemented with biochar (refoak)
  3. Soil supplemented with compost (compost)
  4. Soil supplemented with both biochar and compost (cobc)

The dataset freshweight_lettuce.txt contains the freshweight (in grams) for 28 lettuce plants (7 per condition). The researchers want to use an ANOVA test to assess if the treatments have a different effect on the growth of lettuce plants. If so, they will use a post-hoc test (Tuckey test) to discover which specific treatments have an effect.

Load the required libraries

library(tidyverse)

3 Data import

lettuce <- read_csv("https://raw.githubusercontent.com/GTPB/PSLS20/master/data/freshweight_lettuce.txt")
## Parsed with column specification:
## cols(
##   id = col_double(),
##   treatment = col_character(),
##   freshweight = col_double()
## )

Take a glimpse at the data

glimpse(lettuce)
## Observations: 28
## Variables: 3
## $ id          <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17…
## $ treatment   <chr> "control", "control", "control", "control", "control", "c…
## $ freshweight <dbl> 38, 34, 41, 43, 43, 29, 38, 59, 64, 57, 56, 50, 64, 62, 3…
## treatment to factor
lettuce <- lettuce %>%
  mutate(treatment = as.factor(treatment))

4 Data exploration

## Count the number of observations per treatment
lettuce %>%
  count(treatment)
## # A tibble: 4 x 2
##   treatment     n
##   <fct>     <int>
## 1 cobc          7
## 2 compost       7
## 3 control       7
## 4 refoak        7

Make a plots to explore the data

#...

Interpret the boxplots!

  1. How will you model the data.
  2. Translate the research question into parameters of the model.
  3. Check the assumptions.
  4. If the assumptions are fulfilled you can fit model
  5. Further assess differences between the treatments in a posthoc analysis if applicable.
LS0tCnRpdGxlOiAiVHV0b3JpYWwgNy4xOiBBTk9WQSBpbiB0aGUgbGV0dHVjZSBkYXRhc2V0IiAgIApvdXRwdXQ6CiAgICBodG1sX2RvY3VtZW50OgogICAgICBjb2RlX2Rvd25sb2FkOiB0cnVlICAgIAogICAgICB0aGVtZTogY29zbW8KICAgICAgdG9jOiB0cnVlCiAgICAgIHRvY19mbG9hdDogdHJ1ZQogICAgICBoaWdobGlnaHQ6IHRhbmdvCiAgICAgIG51bWJlcl9zZWN0aW9uczogdHJ1ZQotLS0KCiMgQmFja2dyb3VuZAoKSW4gYWdyaWN1bHR1cmUsIGl0IGlzIGltcG9ydGFudCB0byBoYXZlIGEgaGlnaCB5aWVsZApvZiBjcm9wcy4gRm9yIGxldHR1Y2UgcGxhbnRzLCBwbGFudHMgd2l0aCBtYW55IGxlYXZlcyBhcmUga25vd24gdG8gYmUgcHJlZmVycmVkIGJ5IHRoZSBjb25zdW1lcnMuCgpPbmUgd2F5IHRvIGluY3JlYXNlIHRoZSBudW1iZXIgb2YgbGVhdmVzIChvciBiZXR0ZXIsIHRvdGFsCmxlYWYgd2VpZ2h0KSBpcyBieSB1c2luZyBhIGZlcnRpbGl6ZXIuIFJlY2VudGx5LCB0aGVyZSBpcyAKYSB0ZW5kZW5jeSB0byByZWx5IG1vcmUgb24gbmF0dXJhbCBmZXJ0aWxpemVycywgc3VjaCBhcyBjb21wb3N0LgpOZWFyIEdoZW50LCB0aGUgaW5zdGl0dXRlIG9mIHJlc2VhcmNoIGZvciBhZ3JpY3VsdHVyZSBhbmQgZmlzaGVyeSBpcyB0ZXN0aW5nIG5ldywgbmF0dXJhbCBmZXJ0aWxpemF0aW9uIG1ldGhvZHMuIE9uZSBvZiB0aGVzZSBuZXcgZmVydGlsaXplcnMg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