ComBat: Error when including numerical covariates in model (numCovs)
2
0
Entering edit mode
@w-evan-johnson-5447
Last seen 6 months ago
United States
Hi Jordan, Sounds like a confounding issue. Are your covariates + batch linearly independent? In other words are there covariate levels or combinations that are nested within batch? Evan On Jan 16, 2014, at 12:54 PM, Jordan Ramsey wrote: > Hi there, > > I've been working with the ComBat function in the SVA package and I've found that there seems to be a problem when trying to include numerical covariates in the model. I consistently get the error: > > Error in t(design) %*% design : > requires numeric/complex matrix/vector arguments > > For example, if I run: > > model = model.matrix(~as.factor(Sex) + as.numeric(Age)) > ComBat_dat = ComBat(gene_express, batch = BatchNums, mod = model, numCovs = 3, prior.plots = TRUE) > > This produces: > Found 26 batches > Found 1 categorical covariate(s) > Found 1 continuous covariate(s) > Standardizing Data across genes > Error in t(design) %*% design : > requires numeric/complex matrix/vector arguments > > However, when I use a model that only includes factors, I don't get any errors. Any ideas on what is going wrong here? Any help would be appreciated. > > Thanks, > -- > Jordan Ramsey >
sva sva • 4.3k views
ADD COMMENT
0
Entering edit mode
@jordan-ramsey-6340
Last seen 10.3 years ago
Hi Evan, I figured out what was going wrong - my batch variable was a character variable. This worked when all the covariates in the model were factors, but not when some were numerical. I changed the batch variable to a factor and it runs without errors now. Thanks, Jordan On Thu, Jan 16, 2014 at 7:27 PM, Johnson, William Evan <wej@bu.edu> wrote: > Hi Jordan, > > Sounds like a confounding issue. Are your covariates + batch linearly > independent? In other words are there covariate levels or combinations that > are nested within batch? > > Evan > > > On Jan 16, 2014, at 12:54 PM, Jordan Ramsey wrote: > > > Hi there, > > > > I've been working with the ComBat function in the SVA package and I've > found that there seems to be a problem when trying to include numerical > covariates in the model. I consistently get the error: > > > > Error in t(design) %*% design : > > requires numeric/complex matrix/vector arguments > > > > For example, if I run: > > > > model = model.matrix(~as.factor(Sex) + as.numeric(Age)) > > ComBat_dat = ComBat(gene_express, batch = BatchNums, mod = model, > numCovs = 3, prior.plots = TRUE) > > > > This produces: > > Found 26 batches > > Found 1 categorical covariate(s) > > Found 1 continuous covariate(s) > > Standardizing Data across genes > > Error in t(design) %*% design : > > requires numeric/complex matrix/vector arguments > > > > However, when I use a model that only includes factors, I don't get any > errors. Any ideas on what is going wrong here? Any help would be > appreciated. > > > > Thanks, > > -- > > Jordan Ramsey > > > > -- Jordan Ramsey PhD candidate (Biotechnology) Bahn Group Department of Chemical Engineering & Biotechnology University of Cambridge [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
@w-evan-johnson-5447
Last seen 6 months ago
United States
Awesome news. Glad you figured it out! On Jan 16, 2014, at 3:33 PM, Jordan Ramsey wrote: Hi Evan, I figured out what was going wrong - my batch variable was a character variable. This worked when all the covariates in the model were factors, but not when some were numerical. I changed the batch variable to a factor and it runs without errors now. Thanks, Jordan On Thu, Jan 16, 2014 at 7:27 PM, Johnson, William Evan <wej@bu.edu<mailto:wej@bu.edu>> wrote: Hi Jordan, Sounds like a confounding issue. Are your covariates + batch linearly independent? In other words are there covariate levels or combinations that are nested within batch? Evan On Jan 16, 2014, at 12:54 PM, Jordan Ramsey wrote: > Hi there, > > I've been working with the ComBat function in the SVA package and I've found that there seems to be a problem when trying to include numerical covariates in the model. I consistently get the error: > > Error in t(design) %*% design : > requires numeric/complex matrix/vector arguments > > For example, if I run: > > model = model.matrix(~as.factor(Sex) + as.numeric(Age)) > ComBat_dat = ComBat(gene_express, batch = BatchNums, mod = model, numCovs = 3, prior.plots = TRUE) > > This produces: > Found 26 batches > Found 1 categorical covariate(s) > Found 1 continuous covariate(s) > Standardizing Data across genes > Error in t(design) %*% design : > requires numeric/complex matrix/vector arguments > > However, when I use a model that only includes factors, I don't get any errors. Any ideas on what is going wrong here? Any help would be appreciated. > > Thanks, > -- > Jordan Ramsey > -- Jordan Ramsey PhD candidate (Biotechnology) Bahn Group Department of Chemical Engineering & Biotechnology University of Cambridge [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 1017 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