Dear statalists,

Hope this post finds you well.


I have tried to plot a graph with an interaction term between continuous variable and categorical variable in multinomial logistic regression, despite following steps/instructions suggested on UCLA stata website, I still failed to do so. Have been trying syntax such as margins and marginplot , the plot itself is nevertheless looks odd. Any suggestions on this?

So currently, I am looking at the the association between the level of plasma calcium during trimester 1 and incidence of hypertensive disorders of pregnancy (HDP) in women particularly after 20 weeks of pregnancy in our study, the dependent variable has been divided into

1_Non-hypertensive (reference)
2_Pre-eclampsia
3_Pregnancy Induced Hypertension.

we found that there is an interaction between plasma calcium and ethnicity

ethnicity has been categorised into 3 groups as follows: ethnic group_1(reference), ethnic group_2 and ethnic group _3

Apparently, according to our finding, when there is one-unit increase in plasma calcium, the risk of getting pre-eclampsia is 5% lower specifically in ethnic group 1. The same significant effect of plasma Ca lowering the risk of HDP did not retain when I examined our participants as an entire cohort.

The problem I encountering now is that I have been trying to google syntax to display our findings above in graphs, but somehow those graphs ended up looking weird.

To make it simpler, I started with univariable regression,

My Stata inputs are:

. Mlogit HDP Plasma_Ca i.mo_eth, base (1)

. margins mo_eth, atmeans predict (outcome (1))
. margins mo_eth, atmeans predict (outcome (2))
. margins mo_eth, atmeans predict (outcome (3))

. margins, at (Plasma_Ca = (50 (20) 170)) predict(outcome(1))
. margins, at (Plasma_Ca = (50 (20) 170)) predict(outcome(2))
. margins, at (Plasma_Ca = (50 (20) 170)) predict(outcome(3))

. predict p1 p2 p3

. sort Plasma_Ca

. twoway (line p1 Plasma_Se if mo_eth ==1) (line p1 Plasma_Se if mo_eth==2) (line p1 Plasma_Se if mo_eth ==3),legend(order(1 "mo_eth = 1" 2 "mo_eth = 2" 3 "mo_eth = 3") ring(0) position(7) row(1))

. twoway (line p2 Plasma_Se if mo_eth ==1) (line p2 Plasma_Se if mo_eth==2) (line p2 Plasma_Se if mo_eth ==3),legend(order(1 "mo_eth = 1" 2 "mo_eth = 2" 3 "mo_eth = 3") ring(0) position(7) row(1))

. twoway (line p3 Plasma_Se if mo_eth ==1) (line p3 Plasma_Se if mo_eth==2) (line p3 Plasma_Se if mo_eth ==3),legend(order(1 "mo_eth = 1" 2 "mo_eth = 2" 3 "mo_eth = 3") ring(0) position(7) row(1))

I am not too sure if those commands above are the right ones to be used, and I wonder if is it still possible for me to apply those "graph plotting commands" in multivariable multinomial logistic regression model while I intend to adjust other factors that is related to my outcome (HDP) and plasma Ca ?

Any comments would be much appreciated.

Many thanks,
Emerald