Announcement

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

  • interactions using margins

    Hello,

    I am wanting to examine whether the effect of age at first sex (categorical) on any condom use varies by race (categorical). I would like to use the margins command to examine this interaction effect. However, I get different predictions of margins depending on whether # is used or the option “over.” Can anyone tell if my understanding of these approaches is correct, and if one approach is preferred over the other?

    Am I correct in that the first approach (using #) gives me the predicted probabilities of my outcome for each level of combination of race and agesex, averaged over the entire sample, but the second approach (using the over option) gives me the average predicted probability for cases where, for example, race=1 & agesex=10-14, using each case’s observed values of the remaining covariates (agecat, forborn)?


    FIRST

    Code:
    qui svy, subpop(analysis): logistic anycondom i.agecat i.forborn i.r_race#i.agesex
     
    margins i.r_race#i.agesex, vce(unconditional) subpop(analysis) post
    -------------------------------------------------------------------------------
                  |             Linearized
                  |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    r_race#agesex |
     white#10-14  |   .7736561   .0292001    26.49   0.000     .7161024    .8312098
     white#15-17  |   .8008249   .0160967    49.75   0.000     .7690983    .8325516
       white#18+  |   .8213903   .0257654    31.88   0.000     .7706065    .8721741
     black#10-14  |   .6576579   .0368583    17.84   0.000       .58501    .7303058
     black#15-17  |   .8082099   .0255963    31.58   0.000     .7577594    .8586604
       black#18+  |   .7698533   .0474066    16.24   0.000     .6764146     .863292
      hisp#10-14  |   .7336142   .0353473    20.75   0.000     .6639443     .803284
      hisp#15-17  |   .8012716    .024969    32.09   0.000     .7520576    .8504856
        hisp#18+  |   .6773357   .0503757    13.45   0.000     .5780449    .7766265
    -------------------------------------------------------------------------------

    SECOND

    Code:
    qui svy, subpop(analysis): logistic anycondom i.agecat i.forborn i.r_race#i.agesex
     
    margins, subpop(analysis) over(agesex) at(r_race=(1(1)3)) vce(unconditional) post
    ------------------------------------------------------------------------------
                 |             Linearized
                 |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
      _at#agesex |
        1#10-14  |   .7330589   .0319435    22.95   0.000      .670098    .7960198
        1#15-17  |   .8123765   .0152806    53.16   0.000     .7822583    .8424948
          1#18+  |   .8298955   .0235333    35.26   0.000     .7835111    .8762799
        2#10-14  |   .6079378   .0367743    16.53   0.000     .5354553    .6804202
        2#15-17  |   .8194623   .0245447    33.39   0.000     .7710845    .8678401
          2#18+  |   .7796862   .0479434    16.26   0.000     .6851895    .8741829
        3#10-14  |   .6890951   .0373569    18.45   0.000     .6154643    .7627259
        3#15-17  |   .8128054   .0243265    33.41   0.000     .7648576    .8607532
          3#18+  |   .6886188    .050042    13.76   0.000     .5899857     .787252
    ------------------------------------------------------------------------------


    Thank you,
    Pina

  • #2
    The analysis using -over()- is not adjusted for agecat or forborn effects, whereas the margins i.r_race#i.agesex analysis is. So the question is whether you want adjusted or unadjusted results.

    I would also note that while the results are clearly not identical, most of the differences are pretty small, and the larger ones tend to be in groups with wide confidence intervals, suggesting that they are based on small n's. Then again, just how large is large enough to be important is a substantive issue and depends in part on what uses these results my be applied to.

    Comment


    • #3
      Thank you for the quick reply, Clyde.

      So in terms of the interpretation, would the i.r_race#i.agesex analysis tell me, for example, that the “average” white respondent has a 77% chance of using a condom if they initiated sex between ages 10-14?

      And yes, I did notice the differences weren’t large, so I’m glad you pointed that out. I was primarily concerned with my understanding of the differences in the output. However, I will double check the cell sizes for my interaction (I believe all are >100).

      Comment


      • #4
        So in terms of the interpretation, would the i.r_race#i.agesex analysis tell me, for example, that the “average” white respondent has a 77% chance of using a condom if they initiated sex between ages 10-14?
        It tells you that if agecat and forborn were distributed identically among all the agesex and race groups, the probability of condom use among white respondents initiating sex between ages 10 and 14 is 77%. Putting it a bit more succinctly, the probability of condom use, adjusted for agecat and forborn, is 77% among whites initiating sex between ages 10 and 14.

        Comment


        • #5
          Thank you for clarifying. I appreciate it!

          Comment

          Working...
          X