I am using the following model in Stata 16.1:
Code:
nbreg y i.x1 i.x2 (other covariates)
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)
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)
0 Response to Multiple Comparison of Predictive Margins
Post a Comment