Statalist


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

Re: st: Marginal effects


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Marginal effects
Date   Sun, 20 Apr 2008 13:32:01 +0100 (BST)

The marginal effects in -mlogit- get a bit ugly, that is the
computation is not difficult, it is just long so many opportunities to
make a typo, see for instance:
http://www.stata.com/statalist/archive/2007-09/msg00505.html

-- Maarten

--- "Joao Ricardo F. Lima" <jricardofl@gmail.com> wrote:

> Maarten and Statalisters,
> 
> I'm having this same problem to calculate marginal effects but using
> mlogit.
> First I don't know how to calculate the xb only to the outcome==1,
> for example.
> Second I can't use normalden and I don't find the density function
> logistic in Stata.
> 
> > #delimit ;
> > local xb "_b[_cons] +
> >          _b[grade]*`mgr' +
> >          _b[grade2]*`mgr'^2 +
> >          _b[ttl_exp]*`mttl' +
> >          _b[ttl_expXgrade]*`mttl'*`mgr' " ;
> >
> >
> > nlcom normalden(`xb') *
> >      (_b[grade] + 2*_b[grade2]*`mgr' +
> >       _b[ttl_expXgrade]*`mttl') ;
> > #delimit cr
> 
> 
> Could you please give me an advice?
> 
> Thank you,
> 
> Joao Ricardo
> 
> 2008/3/22, Maarten buis <maartenbuis@yahoo.co.uk>:
> > --- Josť C. <jcreu@bol.com.br> wrote:
> > >   Maarten specifically thinking about the case of Probit - not
> always
> > > the product of the variables includes a variable dummy. For
> instance,
> > > as independent variables some models consider:
> > >
> > >   y education education(to the square) experience
> > > educationXexperience
> > >
> > >  If I use a command as the mfx - the marginal effect just
> considers
> > > the associated coefficient the education and the correct would
> be:
> > >
> > > dy/d.education = 1 + 2.education(mean) + experience (mean) - if I
> use
> > > mfx with medium effects.
> > >
> > >  Some statistical packages allow logical (as product of terms)
> > > operations and later the linearization of the equations. In
> Stata, I
> > > already have to do that creating variables before defining the
> > > equation. To estimate the equation in itself - that doesn't cause
> any
> > > problem but to establish marginal effects. I easily can calculate
> the
> > > marginal effects manually starting from the equation but I don't
> have
> > > s.e. or intervals of the estimates.
> >
> > As I said, I was trying to interpret your question. I assumed you
> had a
> > dummy because you refered to logical operations (AND, OR, NOT,
> which
> > result in either true (1) or false (0)) instead of arithmatic
> > operations (addition, multiplication, etc).
> >
> > Notice that the formula you give is the marginal effect of
> education on
> >
> > the linear predictor (xb) and not on the probability. Below is an
> > example that shows you the marginal effect of education (grade) for
> > average values on all explanatory variables. However, I don't think
> > that it is a good idea to add all kinds of non-linearities to your
> > model and than try to summarize the effect with one number. That
> > defeats the very purpose of adding those non-linearities. For
> instance,
> > you add interactions because you think that the effect of education
> is
> > different for people with different amounts of experience. By
> > summarizing the effect of eductation with 1 number you throw all
> that
> > information away again.
> >
> > *------------- begin example ---------------------
> > sysuse nlsw88, clear
> >
> > gen grade2 = grade^2
> > gen ttl_expXgrade = ttl_exp*grade
> > probit union grade grade2 ttl_exp ttl_expXgrade
> >
> > sum grade if e(sample)
> > local mgr = r(mean)
> > sum ttl_exp if e(sample)
> > local mttl = r(mean)
> >
> >
> > #delimit ;
> > local xb "_b[_cons] +
> >          _b[grade]*`mgr' +
> >          _b[grade2]*`mgr'^2 +
> >          _b[ttl_exp]*`mttl' +
> >          _b[ttl_expXgrade]*`mttl'*`mgr' " ;
> >
> >
> > nlcom normalden(`xb') *
> >      (_b[grade] + 2*_b[grade2]*`mgr' +
> >       _b[ttl_expXgrade]*`mttl') ;
> > #delimit cr
> > *-------------- end example ---------------------
> > (For more on how to use examples I sent to the Statalist, see
> > http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )
> >
> > Hope this helps,
> > Maarten
> >
> > -----------------------------------------
> > 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/
> > -----------------------------------------
> >
> >
> >      __________________________________________________________
> > Sent from Yahoo! Mail.
> > More Ways to Keep in Touch. 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/
> >
> 
> 
> -- 
> -------------------------------
> Joao Ricardo Lima
> Professor
> UFPB-CCA-DCFS
> +553138923914
> -------------------------------
> 
> *
> *   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/
> 


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


      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email 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/



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