Hello all,
I have a question regarding interaction effects and models. I want to test the interaction of age (continuous variable) on metabolic syndrome (binary variable). I found an example which uses the following command to test the interaction between a binary and continuous variable:
and then using the following command to get the graph:
...which results in graph 1 attached.
So the only thing is that I am using melogit to run regression with these variables since this is a longitudinal analysis, and I want to know if I would run the same command to test the interaction effects; for instance:
However, when I predict fit after this command and run the same code above for the graph, I get the second graph attached (graph 2).
Can someone tell me which is the correct one? I would say the first one since it looks a lot more acceptable, but I am not sure.
Any feedback would be appreciated.
Thank you in advance.
I have a question regarding interaction effects and models. I want to test the interaction of age (continuous variable) on metabolic syndrome (binary variable). I found an example which uses the following command to test the interaction between a binary and continuous variable:
Code:
regress low_MCS curmetsyn##c.agenew
Code:
predict fit
Code:
twoway (line fit2 agenew if curmetsyn==0, sort) (line fit2 agenew if curmetsyn==1, sort lp(-)), legend(lab(1 > "MetS -") lab(2 "MetS +") ring(0) pos(1))
So the only thing is that I am using melogit to run regression with these variables since this is a longitudinal analysis, and I want to know if I would run the same command to test the interaction effects; for instance:
Code:
melogit low_MCS curmetsyn##c.agenew || newid:, nolog
Can someone tell me which is the correct one? I would say the first one since it looks a lot more acceptable, but I am not sure.
Any feedback would be appreciated.
Thank you in advance.
Comment