Announcement

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

  • Multilevel logit model command

    I have a sample dataset where individuals were randomized into a clinic and given placebo or drug. The outcome is binary, whether their symptoms reduced or not after being given the drug or placebo. Symptom is 1 = Yes, 0= No and drug is 1= drug and 0=placebo. There are five different clinic, agegroup is 1=younger, 2=middle, 3=older, and sex is 1=male, 2=female. I’m trying to run a multilevel logit model with agegroup and sex as covariates.

    Code:
    clear
    input int(symptom drug clinic agegroup sex)
    1 1 2 3 1
    1 0 1 2 1
    1 0 5 1 2
    0 0 3 1 1
    0 1 4 3 2
    1 1 1 2 1
    0 1 2 2 2
    1 0 4 3 2
    0 0 3 1 1

  • #2
    Try help melogit

    Comment


    • #3
      Thanks for the guidance Ken Chui. I looked at help melogit and I'm wondering if I have the syntax right

      Code:
       melogit symptoms drug agegroup sex || clinic

      Comment


      • #4
        Originally posted by Amber Pong View Post
        . . . I looked at help melogit and I'm wondering if I have the syntax right
        You'll probably want the additions shown below in red.
        Code:
        melogit symptoms i.(drug agegroup sex) || clinic:
        First, you're missing a colon after the random effects variable.

        In addition, all of your predictors are categorical, and only the drug treatment predictor is coded zero-one. And age group has three categories.
        Code:
        help factor variables
        You do have far more data than what you show, right?

        Comment


        • #5
          Yes there are more data than what I showed. Thank you Joseph

          Comment

          Working...
          X