0

I am using the statsmodels.formula.api package in python to perform a multiple logistic regression on a dataset and I am required to use 6 variables as predictors.

however, i keep getting this error - PerfectSeparationError and I am unable to figure out why (screenshot attached below).

The code that i used is as shown:

weekly['Direction'] = np.where(weekly['Direction'] == 'Up', 1, 0)
results = smf.logit('Direction ~ Lag1 + Lag2 + Lag3 + Lag4 + Lag5 + Volume', data=weekly).fit()
results.summary()

please share any advice on this, thank you very much

image of perfectseparationerror

  • 1
    Does this answer your question? [Error : PerfectSeparationError: Perfect separation detected, results not available](https://stackoverflow.com/questions/53041669/error-perfectseparationerror-perfect-separation-detected-results-not-availab) – AlexK Sep 24 '22 at 23:15

0 Answers0