Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Calculation of the marginal effects in multinomial logit


From   menale kassie <[email protected]>
To   [email protected]
Subject   Re: st: Calculation of the marginal effects in multinomial logit
Date   Thu, 28 Dec 2006 03:06:54 -0800 (PST)

Thanks. I will try this.
Menale

----- Original Message ----
From: Maarten buis <[email protected]>
To: [email protected]
Sent: Thursday, December 28, 2006 1:32:30 AM
Subject: Re: st: Calculation of the marginal effects in multinomial logit


> --- [email protected] wrote:
> > I am trying to calculate the marginal effects at every observation
> > for a multinomial logit model. As I understood, the mfx command in
> > STATA calculates the marginal effect at the mean of the independent
> > variables, which is not correct for multinomial logit models since
> > marginal effects are nonlinear in the independent variables. 

The marginal effects are "not correct", but they are definately useful.
The concept of the marginal effect for a "typical" individual, can
help in communicating the results of your model. Anyhow if you still
want to do it (for instance for graphing purposes) see the example
below:

--- menale kassie <[email protected]> wrote:
> I posted similar question two weeks ago. I was trying nested loop to
> compute marginal effects for each and every observation however, it
> seems it is not working when a variable contains a non-integer value.

You can use -generate- to create a marginal effect for each
observation. This will not depend on the explanatory variables being
integer valued.

*-------------- begin example -------------
sysuse auto, clear
recode rep78 1/2=3
mlogit rep78 mpg foreign

predict xb4, xb equation(4)
predict xb5, xb equation(5)

gen denom = 1 + exp(xb4) + exp(xb5)

gen p3 = 1/denom
gen p4 = exp(xb4)/denom
gen p5 = exp(xb5)/denom

gen mpgbar = p4*[4]_b[mpg] + p5*[5]_b[mpg]
gen forbar = p4*[4]_b[foreign] + p5*[5]_b[foreign]

gen DmpgDp3 = p3*-mpgbar
gen DmpgDp4 = p4*([4]_b[mpg] - mpgbar)
gen DmpgDp5 = p5*([5]_b[mpg] - mpgbar)

gen DforDp3 = p3*-forbar
gen DforDp4 = p4*([4]_b[foreign] - forbar)
gen DforDp5 = p5*([5]_b[foreign] - forbar)
*--------------- end example ---------------------


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


    
    
        
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index