[R] Inf in regressions

From: Dimitri Szerman <dimitrijoe_at_ipea.gov.br>
Date: Wed 26 Oct 2005 - 00:47:47 EST


Suppose I I wish to run

lm( y ~ x + z + log(w) )

where w assumes non-negative values. A problem arises when w=0, as log(0) = -Inf, and R doesn't accept that (as it "accepts" NA). Is there a way to tell R to do with -Inf the same it does with NA, i.e, to ignore it? ( Otherwise I have to do something like

w[w==0] <- NA

which doesn't hurt, but might be a bit incovenient sometimes.)

Thanks in advance.


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Oct 26 00:56:15 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:47 EST