# Logistic regression with only one variable?

I mistyped in stata "logistic a" where a is a binary variable and to my surprise it actually ran.

What is a logistic regression doing when it's running without any independent variables?

• It might be just fitting the null model (intercept only, log-odds of being in the class of interest). To verify, please edit your question to show the class breakdown of your binary variable a and the output from the command you ran. – EdM Jan 3 '20 at 16:50
• Edited my answer, does this suffice? – Paze Jan 3 '20 at 16:54
• Incidentally, you can do this with regress, ologit, etc. In all cases you get an intercept only model: a heavy-handed way to characterize the mean/proportion, etc. of the dependent variable. Contrast mean a with regress a with Odds/(Odds+1) from your output above. – Alexis Jan 4 '20 at 18:35

It's an intercept-only model. Stata's notation _cons is the intercept term. With no other regressors, the odds is $$p/(1-p)$$ where $$p$$ is the proportion with positive response.
• @Paze I have already shown you how the value of "Odds" relates to the frequency of your variable ShuntEffekt. – AdamO Jan 7 '20 at 16:52