I have been struggling with this for a while. I appreciate if someone can help:

I am running a linear model using limma package on a set of micro-array probes and a disease phenotype adjusting for a confounding factor. Ideally I want my model to be like this:

Disease phenotype (continuous) ~ Micro-array probes + confounding factor

But in Limma package, There is no way to have the probe matrix in the middle. It's always the response variable. Whatever I put in my model matrix will act as the independent variable as it is seen here, which is not what I want:

lmFit(probe_matrix, design=model.matrix(~Disease phenotype+confounding factor))

Is there a way around this?
I think I figured it out myself. Apparently this is the only way:

    pvals<-sapply(1: dim(probe_matrix[1], function(x) eBayes(lmFit(Disease_phenotype, design=model.matrix(~t(probe_matrix[x,])+t(confounding factor))))$p.value)



