R/logit.R

Defines functions logit inv.logit

Documented in inv.logit logit

logit <- function(x, min=0, max=1)
  {
    p <- (x-min)/(max-min)
    log(p/(1-p))
  }

inv.logit <- function(x, min=0, max=1)
  {
    p <- exp(x)/(1+exp(x))
    p <- ifelse( is.na(p) & !is.na(x), 1, p ) # fix problems with +Inf
    p * (max-min) + min
  }
                 

Try the phcfM package in your browser

Any scripts or data that you put into this service are public.

phcfM documentation built on May 30, 2017, 5:21 a.m.