I'm performing a logistic regression in R.
I wanted to know if the function predict.glm outputs $p$ (probability of event occurring) or log odds i.e. $log(p/1-p)$?


1 Answer 1


It returns the log odds. You can see that with this basic example,

# Create a perfect correlated data.
data <- data.frame(x = c(1,0,1,0), y = c(T, F, T, F))

# Estimate the model.
model <- glm(y ~ x, data)

# Show predictions.
##        1         2         3         4 
## 23.56607 -23.56607  23.56607 -23.56607

# Compute the inverse of the log odd to come to your prediction. 
##           1            2            3            4 
##1.000000e+00 5.826215e-11 1.000000e+00 5.826215e-11 

If logit would return probabilities you could not take the inverse to come to your predicted values.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.