Announcement

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

  • Graphing a multilevel model with interaction effect

    Hi all!

    I'm looking for suggestions on how to graph a multilevel model I'm working on.

    I'm working with some covariates which I nest around one group: country. Therefore my model looks like this:
    Code:
     melogit trust_d i.soldicontatti##c.individualism c.tightz i.health_d c.difficulties_o c.supportclosec i.vitasociale c.edu_c sex i.diffecon c.agepul c.agepul_q c.familymember || country:
    I was looking for suggestions on how to possibly graph the interaction effect (i.soldicontatti##c.individualism) by country.
    I've looked around, but what I have found doesn't help much.
    I'm using Stata 16.

    Thanks in advance and let me know if you need me to be more specific about my dataset.

  • #2
    Pick a set of convenient and interesting values that span the range of values of your individualism variable. For illustrative purposes here, I'll assume those values are the numbers 1 through 10.

    Code:
    margins solidcontatti, at(individualism = (1(1)10))
    marginsplot, xdimension(individualism)
    will show you one curve for each value of solidcontatti showing the probability of trust_d at the specified values of individualism conditional on that value of solidcontatti.

    Code:
    margins solidcontatti, dydx(individualism) at(individualism = (1(1)10))
    marginsplot, xdimension(individualism)
    will give you the marginal effects of individualism on trust_d at the specified values of individualism conditional on that value of solidcontatti.

    Comment


    • #3
      thank you for replying: this is very useful! I'm sorry to bother you again, is it possible to plot for each country (I have 19)? I do not know how to call this kind of graph, I have read caterpillar, but I'm not sure about that...

      Thanks again!

      Comment


      • #4
        Plot what for each country? The interaction effect does not, in your model, vary by country. There is one interaction that applies to every country in your model.

        Comment


        • #5
          Cross-posted at https://stackoverflow.com/questions/...model-in-stata

          Please note our policy on cross-posting, which is that you are asked to tell us about it. FAQ Advice: https://www.statalist.org/forums/help#crossposting

          Comment


          • #6
            Sorry for crossposting!

            I would like to observe in a graph if there are any differences among countries. Is it possibile?

            Thanks!

            Comment


            • #7
              As the FAQ Advice explains, cross-posting is certainly allowed. It's no business of ours to tell you what you should or should not do elsewhere. It's explaining it here that is asked for.

              As for your question, see #4 for doubt on what you are asking for.

              Comment


              • #8
                I would like to observe in a graph if there are any differences among countries. Is it possibile?
                As I asked in #4 and Nick pointed out in #5, differences among countries in what?

                What we tell you three times is true.


                Comment

                Working...
                X