HI Peter!!!
I very very very much appreciated the reply!! I had not realised that the
variable of "interest" was to be included in numCovs, I had assumed this
only to relate to "other" covariates...
The code now works! and this saved me from making a huge mistake in
assuming it was working when it was not.

Again thanks! and that SDH  (Sure Did Help)
cheers,
celine




2014-06-20 2:04 GMT-04:00 Peter Langfelder <peter.langfelder@gmail.com>:

> On Thu, Jun 19, 2014 at 12:36 PM, Celine Bourdon <cbourdon@gmail.com>
> wrote:
> > Hi all
> >  (especially (maybe) to Evan or Evan-LAB-People.. haha)  ... I am trying
> to
> > run ComBat to correct my methylation data for batch (which are 11 Slides)
> > and other covariates.
> >
> > But to illustrate the problem i reduced the model to it's simplest and
> > picked 2 variables, one that works and one that does not.
> >
> > ComBat WORKs for logBF (Body Fat) variable
> > model <-model.matrix(~logBF, data=phenoData)
> > cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide,
>  mod=
> > model, numCovs=NULL, par.prior =TRUE)
> >
> > ComBat does NOT WORK for logVF (Visceral Fat) variable
> > model <-model.matrix(~logBF, data=phenoData)
>
> You seem to have a type here - did you mean ~logVF above?
>
> > cBat_Mvalues <- ComBat(dat=SWANed.Mvalues, batch=Slide,
>  mod=
> > model, numCovs=NULL, par.prior =TRUE)
> >
> > I get the following error:
> > Found 11 batches
> > Found 1  categorical covariate(s)
> > Standardizing Data across genes
> > Error in solve.default(t(design) %*% design) :
> >   system is computationally singular: reciprocal condition number =
> > 2.2124e-18
>
> In both cases, unless your fat variables are categorical (and they
> seem to be coninuous), you need to specify
>
> numCovs = 1
>
> in the call to ComBat. Here's what the help file says:
>
> numCovs: The column numbers of the variables in mod to be treated as
>           continuous variables (otherwise all covariates are treated as
>           factors)
>
> ComBat may have succeeded in the first case because your logBF may
> have repeated values whereas logVF does not... not sure. Either way,
> treating the covariate as a factor makes no sense.
>
> HTH,
>
> Peter
>

	[[alternative HTML version deleted]]

