[R] subset and lme

Todd Ogden to166 at columbia.edu
Wed Jun 16 16:18:29 CEST 2004


I'm puzzled by the following problem, which appears when 
attempting to run an analysis on part of a dataset:

If I try:

  csubset <- dat$Diagnosis==0
  cont <- lme(fixed=cform,
                   random = ~1|StudyName,
                      data=dat,subset=csubset,na.action=na.omit)

Then I get:

Error in eval(expr, envir, enclos) : Object "csubset" not found

But if I do instead:

  cdat <- dat[dat$Diagnosis==0,]
  cont <- lme(fixed=cform,
                   random = ~1|StudyName,
                      data=cdat,na.action=na.omit)

Then everything is fine.

I'm puzzled that the object can't be found.  Maybe I'm 
overlooking something obvious?

Best,

Todd Ogden




More information about the R-help mailing list