# Plotting the results of a logistic regression

I ran a logistic regression in R and then I went to plot it and I'm not sure how to understand the plot.

Here's the logistic regression -

glm(formula = outcome ~ ., family = binomial(link = "logit"),
data = dataframe)

Deviance Residuals:
Min       1Q   Median       3Q      Max
-4.2917  -0.2904  -0.2904  -0.2904   2.5247

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)         -3.144947   0.095262  -33.01   <2e-16 ***
continous_variable  0.048831   0.004774   10.23   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 1256.6  on 2817  degrees of freedom
Residual deviance: 1065.2  on 2816  degrees of freedom
AIC: 1069.2


Here's the code I used to plot it -

curve(predict(model,data.frame(dataframe=x),type="resp"),add=TRUE)


I ended up with just this -

If this is right - what does the y axis represent? Is the x axis the probability that outcome will occur?

• what is x in data.frame(dataframe=x)? – Rose Hartman Jan 24 '18 at 23:09
• That does not look right since the curve require an expression, and I don't see how the predict function there return one. Was there an error message? – Suren Jan 24 '18 at 23:43