LoslegenKostenlos loslegen

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

Diese Übung ist Teil des Kurses

Differential Expression Analysis with limma in R

Kurs anzeigen

Anleitung zur Übung

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

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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
Code bearbeiten und ausführen