[BioC] limma question: lmFit with continuous predictor

Joubert, Bonnie (NIH/NIEHS) [E] bonnie.joubert at nih.gov
Sat Jul 9 19:09:07 CEST 2011

P.s. correction to my earlier response.  I used complete.cases to exclude missing values after subsetting my data to just the variables I planned to include in my model.  Model.frame was not what resolved the issue.
From: Gordon K Smyth [smyth at wehi.EDU.AU]
Sent: Saturday, July 09, 2011 6:19 AM
To: Joubert, Bonnie (NIH/NIEHS) [E]
Cc: Bioconductor mailing list
Subject: limma question: lmFit with continuous predictor

Dear Bonnie,

limma has no difficulty with continuous predictors, but they are not
permitted to include missing values.  Your continuousVar apparently
contains missing values.

BTW, neither lmFit() nor model.matrix() have an argument 'na.action', so
it has no effect in the calls you give below.

Best wishes

> Date: Thu, 7 Jul 2011 10:58:59 -0400
> From: "Joubert, Bonnie (NIH/NIEHS) [E]" <bonnie.joubert at nih.gov>
> To: "bioconductor at stat.math.ethz.ch" <bioconductor at stat.math.ethz.ch>
> Subject: [BioC] limma question: lmFit with continuous predictor
> Hello,
> I am trying to evaluate the association between a continuous predictor
> variable and array data using limma's lmFit.  I used the methyLumi
> package to create an eset to manage the data from the Illumina Infinium
> DNA methylation platform.  I am able to run a model if my
> exposure/predictor variable is categorical but when it is continuous I
> get an error.  I am wondering whether lmFit must be run with categorical
> predictor variables only.  If so, do you recommend something else to
> evaluate continuous predictor variables?
> #Using a continuous predictor variable:
> dm1 <- model.matrix(~continuousVar, model.frame(~continuousVar,data=pData(mldat),na.action=NULL))
> fit1 <- lmFit(exprs(mldat), dm1, na.action=na.exclude)
> Error in qr.default(x) : NA/NaN/Inf in foreign function call (arg 1)
> #Using a categorical predictor variable:
> dm2 <- model.matrix(~ Sex2, model.frame(~Sex2,data=pData(mldat), na.action=NULL))
> fit2 <- lmFit(exprs(mldat), dm2, na.action=na.exclude)
> #no error
> Thank you.
> Bonnie Joubert

The information in this email is confidential and intend...{{dropped:6}}

More information about the Bioconductor mailing list