R/logit.R

Defines functions expit logit

Documented in expit logit

#' Logit and anti-logit function.
#' 
#' Compute the logit or anti-logit.
#' 
#' 
#' @aliases logit expit
#' @param p probability between 0 and 1.
#' @param theta logit between -infinity and +infinity
#' @return Computed logit or anti-logit
#' @author C.J.Schwarz \email{cschwarz@@stat.sfu.ca}
#' @keywords ~misc
#' @examples
#' 
#' ##---- compute the logit and its inverse
#' logitp <- logit(.3)
#' p <- expit(-.84)
#' 
#' @export logit expit
#' 
logit <- function(p){
#   logit of p
    log(p/(1-p))
}



#' @rdname logit 
expit <- function(theta){
# anti logit function
   1/(1+exp(-theta))
}

Try the BTSPAS package in your browser

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

BTSPAS documentation built on Oct. 25, 2021, 9:07 a.m.