I'm running logistic regressions in Python using statsmodels logit. My dependent variable is binary, 0 or 1.
How do I know whether the regression is modeling an outcome of 1 or an outcome of 0 for the dependent variable? (And, therefore, whether the coefficients correspond to an outcome of 1 or 0?)
For example, one of the parameters, age, has a positive coefficient of 0.03. How do I know whether age is positively correlated with outcome == 1, or positively correlated with outcome == 0?
statsmodels
: if the response variable is numeric 0, 1, then1
is the event, i.e. predict Prob(y=1 | x). However, if the response variable is categorical and formulas are used, then the formula conversion flips the order of 0 and 1, github.com/statsmodels/statsmodels/issues/2181 $\endgroup$