Skip to content

logit transforms in R

October 5, 2012

Again, no syntactic sugar here. Instead you’ve got to look at the functions for the logistic distribution. In particular, the logit transform, \mathrm{logit}(x) = \log(\frac{x}{1-x}), is given in R by: qlogis(x). The inverse logit transform, \mathrm{invlogit}(x) = \frac{1}{1 + \exp(-x)}, is given in R by: plogis(x). Check that the inverses are good: for example, plogis(qlogis(0.6)) and qlogis(plogis(0.6)) should both give 0.6.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: