Announcement

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

  • Calculating adjusted prevalence with poisson and testing interaction

    Hi everybody,

    I would like to calculate the adjusted prevalence of smoking (0=non smoker, 1=current smoker) in a repeated cross-sectional study using poisson regression adjusting for age (0=aged 20-49, 1=aged 50-74), gender (0=women, 1=men) and survey year (1=2008, 2=2009, ... 10=2018). I would also like to graphycally display these adjusted prevalence by gender and age in interaction with survey period (1=2008-2011, 2=2012-2015, et 3=2016-2018). To do so I am using margins and marginsplot:

    Code:
    Code:
    glm smoking i.age_cat i.gender#i.survey_period c.survey_year, family(poisson) link(log) vce(robust) eform
    
    margins gender, expression(predict()*100) at(survey=(1(1)3)) vce(uncond)
    
    marginsplot, recastci(rarea)
    My question is: can I trust my estimates if I use both survey_year and survey_period in my model, or I should rather use only one of the two such as for example:

    Code:
    glm smoking ib0.age_cat ib1.gender##i.survey_period, family(poisson) link(log) vce(robust) eform
    Thank you in advance for your help,

    Giovanni
    Last edited by Giovanni Piumatti; 03 Dec 2020, 13:36.

  • #2
    Before turning to your question, it should be i.gender##i.survey_period in the first -glm- command to get the results you want.

    Turning to your question, it is problematic having both i.survey_period and c.survey_year in this model, precisely because you are interacting survey_period with gender. The difficulty arises because when you go to -margins-, it has no way of knowing that survey_period and survey_year are intimately related to each other. It treats them as unrelated, and so your results for each survey period will still be calculated as if it were perfectly possible for an observation in survey period 1 to be from 2017, etc. As a result, the adjustments will be done incorrectly. So I would take out c.survey year.

    Comment


    • #3
      Thank you very much for your answer! I have tried to leave c.survey_year out of the model (and adding i.gender##i.survey_period): the estimates in this way look much better.

      Comment

      Working...
      X