Announcement

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

  • logistic regression categorical variable

    Dear stata community,

    I have a very basic stata question.
    I have a dependent variable that has values from 1-10, thus is a categorical variable which is why I wanted to use a logistic regression.
    However, I have longitudal data which is why I used the command: xtlogit.

    Now stata tells me: outcome does not vary in any group

    I thought maybe my dependent variable is not "labeled" as categorical in stata so that I have to first transform it but I would not know how or is there even a different problem?

    Thank you soooo much for you help in advance.

    Best
    Lisa

  • #2
    Welcome to the Stata Forum / Statalist,

    If you dependent variable reaches from 1 to 10, under a panel data design, you should not use a - xtlogit - model. That being said, I suspect there are other aspects missing, for example, I wonder whether you did - xtset - the data. Also, due to its complexity if compared to "standard' regression analysis, I recommend to grasp some background knowledge before delving with panel data. Hopefully that helps.
    Best regards,

    Marcos

    Comment


    • #3
      If you want to use logit, dependent variables should be coded 0/1. You may want to use ologit or xtologit.

      But I agree with Marcos that you should do a bit more reading on these methods before using them. xtologit would be a pretty advanced place to start if you aren's already clear on logistic regression.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Thank you so much Richard Williams Marcos Almeida for the super quick reply.

        And true, I should read a bit more about logistic regressions - normally I did not use them with panel data so that's maybe why I'm a bit struggeling.

        However, I did use xtset (fixed effects) before and could also run all my regressions without any problems but now my uni said I should try transforming it into a logistic regression because of my dependent variable... (btw. these are risk categories reaching fro risk category 1 to 10)

        Richard Williams xtologit actually works out I'm super happy that something so far works and maybe one further question before I do a bit more research on that topic: I also need to use a fiyed effects model (I did run the hausmann test before) plus I also have heteroscedasticity in my data which is why I wanted to use the vce(robust), however, I think I cannot use these commands with the xtologit, right? Should I then focus on another regression or should I look for other commands that go along with the regression or is it simply not possible?

        thank you again

        Lisa

        Comment


        • #5
          I fear that having 10 values for the DV under the xtologit model would provide too much output, I mean, it could be difficult to convey some meaning to a broad audience. Perhaps dividing the DV in 3 of 4 categories would be make the output much easier to understand, but that would depend on many aspects, including previous literature.
          Best regards,

          Marcos

          Comment


          • #6
            true I could actually do that thank you Marcos Almeida

            Comment

            Working...
            X