Hi. I have problems graphing the interaction effect I get after the following "main" commands.

gen selfeff_interact = selfeff * eer_done
gen att_sum_interact = att_sum * eer_done

mi set wide
mi register impute posloansqrt incomesqrt loansqrt
mi register regular perswinc persincome age edu EIER sizelog dinFylke sex work boligstatus REH_done_tot_score eer_done eer_do eer_plan
mi impute chained (regress) posloansqrt incomesqrt loansqrt = perswinc persincome age i.edu i.EIER sizelog i.dinFylke i.sex i.work i.boligstatus REH_done_tot_score eer_done eer_do eer_plan [pweight = Vekt], force add(50) rseed(1775)

mi estimate: nbreg eer_do eer_done i.sex age incomesqrt loansqrt posloansqrt sizelog houseagelog att_sum selfeff att_sum_interact selfeff_interact [pweight = Vekt]


This gives the following nbreg result:
Multiple-imputation estimates Imputations = 50
Negative binomial regression Number of obs = 3,683
Average RVI = 0.1196
Largest FMI = 0.3972
DF adjustment: Large sample DF: min = 316.66
avg = 323,980.99
max = 3021015.22
Model F test: Equal FMI F( 12,41724.8) = 16.13
Within VCE type: Robust Prob > F = 0.0000
eer_do Coef. t/p/CI
eer_done .3.069688 4.31 0.000 1.673205 4.466171
sex
Woman - -.0581222 -0.25 0.800 -.5077421 .3914978
age - -.0281726 -3.22 0.001 -.0453214 -.0110238
incomesqrt .-.0011577 -1.89 0.059 -.0023617 .0000462
loansqrt -.0000611 -0.19 0.849 -.000692 .0005697
posloansqrt .0012359 3.60 0.000 .0005609 .0019108
sizelog .338653 1.41 0.159 -.132942 .810248
houseagelog .1178251 0.57 0.566 -.2843169 .5199671
att_sum .2010771 6.56 0.000 .1409689 .2611852
selfeff .1324729 3.71 0.000 .062564 .2023817
att_sum_interact -.0811456 -3.34 0.001 -.1288207 -.0334705
selfeff_interact -.0204442 -0.61 0.539 -.085654 .0447656
_cons -10.11229 -6.68 0.000 -13.0773 -7.147279
/lnalpha .9221427 .361236 .2140639 1.630222
alpha 2.514673 .9083903 1.238702 5.105005
It is worth mentioning that both eer_do and eer_done is count data from 0-4 with large amounts of 0's, and very few 4's. I tried graphing the significant interaction effect between att_sum and eer_done (in bold) using the mimrgns command, but I can't seem to follow through with a marginsplot. If anyone has a solution for this, I would be extremely grateful.


I tried graphing the interaction effect myself in a spreadsheet, but have to admit that this is somewhat over my head in statistics, which means I am in no way sure about my results.

Following this post (https://stats.idre.ucla.edu/stata/da...al-regression/), I tried converting the coef. to IRR using "=exp(coef)", and then creating a graph with different values of eer_done and att_sum, with the equation:
Y IRR = exp(cons + (eer_done * 3.069688) + (att_sum * 0.2010771) + (eer_done * att_sum * -0.0811456))

But as the eer_done variable includes zero, I'm not sure the calculations are correct. Admittedly, you could even say I am more certain they are wrong than I am certain they are correct. The calculations, with an accompanying graph, can be found here in sheet 5 (https://docs.google.com/spreadsheets...it?usp=sharing).


If anyone has solutions for visualizing the significant interaction effect, preferably in IRR, I would be very grateful.

Lars Egner