geog_newbie
geog_newbie

Reputation: 185

Statsmodels.api Logit model error ValueError: endog must be in the unit interval

I know what the error means -I double-checked and my Y variable data is definitely within [0,1] with:

Y.max() = 1
Y.min() = 0.7333333
dtype(Y) is float64

I am reading in data using pandas. This is the first time I am using statsmodels.api package. Any ideas of what else I should check for this error

Upvotes: 0

Views: 4807

Answers (1)

Rafael Valero
Rafael Valero

Reputation: 2816

I had the same problem. In a logistic regression you need a dichotomy variable, see https://en.wikipedia.org/wiki/Logistic_regression, either 0 or 1.The minimum should be 0, otherwise you do not have categories you have a continuous variables and maybe you want to use a linear regression instead.

Upvotes: 1

Related Questions