I'm new on working with genetics data and I'm just wondering if I can use the lm
function when I'm building my models or do I have to use lmFit
function in limma package to build the models and what is the difference between the two packages in terms of performing linear regression models
1 Answer
You can use either, but lmFit
has the benefit of returning an object that can be used with eBayes()
so you can pool information across genes/probes/whatever. lm()
is a base R function applicable basically everywhere. lmFit()
if from the limma package, so originally intended for microarray data, though these days pretty much everything omics is analyzed with it since sample sizes tend to be small so everyone want's to pool information for more statistical power.
BTW, if you have methylation data then you'll want to fit data in logit space.
-
$\begingroup$ Thanks, Devon for sharing your knowledge. I have a followup question. If I knew the probes (CpGs) that I wanna work with. Will that make a difference to decide which one I'm going to use? $\endgroup$– Mr.MCommented Dec 5, 2019 at 3:59
-
$\begingroup$ Once you have more than one probe/location you benefit from using the eBayes framework that
lmFit()
facilitates. $\endgroup$ Commented Dec 5, 2019 at 8:10 -
$\begingroup$ Can you elaborate more on the benefits of eBayes? $\endgroup$– Mr.MCommented Dec 9, 2019 at 1:04
-
$\begingroup$ Empirical Bayes methods allow you to increase your statistical power in the (likely) event that you have relatively few (less than hundreds) samples. For more information please see the limma paper. $\endgroup$ Commented Dec 9, 2019 at 7:14