logit | R Documentation |
Applies the logit transformation to one or more proportions. The logit represents the log odds of a "hit" or a 1–that is, log(p(hit)/(1-p(hit))– and is a better transformation to proportions for approximating the normal distribution than is the arcsine transformation.
logit(x)
x |
proportion(s) to which the logit transformation should be applied. |
Note that the logit is also a link function used in logistic regression to model binomial outcomes. If the binomial outcomes are available–i.e., observations at the level of individual "hits" or "misses" (0 or 1s), rather than a proportion aggregated over multiple observations–then logistic regression may be directly applied to those data, and applying any sort of transformation to the proportions is unnecessary.
The logit is undefined when p(hit) = 1 or p(hit) = 0; in addition, when p(hit) is close to 0 or 1, the logit is defined but not particularly stable. In these cases, the empirical logit may be useful instead.
numeric vector with the logit-transformed proportions
Jaeger, T. F. (2008). Categorical data analysis: Away from ANOVAs (transformation or not) and towards logit mixed models. Journal of Memory and Language, 59, 434-446.
logittoprob
to transform logits back into probabilities.
probdifftologit
to transform a difference o
probabilities into logits.
mydata = data.frame(Accuracy.Proportion = c(0.5,0.75,0.90,0.2)) mydata$Accuracy.Logit <- logit(mydata$Accuracy.Proportion)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.