Announcement

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

  • Margins command and interactionterms

    Hello,

    I have a little Stata issue and I hope someone can help me out. After calculating the probit I want Stata to give me the marginal effects for the interactionterms. However, Stata only gives me the marginal effects for the sigle variables but not for the interactionterm. Why is that and how can I get Stata to give me the marginal effects for the interactionterms?

    Here is my code:
    probit outcomevariable i.treatment1##i.riskaversion i.treatment2##i.riskaversion $controls , vce(cluster Session)
    margins, dydx(*)
    eststo marginsmodel26: margins , dydx(*) post

    The Outcomevariable is binary. The treatment variables & the riskaversion variable are binary/categorical.

    Thanks in advance.
    Last edited by Soj Karimi; 13 Apr 2023, 05:25.

  • #2
    Originally posted by Soj Karimi View Post
    However, Stata only gives me the marginal effects for the sigle variables but not for the interaction term. Why is that and how can I get Stata to give me the marginal effects for the interaction terms?
    Because there is no such thing as a marginal effect for an interaction term. You cannot change the interaction term holding constant its constituent terms. See Richard Williams's article on this topic that defines what a marginal effect is and directly makes this point:

    https://journals.sagepub.com/doi/10....lar-articles.1

    Comment


    • #3
      Originally posted by Andrew Musau View Post

      Because there is no such thing as a marginal effect for an interaction term. You cannot change the interaction term holding constant its constituent terms. See Richard Williams's article on this topic that defines what a marginal effect is and directly makes this point:

      https://journals.sagepub.com/doi/10....lar-articles.1

      Thanks a lot, very helpful! Makes sense. I have just glanced over the article but still i am not sure if i have understood it correctly. The possibility he suggests would be to use the interactions with the atmeans option, such as:
      probit diabetes i.female##i.riskaversion
      margins female##riskaversion, atmeans

      and to then look at the Adjusted predictions - but the adjusted predictions are not the same as marginal effects, right?

      Could one generate a new varaible that contains the interaction?
      f.ex.
      gen interaction femxriskavers=1 if fem==1 & riskaversion==1
      gen interaction femxriskneutral=1 if fem==1 & riskaversion==2
      gen interaction femxriskloving=1 if fem==1 & riskaversion==3

      and then calculate:
      probit outcomevariable treatment1##femxriskavers treatment2##femxriskavers treatment1##femxriskneutral treatment2##femxriskneutral treatment1##femxriskloving treatment2##femxriskloving $controls , vce(cluster Session)
      margins, dydx(*)
      eststo marginsmodel26: margins , dydx(*) post

      Is that adequate?
      Thanks in advance.

      Comment


      • #4
        margins , dydx(*)
        gives you average marginal effects (AMEs) and these differ from adjusted predictions.

        Could one generate a new varaible that contains the interaction?
        f.ex.
        gen interaction femxriskavers=1 if fem==1 & riskaversion==1
        gen interaction femxriskneutral=1 if fem==1 & riskaversion==2
        gen interaction femxriskloving=1 if fem==1 & riskaversion==3

        and then calculate:
        probit outcomevariable treatment1##femxriskavers treatment2##femxriskavers treatment1##femxriskneutral treatment2##femxriskneutral treatment1##femxriskloving treatment2##femxriskloving $controls , vce(cluster Session)
        margins, dydx(*)
        eststo marginsmodel26: margins , dydx(*) post
        No, you cannot escape the fact that there is no such thing as marginal effect for an interaction term. All you will do is to trick Stata that the interaction term and the constituent terms are not related, but the results you will get will be nonsensical. That is why you need to use factor variables to generate the interactions when computing marginal effects.
        Last edited by Andrew Musau; 13 Apr 2023, 06:24.

        Comment

        Working...
        X