Announcement

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

  • Graphing two continuous interactions in case of quadratic moderator

    Dear,

    First of all, I really thank you everyone here sparing no efforts to help the person like me.

    Shortly, my model is like below.

    reg Y X1 X2 c.X3##c.A##c.A
    (== reg Y X1 X2 X3 A A^2 X3*A X3*A^2)

    It'd be great if somebody let me know how to graph showing quadratic moderation-effect effectively.
    I've been trying to find-out but,,,, Thank you in advance.

    Lyon

  • #2
    So, first you have to pick values for X and A that cover the range of interest of those variables in the real world. For the purpose of illustrating the code, I'll assume that interesting values of X are 1, 2, 3, 4, and 5, and that interesting values of A are 20, 40, 60, 80, and 100.

    Then you want to show how the Y:X relationship depends on A. There are two common ways to do this:

    Code:
    margins, at(X = (1 2 3 4 5) A = (20 40 60 80 100))
    marginsplot, xdimension(X)
    
    margins, dydx(X) at(A = (20 40 60 80 100))
    marginsplot
    The first will produce a series of graphs of Y as a function of X, each graph corresponding to a different value of A. The second will show the marginal effect of X as a function of A. Either of these is a reasonable way to graph this kind of model. Which you should use depends more on how your audience likes to think about these things.

    Another possibility if you want to emphasize visually the quadratic dependency of Y on A would be:
    Code:
    margins, at(X = (1 2 3 4 5) A = (20 40 60 80 100))
    marginsplot, xdimension(A)
    Here you will see a series of curved graphs, one for each value of X, each graph being the relationship between Y and A.

    Comment


    • #3
      Thank you so much, prof. Clyde

      I think the first code would be the best for me to explain.
      I've changed the code a little bit in order to simplify and emphasize the change of the direction of moderating effect from (+) to (-), vice versa.

      Does this also make sense?
      ----------------------------------------------------------------
      qui reg Y X1 X2 c.X3##c.A##c.A
      qui sum A if e(sample)
      local low = r(mean) - r(sd)
      local medium = r(mean)
      local high = r(mean) + r(sd)
      margins, at(X = (1 2 3 4 5) A = (`low' `medium' `high'))
      marginsplot, noci xdimension(X)

      Lyon.

      Comment


      • #4
        also see: http://www.maartenbuis.nl/wp/inter_q...ter_quadr.html
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Responding to #3
          Does this also make sense?
          ----------------------------------------------------------------
          qui reg Y X1 X2 c.X3##c.A##c.A
          qui sum A if e(sample)
          local low = r(mean) - r(sd)
          local medium = r(mean)
          local high = r(mean) + r(sd)
          margins, at(X = (1 2 3 4 5) A = (`low' `medium' `high'))
          marginsplot, noci xdimension(X)


          The above code, in the framework of my response at #2, defines the range of interest for A to be from 1 standard deviation below to one standard deviation above the mean. There is no statistical answer to the question of whether that is sensible. We are dealing with some real world situation here--I don't konw what that real world situation is, and unless you are studying something in epidemiology, I probably wouldn't be able to make a judgment on this even if I did. I think it is important to always remember that although statistics is a mathematical science, it is not pure mathematics. We do statistical analysis in applied settings in order to improve our understanding of the real world, and, often, to guide decisions about how to act in the world. So the question of whether the range from 1 sd below to 1 sd above the mean is a reasonable delimitation of the range of interesting values of A depends on what A is, and on whether it is important in the real world to know more about the tail behavior of A which is not covered by this range. That is a judgment that you must make based on your knowledge of the scientific domain here. If you are not comfortable making that judgment yourself, consulting with others in your domain would be the best way to resolve your doubts.

          Comment


          • #6
            I really appreciate your detailed explain and tip above, prof. Clyde, and prof. Maarten.
            Especially, I will keep your advice in mind, prof. Clyde.

            Comment

            Working...
            X