Announcement

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

  • multilevel logistic regression: question about random slope

    Hello,
    I have models of multilevel logistic regression with random intercept and random slope.
    In the first model, with only random intercept, Stata gave me a variance component of the constant.
    In the second model, with the slope, it supposed to show me two variation components: one of the constant and another one of the slope.
    instead, I have only the component of the slope.
    why? something not right with the command?

    Random intercept model:

    Code:
    xtmelogit racist i.men i.academic_education agea i.religion religiosity_level  i.difficult_on_present_income i.ethnic_minority || cntry_numeric: , var mle
    Click image for larger version

Name:	unnamed.png
Views:	1
Size:	34.1 KB
ID:	1508821


    Random intercept and slope model:

    Code:
    xtmelogit racist i.men i.academic_education agea i.religion religiosity_level  i.difficult_on_present_income i.ethnic_minority || cntry_numeric: r.men, var mle
    Click image for larger version

Name:	unnamed (1).png
Views:	1
Size:	34.7 KB
ID:	1508822


    I would appriciate any help.
    Thank you,
    Shir

  • #2
    You're misunderstanding the R. notation. The variable men is categorical. If you are looking for random slopes for each category of men, then this is one of the places where Stata's factor variable notation lets you down, and the mostly obsolete xi: has to be resurrected. Try:

    Code:
    xi: xtmelogit racist i.men i.academic_education agea i.religion ///
    religiosity_level i.difficult_on_present_income i.ethnic_minority ///
    || cntry_numeric: i.men, var mle
    By the way, are you using an old version of Stata? The current command, since at least version 14, for a multi-level mixed effects logistic regression is either -melogit- or -meqrlogit-, and you don't have to specify the -var- or -mle- options as they are the defaults.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      You're misunderstanding the R. notation. The variable men is categorical. If you are looking for random slopes for each category of men, then this is one of the places where Stata's factor variable notation lets you down, and the mostly obsolete xi: has to be resurrected. Try:

      Code:
      xi: xtmelogit racist i.men i.academic_education agea i.religion ///
      religiosity_level i.difficult_on_present_income i.ethnic_minority ///
      || cntry_numeric: i.men, var mle
      By the way, are you using an old version of Stata? The current command, since at least version 14, for a multi-level mixed effects logistic regression is either -melogit- or -meqrlogit-, and you don't have to specify the -var- or -mle- options as they are the defaults.
      Hello Clyde,
      Thank you very much for your help.
      indeed, I use Stata 13.
      I think I understand your remarks. and now, with the changes of the command - it works! with two variance components.
      So thank you again.

      is it ok if I ask another question? the results are in exp(B)? I know that it's not odds ratio, but I want to see the exp and don't understand if I need to add something to the command or if the coefficients are already in exp term.

      Thank you,
      Shir

      Comment


      • #4
        After that, just type - xtmelogit, or - for that matter.
        Best regards,

        Marcos

        Comment

        Working...
        X