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

invlogit

Logistic and Inverse logistic functions


Description

Inverse-logit function, transforms continuous values to the range (0, 1)

Usage

logit(x)
invlogit(x)

Arguments

x

A vector of continuous values

Details

The Inverse-logit function defined as: logit^-1(x) = e^x/(1+e^x) transforms continuous values to the range (0, 1), which is necessary, since probabilities must be between 0 and 1 and maps from the linear predictor to the probabilities

Value

A vector of estimated probabilities

Author(s)

Andrew Gelman gelman@stat.columbia.edu, M.Grazia Pittau grazia@stat.columbia.edu

References

Andrew Gelman and Jennifer Hill. (2006). Data Analysis Using Regression and Multilevel/Hierarchical Models. Cambridge University Press.

Examples

data(frisk)
 n <- 100
 x1 <- rnorm (n)
 x2 <- rbinom (n, 1, .5)
 b0 <- 1
 b1 <- 1.5
 b2 <- 2
 Inv.logit <- invlogit(b0+b1*x1+b2*x2)
 plot(b0+b1*x1+b2*x2, Inv.logit)

arm

Data Analysis Using Regression and Multilevel/Hierarchical Models

v1.11-2
GPL (> 2)
Authors
Andrew Gelman [aut], Yu-Sung Su [aut, cre], Masanao Yajima [ctb], Jennifer Hill [ctb], Maria Grazia Pittau [ctb], Jouni Kerman [ctb], Tian Zheng [ctb], Vincent Dorie [ctb]
Initial release
2020-7-27

We don't support your browser anymore

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