Announcement

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

  • Interaction terms

    Hi Listers,

    I am studying alcohol use (yes/no) in young people. I am interested in assessing whether there is an interaction between age (1 15-19 vs 20-24 vs 25-29) and sex (1 male vs. 2 female) .

    I find the interaction term is significant

    logistic alcohol_use i.sex##i.age
    testparm i.sex#i.age

    I would then like to estimate the ORs for females (vs. men) at each age group so I set the code as:

    logistic alcohol_use i.sex#i.age i.age

    The output makes sense; however, it does not produce the exact same output as when I run 3 separate logistic regressions for each age group:

    logistic alcohol_use sex if age==1
    logistic alcohol_use sex if age==2
    logistic alcohol_use sex if age==3

    I am assuming the difference is due to having more terms in: logistic alcohol_use i.sex#i.age i.age - is that correct?

    I am just now unsure which one is the preferred approach.

    Thanks in advance!

  • #2
    So, I'll assume your age variable is coded 1/2/3 for the three age-ranges you mention. Then to get the female:male odds ratios in each age group you run the original logistic regression and then do:

    Code:
    forvalues i = 1/3 {
        lincom 2.female + 2.female#`i'.age, or
    }
    The model -logistic alcohol_use i.sex#i.age i.age- is a mis-specified model because it contains sex#age interaction but fails to include a "main" effect for sex. So it's just invalid and you can't use any results it gives you, even if they appear to make sense.

    Using
    Code:
    logistic alcohol_use sex if age==1
    logistic alcohol_use sex if age==2
    logistic alcohol_use sex if age==3
    would be valid, and, in this simple model at least, would give you the same results as the approach I show above.

    Comment


    • #3
      Thanks Clyde!

      Comment

      Working...
      X