Announcement

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

  • Effect of an "if" statement in melogit function

    Hi all,
    Quick one for you that is not obvious for me. I have a dyadic data set and for the sake of this question I'm using a simple model:
    Code:
    melogit coresidence || dyad:
    Independant variables include exclusively individual-level characteristics like age groups, sex, ses and a few others. There are also two binary variables to identify roles and the oldest member of each dyad.

    The results are interesting but in some way aggregated where coefficients express the effects of both members. What if I wanted to separate the results according to the binary variables like this:
    Code:
    melogit coresidence if oldest==1 || dyad:
    As filtering on this binary variable select one individual from the dyad, I'm not sure if the model will keep the dyad "effect". Let's say I want to compare the results of both members separately, should I run the second model for each? In the affirmative, how to interpret these results compare to the whole model?

    I hope this makes sense!
    Thanks

  • #2
    As filtering on this binary variable select one individual from the dyad, I'm not sure if the model will keep the dyad "effect".
    No, it will not keep the dyad effect, because you have reduced the estimation sample to a one-level sample: only one observation per "dyad." The dyads are gone. And because of that there is also a strong chance that the estimation will fail to converge, because it is no longer possible to identify dyad-level variation separately from residual level. Even if it does converge, the results for the dyad-level variance will just be meaningless.

    The way I would do this is by using an interaction model:
    Code:
    melogit i.coresidence##i.oldest || dyad:
    (I assume coresidence is a discrete variable; if it is continuous, replace i.coresidence by c.coresidence.)

    That way you will get separate coresidence coefficients for oldest and youngest, but retain actual dyads in the sample, and thereby also capture and isolate dyad-level variation. To get those coefficients explicitly (because they are not directly shown in the -melogit- output) you run:
    Code:
    lincom 0.oldest#1.coresidence // coresidence COEFFICIENT FOR YOUNGEST
    lincom 1.oldest#1.coresidence // coresidence COEFFICIENT FOR OLDEST
    If you are not familiar with interaction models, before you run this or do anything else, read the excellent Richard Williams' https://www3.nd.edu/~rwilliam/stats2/l53.pdf, which provides an exceptionally clear explanation of interaction models, accompanied by Stata examples (not using -melogit-, but the logic is the same).

    Comment


    • #3
      Thank you Clyde, crisp and clear. Will read Williams paper for sure.

      Comment

      Working...
      X