Announcement

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

  • Do I still have to add 'i.' in front of variables that I want to use as dummies, but already encoded in 0 and 1 prior to import?

    Hello, I am very novice in stata, and irritated because of very simple but rarely told about in this particular case...

    I want to make an ordered logit model. Prior to input the dataset, I gathered survey results and encoded all the independent variables(x1~x5)' figures from character form into integer of 0 and 1(level of only one variable consists of 0, 1, and 2).
    These are not ordinal, but just categorial.
    And also I have a dependent variable(y) formatted from 1 to 7, which are ordinal.

    In this case, don't I have to code like 'i.x1' or something like that? As I have studied so far, it creates dummy variables automatically, receiving non-numeric form...Am I right?
    And with this kind of form, can I directly model the ordered logit, or do I have to preprocess further? Just for now, I didn't do further than this and got some results without an error, when I used command 'ologit y x1 x2 x3 x4 x5'.
    Attached Files
    Last edited by Park Hwanggyu; 12 Dec 2022, 02:24.

  • #2
    When in doubt use i.x1. First, it won't do any harm. Second, it will protect you from the case that the data does not look like you expect. This is important, because we all make errors. The trick is not to try to make zero errors (that is guaranteed to fail, not because you are bad but because you are human), but instead to use practices that will warn you when a mistake is made. Third, it will allow you to use margins afterwards.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten Buis Thank you for your answer. But the reason I asked is, when I was trying to model using 'i.' function, message 'omitted because of collinearity' comes out. And this doesn't appear when I do not type 'i.' in front of independent variables. I posted a new question regarding this, so I would be very appreciate if you answer this.

      https://www.statalist.org/forums/for...f-collinearity

      Comment

      Working...
      X