1

I have a simple dataframe with continous and categorical column:

                               Unemployment Rate          AcceptsCash
E020                                    0.058080                    0
E021                                    0.049818                    0
E022                                    0.037112                    1
E023                                    0.051215                    0
E024                                    0.051215                    0
E025                                    0.065413                    0
E026                                    0.071571                    0
E027                                    0.060130                    0
E029                                    0.035013                    1

however, when I try to display logistic regression plot using seaborn code:

sns.lmplot(x="Unemployment Rate", y="AcceptsCash", data=final_data_copy, logistic=True, fit_reg = True)

I get this warning and furthermore the plot only contains scatter points but not actually the regression line, any tips what can be wrong?

RuntimeWarning: All-NaN slice encountered
  def _nanquantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False,

enter image description here

JohanC
  • 71,591
  • 8
  • 33
  • 66
Sam333
  • 199
  • 14
  • 2
    It seems logistical regression doesn't work when the values are perfectly separable. See e.g. [Understanding complete separation for logistic regression](https://stats.stackexchange.com/questions/224863/understanding-complete-separation-for-logistic-regression) – JohanC Jan 21 '23 at 15:27
  • That's right — the logistic regression solution is undefined here as there are an infinite number of sigmoidal curves that you could draw to predict those data points equally well. – mwaskom Jan 21 '23 at 16:52

0 Answers0