7  Exercise: Arabidopsis

To practice we will use an adapted data set on Arabidopsis from Banta, Stevens and Pigliucci (2010 Oikos 119(2), 359-369).

This growth chamber experiment is about the impact of removing the apical meristem and nutrient level on rosette growth and fruit formation.

You can download the data set here. It is stored as an R object. Store it on your computer

You can load it with with something like:

load("data/arabidopsis.obj")

In this exercise we focus on the rosette area.

The task is:

Some of the code is hidden behind the buttons below. Don’t reveal the solutions unless you really stuck

click to see a solution: exploration
library(tidyverse)

str(arabidopsis)

arabidopsis <- arabidopsis %>% mutate(rack = as.factor(rack))

arabidopsis %>% pivot_wider(id_cols=genotype,
                            names_from = population,
                            values_from = rosette.area,
                            values_fn = length) %>%
  print(n=30)
click to see a solution: graphical exploration
ggplot(arabidopsis,aes(y=rosette.area,x=interaction(clipping, nutrient))) + 
  geom_point(aes(color=rack)) + 
  facet_wrap(~region+population)
click to see a solution: modelling
library(lme4)

m1.ara.ros <- lmer(data=arabidopsis,
                   rosette.area ~ clipping*nutrient + (1|region/population/genotype) + (1|rack)
)

summary(m1.ara.ros)

suppressWarnings(confint(m1.ara.ros,quiet=TRUE))  # ignore the warnings...

# drop genotype

m2.ara.ros <- lmer(data=arabidopsis,
                   rosette.area ~ clipping*nutrient + (1|region/population) + (1|rack)
)

summary(m2.ara.ros)
suppressWarnings(confint(m2.ara.ros,quiet=TRUE))

# simpler model: drop the interaction in the fixed effects

m3.ara.ros <- lmer(data=arabidopsis,
                   rosette.area ~ clipping + nutrient + (1|region/population) + (1|rack)
)

anova(m2.ara.ros,
      m3.ara.ros)
click to see a solution: confidence intervals and plotting
predframe <- arabidopsis %>% select(clipping,nutrient) %>% distinct()

bootfun <- function(mod) predict(mod,newdata=predframe,re.form=NA)

bs <- bootMer(m2.ara.ros,FUN=bootfun,nsim=500)

out <- bind_cols(predframe,apply(bs$t,2,quantile,c(0.5,0.025,0.975)) %>% t() %>% as_tibble())

out

ggplot(out,aes(y=`50%`,x=nutrient,group=clipping,colour=clipping)) + 
  geom_point(position=position_dodge(width=.2)) +
  geom_errorbar(aes(ymin=`2.5%`,ymax=`97.5%`),width=.2,position=position_dodge(width=.2)) +
  theme_bw() + ylab("rosette area") + xlab("nutrient")