From p.dalgaard@biostat.ku.dk  Wed Dec 25 18:10:03 2002
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: Wed Dec 25 18:10:03 2002
Subject: [Rd] inv.logit (package boot) (PR#2394)
In-Reply-To: <200212251205.NAA19295@pubhealth.ku.dk>
References: <200212251205.NAA19295@pubhealth.ku.dk>
Message-ID: <x2k7hy9g92.fsf@biostat.ku.dk>

olefc@birc.dk writes:

> The problem is caused by exp(x) returning Inf when x is large.
> 
> One way of fixing the problem [there may be better ways] would be to include the
> line 
> 
> out[x > 709] <- 1
> 
> in inv.logit()

Yes, or replace the entire code with something like

  inv.logit2 <- function(x) ifelse(x > 0, 1 - 1/(1+exp(x)), 1/(1+exp(-x)))

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907



[Rd] inv.logit (package boot) (PR#2394)
Peter Dalgaard BSA