Announcement

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

  • Multiple Comparison of Predictive Margins

    Dear all Statalists,

    I am using the following model in Stata 16.1:
    Code:
    nbreg y i.x1 i.x2 (other covariates)
    x1 is 3 categorical variables (A,B,C).
    x2 is 12 categorical variables (1-12).
    I am not interested in the interaction between x1 and x2. Therefore, I will not include an interaction term in the model.
    What I want to know is whether there is a difference in the Predictive Margins of x1, at each cases of x2.

    First, I used the margins command to calculate the Predictive Margins.
    I calculated the Predictive Margins at each levels of x1 and x2 (3*12=36 different Predictive Margins).
    Substitute values as observed for all but x1 and x2.
    Code:
    margins, over(x1 x2) mcompare(bonferroni)
    marginsplot, plotdimention(x1)
    Looking at the plot, there seems to be a significant difference between A vs B and A vs C of x1 in some cases of x2.

    Q: What is the command to test if there is actually a difference in A vs B and A vs C of x1 for each x2 (12*2=24 ways)?

    Following commands indicated the different results to my thoughts looking marginsplot.
    Code:
    margins r.x1,over(x2) contrast(effects) mcompare(bonferroni)
    Sincerely,
    Last edited by Makoto Okawara; 07 Jun 2021, 02:06.

  • #2
    Please let me know if there is any information missing to answer my question.
    English is not my first language, so I apologize if any of this sounds strange.

    Comment


    • #3
      Originally posted by Makoto Okawara View Post
      I am not interested in the interaction between x1 and x2. Therefore, I will not include an interaction term in the model.
      What I want to know is whether there is a difference in the Predictive Margins of x1, at each cases of x2.
      Those two statements seem mutually incompatible to me.

      If you want to be able to test for a difference between levels of the first predictor separately at each level of the second predictor, wouldn't you need to include the interaction term?

      Comment


      • #4
        I appreciate your comments, which have helped me organize my thoughts and lead to better analysis.

        Comment

        Working...
        X