limma question: lmFit with continuous predictor
2
0
Entering edit mode
@joubert-bonnie-nihniehs-e-4748
Last seen 9.6 years ago
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 [[alternative HTML version deleted]]
• 3.1k views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 6 hours ago
WEHI, Melbourne, Australia

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
Gordon

ADD COMMENT
0
Entering edit mode
Hi Gordon, Thank you. The issue was due to missing values. I included model.frame in my model.matrix statement to retain the missing values and then na.action=na.exclude later for the model. I have a related question to limma . I would like to run a logistic model with my data where I have a dichotomous outcome and the predictor variables are the methylation values (exprs(mldat)). LmFit is for a linear model only. Is there a related package for performing logistic regression? Thanks, Bonnie ________________________________________ From: Gordon K Smyth [smyth@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 Gordon > 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}}
0
Entering edit mode
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. Bonnie ________________________________________ From: Gordon K Smyth [smyth@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 Gordon > 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}}
0
Entering edit mode
@gordon-smyth
Last seen 6 hours ago
WEHI, Melbourne, Australia

Dear Bonnie,

The issue isn't so much between linear and logistic regression, as between differential expression (in the outcome is used to explain expression, as in limma) and prediction (in which expression is used to explain the outcome).

I don't work on prediction and can't recommend packages.

Best wishes
Gordon

On Sat, 9 Jul 2011, Joubert, Bonnie (NIH/NIEHS) [E] wrote: > I have a related question to limma . I would like to run a logistic > model with my data where I have a dichotomous outcome and the predictor > variables are the methylation values (exprs(mldat)). LmFit is for a > linear model only. Is there a related package for performing logistic > regression? > > Thanks, > Bonnie
ADD COMMENT
0
Entering edit mode
My suggestions to look into CMA, glmnet, huge, PMA, and the like, remain :-) Anyone used the 'survcomp' package? It seems handy for a number of purposes and comes with a particularly nice, contrarian vignette :-D On Sat, Jul 9, 2011 at 2:51 PM, Gordon K Smyth <smyth@wehi.edu.au> wrote: > Dear Bonnie, > > The issue isn't so much between linear and logistic regression, as between > differential expression (in the outcome is used to explain expression, as in > limma) and prediction (in which expression is used to explain the outcome). > > I don't work in the prediction and can't recommend packages. > > Best wishes > Gordon > > ------------------------------**--------------- > Professor Gordon K Smyth, > Bioinformatics Division, > Walter and Eliza Hall Institute of Medical Research, > 1G Royal Parade, Parkville, Vic 3052, Australia. > smyth@wehi.edu.au > http://www.wehi.edu.au > http://www.statsci.org/smyth > > > On Sat, 9 Jul 2011, Joubert, Bonnie (NIH/NIEHS) [E] wrote: > > I have a related question to limma . I would like to run a logistic model >> with my data where I have a dichotomous outcome and the predictor variables >> are the methylation values (exprs(mldat)). LmFit is for a linear model >> only. Is there a related package for performing logistic regression? >> >> Thanks, >> Bonnie >> > > ______________________________**______________________________**____ ______ > The information in this email is confidential and inte...{{dropped:21}}
ADD REPLY
0
Entering edit mode
Hi Tim, Thanks again. This is helpful. Bonnie From: Tim Triche, Jr. [mailto:tim.triche@gmail.com] Sent: Sunday, July 10, 2011 3:34 PM To: Gordon K Smyth Cc: Joubert, Bonnie (NIH/NIEHS) [E]; Bioconductor mailing list Subject: Re: [BioC] limma question: lmFit with continuous predictor My suggestions to look into CMA, glmnet, huge, PMA, and the like, remain :-) Anyone used the 'survcomp' package? It seems handy for a number of purposes and comes with a particularly nice, contrarian vignette :-D On Sat, Jul 9, 2011 at 2:51 PM, Gordon K Smyth <smyth@wehi.edu.au<mailto:smyth@wehi.edu.au>> wrote: Dear Bonnie, The issue isn't so much between linear and logistic regression, as between differential expression (in the outcome is used to explain expression, as in limma) and prediction (in which expression is used to explain the outcome). I don't work in the prediction and can't recommend packages. Best wishes Gordon --------------------------------------------- Professor Gordon K Smyth, Bioinformatics Division, Walter and Eliza Hall Institute of Medical Research, 1G Royal Parade, Parkville, Vic 3052, Australia. smyth@wehi.edu.au<mailto:smyth@wehi.edu.au> http://www.wehi.edu.au http://www.statsci.org/smyth On Sat, 9 Jul 2011, Joubert, Bonnie (NIH/NIEHS) [E] wrote: I have a related question to limma . I would like to run a logistic model with my data where I have a dichotomous outcome and the predictor variables are the methylation values (exprs(mldat)). LmFit is for a linear model only. Is there a related package for performing logistic regression? Thanks, Bonnie ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:22}}

Login before adding your answer.

Traffic: 996 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6