Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lodds

Logit (log-odds) and inverse-logit function.


Description

Calculates the logit (log-odds) and inverse-logit.

Usage

logit(mu)

inv_logit(eta)

Arguments

mu

A numeric object with probabilies, with values in the in the range [0,1]. Missing values (NAs) are allowed.

eta

A numeric object with log-odds values, with values in the range [-Inf,Inf]. Missing values (NAs) are allowed.

Details

Values of mu equal to 0 or 1 will return -Inf or Inf respectively.

Value

A numeric object of the same type as mu and eta containing the logits or inverse logit of the input values. The logit and inverse transformation equates to

logit(μ) = log(μ/(1-μ))

logit^-1(η) = exp(η)/(1 + exp(η)).

Examples

logit(0.2)
inv_logit(-1.386)

RBesT

R Bayesian Evidence Synthesis Tools

v1.6-1
GPL (>= 3)
Authors
Novartis Pharma AG [cph], Sebastian Weber [aut, cre], Beat Neuenschwander [ctb], Heinz Schmidli [ctb], Baldur Magnusson [ctb], Yue Li [ctb], Satrajit Roychoudhury [ctb], Trustees of Columbia University [cph] (R/stanmodels.R, configure, configure.win)
Initial release
2020-05-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.