3.3 years ago by
There aren't any functions per se, but it's not an uncommon thing to do. Do note however that you are fitting (tens of) thousands of models simultaneously, and age and/or gender (especially) will have an effect on at least some of those genes. One aspect of this sort of statistics is that you are doing things in bulk, and you don't have the ability to do lots of model checking, etc, and sometimes have to use an over-specified model because it is useful for some subset of the genes you care about (and you are thereby 'wasting' degrees of freedom on those genes for which the extra parameter(s) are not needed).
One thing you can do is a MDS or PCA plot to see if there are large sex or age related differences. You can also fit the 'full' model and then see how many genes have a significant coefficient for age or sex. If there are not too many such genes (for some definition of 'not too many'), you could decide to drop one or more coefficients. Or you could take the opposite approach and just fit the model with age and sex and burn the two degrees of freedom. If you have enough replication it might not matter that much.