HI, this is a bit of odd request. But is it possible to reassign or combine groups?
For example say I have simple group like this:
group <- c( "a" ,"a", "a" ,"b", "b", "b" )
design <- model.matrix(~0+ factor ( group ) )
fit <- lmFit( data , design )
contrast.matrix <- makeContrasts(ba = groupb - groupa, levels=design)
However I would like to do this instead.
group <- factor ( c("a1","a2","a3","b1","b2","b3") )
design <- model.matrix(~0+group )
colnames( design ) = group
fit <- lmFit( data , design )
contrast.matrix <- makeContrasts(ba = (b1+b2+b3) - (a1+a2+a.3), levels=design)
As you can see here every sample is treated like a distinct group but in the contrast I combine them. I want to do this because under certain genes the groups will be reassign. However I'm getting an error because each sample is calculated separately. Is there a way around this? thanks!
Gordon, ok thanks. I will just do the the analysis separately on certain subsets.
A.