2

I am trying to do logisitc regression, but have this issue - some of the p values are NaN

model = sm.Logit(y2,X2.astype(float))
result = model.fit()
result.summary()

enter image description here enter image description here

Any ideas what to do?

Brian Spiering
  • 20,142
  • 2
  • 25
  • 102
Sim_Demo
  • 41
  • 1
  • 2
  • 1
    I've never used this package but my guess would be that there's a problem with these 4 variables about the time of day in the data. The main problem is not that the p-values are NaN, this is probably just a consequence of the first error "maximum likelihood failed to converge". Check the format of your data, in particular the type of these variables: they should be numerical I assume. It looks as if it doesn't find any value for these variables. – Erwan Jan 20 '20 at 23:40
  • I think, this might be useful - https://stackoverflow.com/a/55556806/8675216 – Akash Dubey Jan 22 '20 at 21:03
  • They are numerical, but it can be that there are many 0's, so the article that @AkashDubey recommend could be good, I will try some other methods for logit. – Sim_Demo Jan 23 '20 at 13:34

0 Answers0