# the output of your binomial logistic model # will return log odds. # # Here's a function to convert that number to a proportion # (which is probably how your data are summarized) convert_logodds_to_prop <- function(log_odds){ proportion <- 1/(1+exp(-log_odds)) return(proportion) } # examples: convert_logodds_to_prop(0) # log odds of zero converts to 0.5 proportion convert_logodds_to_prop(1) # log odds of 1 equals proportion of 0.731 convert_logodds_to_prop(-1) # log odds of -1 equals proportion of 0.269 convert_logodds_to_prop(13) # log odds of 13 is extremely close to 1.0 ! # make a plot df <- data.frame(logodds = seq(-4, 4, 0.025)) df$proportion = convert_logodds_to_prop(df$logodds) px_logodds <- ggplot(df)+ aes(x = logodds, y = proportion)+ geom_line()+ xlab("Log odds")+ ylab("Proportion") px_logodds