Python - Logistic (Logit) Regression - why am I getting an Endog error?
I'm running the following code:
X = dataset[['X1 transaction date', 'X2 house age', 'X3 distance to the nearest MRT station', 'X4 number of convenience stores', 'X5 latitude', 'X6 longitude', 'X7 distance to Xindian Ditsrict Office', 'X8 distance to Cardinal Tien Hospital', 'X9 distance to Shih Hsin University']]
y = dataset['Y house price of unit area']
model = sm.Logit(y, X).fit()
print(model.summary())
I'm using a CSV dataframe with information about 414 different residential properties in the Xindian District of Taiwan. My goal is to use a logistic regression to determine which attributes have the greatest effect on the properties' prices.
When running my Logistic Regression, I get an Endog Error, as follows:
ValueError Traceback (most recent call last) in () 2 y = dataset['Y house price of unit area'] 3 ----> 4 model = sm.Logit(y, X).fit() 5 print(model.summary())
//anaconda/lib/python3.6/site-packages/statsmodels/discrete/discrete_model.py in init(self, endog, exog, **kwargs) 402 if (self.class.name != 'MNLogit' and 403 not np.all((self.endog>= 0) (self.endog = 1))): --> 404 raise ValueError("endog must be in the unit interval.") 405 406
ValueError: endog must be in the unit interval.
Does anyone know why I am getting an endog error, and how to correct this issue? My outcome variable is a continuous integer.
Thank you.
Topic error-handling logistic-regression python
Category Data Science