Announcement

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

  • Multinomial logistic regression with two interaction terms

    Hi! I have a question about interaction terms in a multinomial logistic regression. I am using mlogit to assess the association between a categorical exposure and outcome variable. I am also including four categorical covariates. My variables are as follows:

    exposure = cathours (categorical sleep duration w/ 4 categories)
    outcome = catlife (categorical life satisfaction w/ 3 categories)
    effect modifiers = age and sex (both binary)
    confounders = smoke and alcohol1 (both binary)

    Here is my model without interaction terms:

    mlogit catlife ib2.cathours i.agegp3 i.sex i.smoke i.alcohol1, baseoutcome(0)

    I want to assess interaction/effect modification of age and sex, but I am not sure of the exact syntax for including these both as interaction terms. I believe that it would be something like this:

    mlogit catlife ib2.cathours c.cathours##i.agegp3 c.cathours##i.sex i.smoke i.alcohol1, baseoutcome(0)

    This doesn't seem quite right to me. Any help would be greatly appreciated!

  • #2
    Hi Maia
    Only one comment with your model specification.
    while you can, from the technical point of view, estimate the model you describe (second one), you should try to keep the treatment of variables consistent.
    For instance, cathours cannot be both continuous and discreet.
    HTH
    Fernando

    Comment


    • #3
      Originally posted by FernandoRios View Post
      Hi Maia
      Only one comment with your model specification.
      while you can, from the technical point of view, estimate the model you describe (second one), you should try to keep the treatment of variables consistent.
      For instance, cathours cannot be both continuous and discreet.
      HTH
      Fernando
      Just to clarify for Maia, Fernando means that the c. prefix explicitly tells Stata that the variable is continuous. i. tells Stata that it's categorical.

      Here's some corrected code for Maia, assuming she wants to assess age and sex simultaneously as effect modifiers for sleep duration.

      Code:
      mlogit catlife ib2.cathours##i.agegp3##i.sex i.smoke i.alcohol1, baseoutcome(0)
      Last, because this is a non-linear model with several interactions, I'd recommend reading up on margins and marginsplot to more intuitively assess the effects.
      Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

      When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

      Comment


      • #4
        Thank you both so much for your help!

        Comment

        Working...
        X