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

Göran Broström gb@stat.umu.se
Thu Dec 26 01:18:02 2002


On 25 Dec 2002, Peter Dalgaard BSA wrote:

> 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)))

Or use 'plogis(x)', eventually with 'lower.tail = ...' ...

>
> --
>    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
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-devel
>

---
 Göran Broström                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Umeå University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Umeå, Sweden             e-mail: gb@stat.umu.se