R/helper_logit_expit.R

Defines functions exp_expit log_logit expit logit

logit <- function(x) {
  log(x / (1 - x))
}

expit <- function(x) {
  1 / (1 + exp(-x))
}

log_logit <- function(x, method) {
  if (method == "binomial") {
    logit(x)
  } else if (method == "poisson") {
    log(x)
  }
}

exp_expit <- function(x, method) {
  if (method == "binomial") {
    expit(x)
  } else if (method == "poisson") {
    exp(x)
  }
}

Try the RSTr package in your browser

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

RSTr documentation built on Jan. 31, 2026, 9:07 a.m.