Announcement

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

  • Ordered Logistic Regression (Odds)

    Hello, i am trying to run an Ordered Logistic Regression in odds ratio form. My code looks like:

    ologit happiness livingarrangements_martialstatus SEXA, or

    Happiness is the dependent variable being tested against multiple variables. But I am running into problems.

    1) livingarrangements and Sex both contain multiple values to be tested. (screenshots below). But they run the variable itself and not the sub types.

    2) Further if I rewrite the code to look at the specific values: ologit happiness unmarried_livingwithothers unmarrriedlivingalone married AGEB, or
    Then it just says (1) omitted. (screenshot below). I coded these specific values as 1=yes 2=no

    Any help is really appreciated ! I can't seem to figure it out.





    Attached Files

  • #2
    Code:
    ologit happiness i.livingarrangements_martialstatus i.SEXA, or
    Do read -help fvvarlist-.

    It is unclear to me why your approach with separate variables for the levels of livingarrangements_maritalstatus failed. But you didn't show the code you used to create them, so I'm guessing there was something wrong there.

    Comment


    • #3
      I'd go even further.

      Explicitly code the interaction of marital status and cohabitation in the form of separate, orthogonal explanatory indicator variables. It won't necessarily cure the collinearity problem, but it at least will allow you to see more clearly where any sparseness resides.

      Also, look at the thresholds for the cutoffs, especially the highest one. If it's still prominent in the factor variables model (either this one or the one Clyde's suggesting), then consider condensing at least that level with the penultimate level, and maybe pool the lowest two levels, too.
      Code:
      recode happiness (5=4) (1=2), generate(hap3)
      ologit hap3 i.marital_status##i.living_alone i.sex c.age

      Comment


      • #4
        Clyde your approach seems to have worked. Thank you both for the much needed help!

        Comment


        • #5
          Alright.... I have spoken too soon.... Clyde Schechter ..... it spit back this. Why would it say there is no observations available?
          Attached Files

          Comment


          • #6
            The only thing I can think of is that each year (LetterYear) Has different observations (I appended all the datasets and marked each year this way). Rather than that, I haven't a clue.

            Comment


            • #7
              I'm not entirely sure what you mean in #6 but I take it that each year is a separate variable and it is missing in the observations for the other years. If that's what you did, then, yes, that's the problem. That's a dysfunctional way to organize a data set and you will not be able to do anything useful with it in Stata.

              First, never in Stata should you use missing value to mean "no" in a yes/no variable. Always code yes/no variables as 1/0. Missing values should be reserved for actual missing responses.

              Next, if you are going to include year effects in the data, the best way to do that is to have a single variable that records the actual year, and then include i.year in the regression command's list of variables.

              So fix the data set, change the regression command and you should be fine.

              Comment

              Working...
              X