Duan:
Richard's comments were actually more practical than mine. -margeff- does more or less the same thing as I proposed, but is a lot easier to use (and thus less chances for bugs). You could also use the -prchange- command from Scott Long's and Jeremy Freese's very useful -spost- package, see: -findit spost-.
In my code the marginal effects were computed with the -nlcom- command and I compared them with the output of -mfx-. It was there originally for me check whether I got my equations right, and in your application I would assume you would use both commands to compare and see if the two are different. However, I would use the -margeff- or -prchange- commands instead of my code.
HTH,
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of dpeng@umsis.miami.edu
Sent: woensdag 31 mei 2006 16:56
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: too large standard errors of marginal effects after multinomial logit model
Hi Maarten,
Thank you very much. I want to try this way to calculate the standard errors of
marginal effects. As I go through your code, I am not sure about each step. Are
you using "nlcom" command to transform the coefficient estimates from the
mlogit to marginal effects, then why are you still using "mfx" command at last?
Could you please explain more about it? Thanks a lot.
Duan
Duan Peng
Department of Economics
University of Miami
Quoting Maarten buis <maartenbuis@yahoo.co.uk>:
> --- dpeng@umsis.miami.edu wrote:
> > When I calculate the marginal effects after multinomial logit model
> > using the command "mfx compute, predict (outcome(1))", Stata gives me
> > very large standard errors and all p values are equal to 1. Dose
> > anyone know the reason of this problem and how to solve it?
>
> You can try to calculate the marginal effects and their standard error
> using the -nlcom- command. If these standard errors are more reasonable
> than apperently the numerical procedure -mfx- ran into trouble in your
> particular dataset.
>
> Calculating the marginal effects in a multinomial logit models gets a
> bit ugly, and it is getting late here, so for now I will just give you
> example code, and if required I will explain a bit about it tomorrow.
>
> HTH,
> Maarten
>
> *-------------- begin example -----------------
> sysuse auto, clear
> recode rep78 2=1 3=1 4=2 5=3
> mlogit rep78 foreign mpg
>
> sum foreign if e(sample)
> scalar mfor = r(mean)
> sum mpg if e(sample)
> scalar mmpg = r(mean)
>
> local exp2 "exp([2]_cons + [2]foreign*scalar(mfor) +
> [2]mpg*scalar(mmpg))"
> local exp3 "exp([3]_cons + [3]foreign*scalar(mfor) +
> [3]mpg*scalar(mmpg))"
>
> local p1 "1/(1 + `exp2' + `exp3')"
> local p2 "`exp2'/(1 + `exp2' + `exp3')"
> local p3 "`exp3'/(1 + `exp2' + `exp3')"
>
> nlcom (foreign: `p1'*(0-(`p2'*[2]foreign + `p3'*[3]foreign))) /*
> */(mpg: `p1'*(0-(`p2'*[2]mpg + `p3'*[3]mpg)))
>
> mfx compute, predict (outcome(1)) nodiscrete
> *--------------------- end example ------------------
>
>
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting adress:
> Buitenveldertselaan 3 (Metropolitan), room Z214
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
> Send instant messages to your online friends
> http://uk.messenger.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/
>
*
* 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/
*
* 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/