title: Specifying reference category with 'statsmodels.formula.api' glm for dependent variable
body: <p>I read this <a href="https://stackoverflow.com/questions/22431503/specifying-which-category-to-treat-as-the-base-with-statsmodels">link</a> and tried to change the reference category for the dependent variable when using <code>statsmodels.formula.api</code>'s <code>glm(formula = &quot;C(y,Treatment(reference=-1)) ~ x1 + x2&quot;, data=dta, family=sm.families.Binomial())</code>.</p>
  <p>The dependent variable can only takes 2 values<code>y={-1,1}</code>. I specified the reference category as above and even tried changing the reference category from -1 to 1 , yet the sign of the logistic regression coefficients is still the same. What did I do wrong here ?</p>
  <p>It's also confusing that the logistic regression output does not tell whether an increase in <code>x1</code> is having a negative impact on probability of <code>-1</code> or <code>1</code> . Can someone help me out here please ?</p>
  <pre><code>                                                          Generalized Linear Model Regression Results                                                          
  ===============================================================================================================================================================
  Dep. Variable:     [&quot;C(y, Treatment(reference=-1))[-1.0]&quot;, &quot;C(y, Treatment(reference=-1))[1.0]&quot;]   No. Observations:                 3311
  Model:                                                                                                             GLM   Df Residuals:                     3309
  Model Family:                                                                                                 Binomial   Df Model:                            1
  Link Function:                                                                                                   logit   Scale:                          1.0000
  Method:                                                                                                           IRLS   Log-Likelihood:                -2292.4
  Date:                                                                                                 Wed, 17 Nov 2021   Deviance:                       4584.8
  Time:                                                                                                         22:51:58   Pearson chi2:                 3.31e+03
  No. Iterations:                                                                                                      4                                         
  Covariance Type:                                                                                             nonrobust                                         
  ====================================================================================================
             coef    std err          z      P&gt;|z|      [0.025      0.975]
  ----------------------------------------------------------------------------------------------------
  x1      -0.1769      0.120     -1.473      0.141      -0.412       0.058
  x2       0.2388      0.110      2.164      0.030       0.022       0.455
  ====================================================================================================     
  
                           
  </code></pre>