Last answered:

29 May 2023

Posted on:

26 May 2023

0

Resolved: ValueError: endog must be in the unit interval.

Hi,

In the Practice Exam:3 related to logistic regression, the variable 'Sold' has only 0s and 1s. But still it is showing this error.

2 answers ( 1 marked as helpful)
Instructor
Posted on:

29 May 2023

1

Hey Tulasi,


Thank you for reaching out!


In the last cell, note that the code should instead read:

reg_log = sm.Logit(y,x)


That is, you should swap the places of the x and the y variable.


Kind regards,

365 Hristina

Posted on:

29 May 2023

1

Thank you for identifying such a simple mistake and helping me with your answer.

Submit an answer