 Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: Marginal effect of interaction (continuos) variable in multinomial logit model

 From Ana García To statalist@hsphsun2.harvard.edu Subject st: Marginal effect of interaction (continuos) variable in multinomial logit model Date Mon, 13 Aug 2012 14:44:24 +0200

```Dear all,

I’m estimating a multinomial logit regression with one interaction
term (X4*X5). In particular, I’m modeling  the probability that a
search behavior is either null, exploitative, explorative or both . So
my dependent variable Y has four categories (1,2,3 and 4
respectively). Following the article of Wiersema and Bowen (2009) from
the Strategic Management Journal, a true interaction effect is
calculated as the cross-derivative of this probability, first with
respect to X4 and then with respect to X5. Until this moment I have
run the model and calculated the marginal effect of X4 , however I am
struggling to calculate the effect of X5 on the marginal effect of X4.

statalist/archive/2007-2009/msg00505, however in this case the
interacted variables are dummy*continuous and in my case X4 and X5 are
both continuous variables. Commands look like this:

gen X4X5=X4*X5

mlogit Y X4 X5 X4X5 X1 X2 X3, base(1)

sum X1 if e(sample)

scalar mX1 = r(mean)

sum X2 if e(sample)

scalar mX2 = r(mean)

sum X3 if e(sample)

scalar mX3 = r(mean)

sum X4 if e(sample)

scalar mX4 = r(mean)

sum X5 if e(sample)

scalar mX5 = r(mean)

local expvb2 exp(_cons + X4*scalar(mX4)+ X5*scalar(mX5)+
X4X5*scalar(mX4)*scalar(mX5)+X1*scalar(mX1) + X2*scalar(mX2)
+ X3*scalar(mX3))

local expvb3 exp(_cons + X4*scalar(mX4)+ X5*scalar(mX5)+
X4X5*scalar(mX4)*scalar(mX5)+X1*scalar(mX1) + X2*scalar(mX2)
+ X3*scalar(mX3))

local expvb4 exp(_cons + X4*scalar(mX4)+ X5*scalar(mX5)+
X4X5*scalar(mX4)*scalar(mX5)+X1*scalar(mX1) + X2*scalar(mX2)
+ X3*scalar(mX3))

local p1 1/(1 + `expvb2' +`expvb3' + `expvb4')

local p2 `expvb2'/(1 + `expvb2' + `expvb3' + `expvb4')

local p3 `expvb3'/(1 + `expvb2' + `expvb3' + `expvb4')

local p4 `expvb4'/(1 + `expvb2' + `expvb3' + `expvb4')

*Marginal effect of X4 on the probability of falling in categories 1,2,3 and 4

nlcom Dp1DX4: `p1'*(X4 + X4X5*X5-(`p2'*X4 + `p3'*X4 + `p4'*X4)

nlcom Dp2DX4: `p2'*(X4 + X4X5*X5 -(`p2'*X4 + `p3'*X4 + `p4'*X4))

nlcom Dp3DX4: `p3'*(X4 + X4X5*X5 -(`p2'*X4 + `p3'*X4 + `p4'*X4))

nlcom  Dp4DX4: `p4'*(X4 + X4X5*X5 -(`p2'*X4 + `p3'*X4 + `p4'*X4))

* Effect of X5 on the marginal effect of X4???

And now, is when I get stuck..

Ana García Granero, PhD student

INGENIO (CSIC-UPV)

Universidad Politécnica de Valencia - Camino de Vera s/n

Ciudad Politécnica de la Innovación - Edificio 8E 4ª Planta

46022 - Valencia

Spain

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```