Kom igångKom igång gratis

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).

Den här övningen är en del av kursen

Differential Expression Analysis with limma in R

Visa kurs

Övningsinstruktioner

The ExpressionSet object eset with the Populus data and the design matrix you just created (design) have been loaded in your workspace.

  • Create type_drought to test the effect of the type of tree (NM6 v. DN34) in the drought condition.

  • Create water_dn34 to 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_nm6 and water_dn34).

Interaktiv övning med praktiskt arbete

Testa den här övningen genom att slutföra den här exempelkoden.

# 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
Redigera och kör kod