>>>>> "MJ" == Michael Just <[EMAIL PROTECTED]> >>>>> on Sat, 18 Oct 2008 17:26:02 -0400 writes:
MJ> Henrique, MJ> This code below from a R-help helper worked. >> dat <-data.frame(f) >> dat2<-dat[dat$d<0,] >> dat.lm <-lm(c~d, data=dat2) But Henrique's advice, of using 'subset= d < 0' was really better (in most respects I'd say). If it really did not work for you, you have a strange (or broken?) R environment. Again back to your example c <- 1:10 d <- c(-1,2,-3,-4,5,6,-7,8,-9,10) f <- cbind(c,d) dat <- data.frame(f) rm(c,d,f) ## << check to make sure 'c' or 'd' are not picked up from GlobalEnv [MM] ## daN.lm <-lm(c ~ d, data = dat, subset = d < 0) summary(daN.lm) Does this really not work for you? Martin Maechler, ETH Zurich MJ> Thanks again, MJ> Michael Just MJ> On Sat, Oct 18, 2008 at 5:22 PM, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: >> Works for me. >> >> dat.lm <-lm(c~d, data = dat, subset=d < 0) >> >> Please see if you have dat with d and c columns names. >> ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.