Skip to content

R Expr V: Data analysis

Bioinformatics Core Facility Gothenburg edited this page Sep 4, 2017 · 4 revisions

Now it's time to start analysing the data.

First we need to create a design matrix. We will only compare the absent and present samples (see the targets file) even though there are more possible analyses to do here.

  1. Use the model.matrix() function to create a design matrix with two groups, giving it the estrogen vector from the target. Start with the example code below and fill in the correct group vector. Then change its column names to Absent and Present:

    design <- model.matrix(~ 0 + . . . )
    colnames(design) <- c(. . .)
    
  2. Fit the linear models with the lmFit() functions using your normalized data and the design matrix as input. Save the result in a variable.

  3. Create a contrast matrix with the makeContrasts() function. You only need to create one contrast, Present-Absent, in this case.

  4. Compute coefficients and errors with contrasts.fit() and store the results in a variable.

  5. Finally use the eBayes() function to calculate moderated t-statistics for each of the linear models and store the results in a variable.


Next: Results

Previous: Annotation

Clone this wiki locally