[BioC] ComBat: Error when including numerical covariates in model (numCovs)

Johnson, William Evan wej at bu.edu
Thu Jan 16 20:27:34 CET 2014


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
> 



More information about the Bioconductor mailing list