I am new to R and Logistic Regression so I will try to be as clear as possible.
I did the following really as a test case as proof of concept of what I've been trying to learn.
I have performed Logistic Regression in R using the following -
logistic <- glm(y ~ x, family = binomial (link = "logit"))
y is the response variable containing 1 or 0 based on whether or not a product was purchased, x is the predictor and contains the purchaser's age.
A plot of the data including the logistic regression curve, added using - curve(predict(logistic,data.frame(x=x),type="response"),add=TRUE)
shows very little correlation in that the curve is almost horizontal - image attached here - Logistic Regression x-y plot with curve.
If I summarise logistic (summary(logistic)
), I get a Pr(>|z|) value of x of 0.0203 *. As this is less than the 0.05 level of significance, this suggests a level of statistical correlation, but this is not what I see at all from the plot. Am I interpreting the results incorrectly here?
I have taken a screenshot of the other results from summary (Logistic Regression Summary) as they didn't format well here.
Thank you.