Contrasts matrix for 2x2 factorial
There are many contrasts to make in a 2x2 factorial design. You need to test for the differences in the type of tree in each of the water conditions, the differences in the response to drought for each of the trees, and the differences in the response to drought between the two types of tree (traditionally referred to as the interaction effect).
This exercise is part of the course
Differential Expression Analysis with limma in R
Exercise instructions
The ExpressionSet object eset with the Populus data and the design matrix you just created (design) have been loaded in your workspace.
Create
type_droughtto test the effect of the type of tree (NM6 v. DN34) in the drought condition.Create
water_dn34to test the effect of the drought in the DN34 trees.Create an interaction term to test for differences in the response to drought between the two types of tree (hint: contrast
water_nm6andwater_dn34).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Load package
library(limma)
# Create a contrasts matrix
cm <- makeContrasts(type_normal = nm6.normal - dn34.normal,
type_drought = ___ - ___,
water_nm6 = nm6.drought - nm6.normal,
water_dn34 = ___ - ___,
interaction = (___ - ___) - (___ - ___),
levels = design)
# View the contrasts matrix
cm