Skip to content
Back to formatted view

Raw Message

Message-ID: <018401c5d973$13c39b60$5814020a@thesahajamach>
Date: 2005-10-25T14:47:47Z
From: Dimitri Szerman
Subject: Inf in regressions

Hi,

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.

Dimitri