Announcement

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

  • Issues on replicating contrasts with margins command

    Hi all,

    I've read the manual and Richard's guide about margins command, but could not understand some concepts.

    I'm fitting a Linear Mixed Model to predict human's movement acceleration measured over a month. I want to identify differences on predictors by different periods of the day (morning/afternoon) according to sex and age.

    The equation looks like:

    Code:
    mixed acceleration day_period##sex##c.predictor day_period##c.age##c.predictor || ID: R.day_period || date: R.day_period, residuals(ar 1, t(day_period))
    To test the day_period##c.predictor effects for men and women, I wrote this command:

    Code:
    contrast day_period#c.predictor@sex, effects asobserved
    But for a clear report for men and women, I am presenting marginal effects, since there's two three way interactions, with the same contrast.

    Code:
    margins day_period#i.sex, dydx(c.predictor) asobserved
    margins [email protected], dydx(c.predictor) contrast(effects) asobserved
    The SE are really close when comparing "contrast" with "margins, contrast" but not the same, why this is happening? According to the manual, the "contrast" command is applied on the marginal effects.

    Any help?
    Last edited by Marcus Lopes; 01 Feb 2019, 09:35.

  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. For example, being able to replicate your problem often helps folks help you.

    Comment

    Working...
    X