Announcement

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

  • Question about contrast and margin

    Dear scientist,

    If I want to compare the mean of different variable levels between two groups, after fitting linear mixed model, what is the difference between using
    Code:
    contrast
    and
    Code:
    margin
    For example, my group variable has 2 levels (group A and group N); Mask variable has 3 levels (mask1, mask2, mask3); braintract has 3 levels (braintract1, braintract2, braintract3)
    Compare FA values between two group
    Group A v.s. Group N
    Mask1braintract1 v.s. Mask1braintract1
    Mask1braintract2 v.s. Mask1braintract2
    Mask1braintract3 v.s. Mask1braintract3
    Mask2braintract1 v.s. Mask2braintract1
    Mask2braintract2 v.s. Mask2braintract2
    Mask2braintract3 v.s. Mask2braintract3
    Mask3braintract1 v.s. Mask3braintract1
    Mask3braintract2 v.s. Mask3braintract2
    Mask3braintract3 v.s. Mask3braintract3

    With this linear mixed model (mask nested in braintract, braintract crossed within person)
    Code:
    egen specific_mask = group(braintract mask), label
    mixed fa i.group#i.specific_mask i.sex age || id: , vce(robust)
    margins specific_mask, dydx(group)
    If I use
    Code:
    contrast
    , can I get the same comparison?

    Best regards,
    Jack Liang


Working...
X