[R] How to ignore data

agent dunham crosspide at hotmail.com
Wed Feb 16 21:24:05 CET 2011


Hi, 

I have tried what you suggest here, and it seems not to work, can you help
me?

I want to do a lm regression, some of the variables are going to be affected
with log, I would like not no take into account those rows which imply doing
log(0)

for just one variable I have done the following but it doesn't work:

lmod1.lm <- lm(log(dat$inaltu)~log(dat$indiam),subset=(!(dat$indiam %in%
c(0,1)))

and obtain:

Error en lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  0 (non-NA) cases

lmod1.lm <- lm(log(dat$inaltu)~log(dat$indiam),subset=(!(dat$indiam = 0)),
na.action=na.exclude)

and obtain

Error en lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 
  NA/NaN/Inf en llamada a una función externa (arg 1)user at host.com
-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-ignore-data-tp3085593p3309666.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list