Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Logistic regression with dummies and a constant - no dummy ommited

    Hello everyone,

    For my thesis, I am looking at a panel dataset. I have a logistic regression model with random effects that I use to get coefficients rather than odds ratios. I have five independent variables of which two are continuous and three are dummy variables. When I run STATA, it gives me coefficients for all variables plus a constant.

    My question is: why do I get the constant? Shouldn't STATA omit it or omit one of my dummies? I would prefer to interpret the constant as my missing dummy and the reference category rather than adding the option "noconstant".

    Do you see the mistake I made? Or does the dummy trap only occur in linear regressions?

    Thank you for your help! Any comment will be much appreciated.



    . logit Dependent Continuous1 Continuous2 Dummy1 Dummy2 Dummy3, vce(robust)
    Logistic regression Number of obs = 396
    Wald chi2(5) = 22.84
    Prob > chi2 = 0.0004
    Log pseudolikelihood = -100.65301 Pseudo R2 = 0.1139

    Robust
    Dependent Coef. Std. Err. z P>z [95% Conf. Interval]
    Continuous1 -2.77e-06 2.32e-06 -1.20 0.232 -7.31e-06 1.77e-06
    Continuous2 .0201586 .013928 1.45 0.148 -.0071398 .047457
    Dummy1 1.398664 .5869468 2.38 0.017 .2482691 2.549058
    Dummy2 .5700995 .4304977 1.32 0.185 -.2736606 1.413859
    Dummy3 .5289176 .6337776 0.83 0.404 -.7132636 1.771099
    _cons -3.811823 .5332358 -7.15 0.000 -4.856946 -2.7667


  • #2
    Isabel:
    welcome to the list.
    Replies to your query would probably benefit the most from attaching a .dta file with your dataset (provided that no confidentiality breach occurs in doing so).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hello Isabel,

      Welcome to the Stata Forum.

      The "standard" output under - logit - as well as -logistic - includes the constant, and the constant is not related to the series of dummies you created. Please check these examples: http://www.stata.com/manuals13/rlogit.pdf


      With regards to the dummy variables, you don't need to create the dummies for all levels of a categorical variable. You may just use the factor notation, i.e, you may add "i." as a prefix to the categorical variable. By doing so, Stata will take (as default) the lowest level as the reference.

      Hopefully that helps.


      Best,

      Marcos
      Best regards,

      Marcos

      Comment


      • #4
        Dear Carlo, dear Marcos,

        Thank you very much for your kind answers. I will definitely upload a .dta-file with my next question. Marcos, your answer was perfect, I understand what I did wrong.

        Thank you for volunteering your time for the STATA-confused!

        All the best,
        Isabel

        Comment

        Working...
        X