# Re: st: too large standard errors of marginal effects aftermultinomial logit model

 From dpeng@umsis.miami.edu To statalist@hsphsun2.harvard.edu Subject Re: st: too large standard errors of marginal effects aftermultinomial logit model Date Wed, 31 May 2006 10:56:29 -0400 (EDT)

```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?

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
>
> 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/
```