From gb@stat.umu.se  Thu Dec 26 01:18:02 2002
From: gb@stat.umu.se (=?iso-8859-1?Q?G=F6ran_Brostr=F6m?=)
Date: Thu Dec 26 01:18:02 2002
Subject: [Rd] inv.logit (package boot) (PR#2394)
In-Reply-To: <x2k7hy9g92.fsf@biostat.ku.dk>
Message-ID: <Pine.LNX.4.44.0212260113170.15690-100000@tal.stat.umu.se>

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
>

---
 Gran Brostrm                    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



[Rd] inv.logit (package boot) (PR#2394)
=?iso-8859-1?Q?G=F6ran_Brostr=F6m?=