I have two populations (normal and diseased). For each subject I have two measurements (baseline and 3 months later).
My primary interest is the difference in expression between normal and diseased subjects, regardless of time-point.
Using the LIMMA user guide I have used sections 9.5.2 and 9.7 to guide me.
Looking at the code I wrote below, I have a feeling the contrasts matrix I created is not actually measuring the difference in expression between normal and diseased subjects. As I said earlier, my primary interest is the difference in expression between normal and diseased subjects, regardless of time-point. I think the contrasts matrix I currently have set-up will end up telling me the genes that respond differently in expression between healthy and diseased subjects over time - this is not what i want - I just want to know which genes are differently expressed between healthy and diseased regardless of the changing of time. I was hoping to get advice on correct way of conducting the analysis for my purposes.
Is it possible to use a continuous phenotype and still perform the analysis? For instance I may not be satisfied with normal vs diseased and may want to use for instance viral cells/mL as my primary predictor. In that case can I just run these lines of code?
Treat <- targets$viral_concentration
design <- model.matrix(~Treat)
corfit <- duplicateCorrelation(eset,design,block=targets$Subject)
fit <- lmFit(eset,design,block=targets$Subject,correlation=corfit$consensus)
fit <- eBayes(fit)
Thank you in advance!
Subject Condition time_point 1 disease 0_months 1 disease 3_months 2 normal 0_months 2 normal 3_months 3 disease 0_months 3 disease 3_months ... #From 9.7 in the LIMMA user guide Treat <- factor(paste(targets$Condition,targets$time_point,sep=".")) design <- model.matrix(~0+Treat) colnames(design) <- levels(Treat) #estimate the correlation between measurements made on the same subject corfit <- duplicateCorrelation(eset,design,block=targets$Subject) corfit$consensus # inter-subject correlation is input into the linear model fit: fit <- lmFit(eset,design,block=targets$Subject,correlation=corfit$consensus) # Comparing diseased and normal subjects, using 9.5.2 in LIMMA user guide, **##I have a feeling this is the incorrect way of comparing diseased and normal subjects**##** cm <- makeContrasts( DiseasedvsNormal = (disease.3_months-disease.0_months) - (normal.3_months-normal.0_months), levels=design) # compute these contrasts and moderated t-tests fit2 <- contrasts.fit(fit, cm) fit2 <- eBayes(fit2) topTable(fit2, coef="DiseasedvsNormal")