[BioC] linear model design

James W. MacDonald jmacdon at med.umich.edu
Wed Nov 21 22:18:48 CET 2007


Hi Erica,

How about something like this:

 > pop <- factor(rep(1:3, each=12))
 > trt <- factor(rep(1:2, each=6, times=3))
 > sex <- factor(sample(c("male","female"), 36, TRUE))
 > design <- model.matrix(~0+pop+trt+pop:trt+sex)

Then the population comps are computed using a contrasts matrix, the 
treatment comp is captured by the trt2 parameter, and the intersections 
are the pop2:trt2 and pop3:trt2 parameters, all of which are adjusted 
for sex.

Best,

Jim



Erica Leder wrote:
> Hi,
> 
> I am trying to set up my linear model design matrix and contrast matrix 
> and I am having some difficulty.  I am using Agilent's one-color 
> platform, so I have a matrix of normalized intensity values as my input 
> object for lmfit.
> 
> I have 3 populations, 12 samples from each population, and a treatment 
> that was conducted on 6 individuals from each population (36 arrays 
> total).  I am interested in population differences, treatment 
> differences, and any population x treatment differences.  I also have 
> individuals of both sexes among the samples, so I would like to correct 
> for any sex affects in the model.
> I am new to linear models, but I thought I understood how to do this 
> until I decided to add the sex information to the model.  I would 
> greatly appreciate any suggestions.
> 
> Thanks,
> 
> Erica
> 
> 
> 

-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623



More information about the Bioconductor mailing list