0

I had a question regarding the logistic regression function in R. I was wondering if there's a way to tell if the predicted curve from a glm will be reasonably shaped or not, e.g. a nice S-shaped curve opposed to a flattened curve/straight line?

I'm not sure if there are any arguments or values that could analyze and provide information regarding this... I calculated the "boundary" and it gives a single value, but even if the value is within acceptable range (for us, between 1-50), the curves sometimes come out to be flat/oddly shaped.

Previously, I've looked at AIC and residual values, but I was running into a similar issue where "reasonable" AIC and residual values generated oddly shaped/flat curves.

Standard code that is used to calculate logistic regression:

glm.1 <- glm(response~stimuli, family = binomial(link="logit")
value <- -glm.1$coefficients[1]/glm.1$coefficients[2]

Logistic regression is a bit tricky for me to fully understand as I'm still learning, so I apologize for any confusion! Any help/suggestions are appreciated, thanks!

Phil
  • 7,287
  • 3
  • 36
  • 66
polartex
  • 1
  • 1

1 Answers1

0

The classic method is the Hosmer-Lemeshow Goodness of Fit test, you can find it in the ResourceSelection package (it's the hoslem.test). This directly tests whether the probabilities from a logistic curve actually are compatible with the data. It's worth reading up on.

You can also toss in polynomial (or other) terms in the logistic regression to see if they add significantly to the model fit.

user11599
  • 326
  • 1
  • 5