[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Christoph Carl Basten <cc.basten@googlemail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: "mfx, predict at(...)" evaluated at CONDITIONAL means? |

Date |
Sun, 15 Mar 2009 20:57:43 +0100 |

Hi Martin and Eva,

. sysuse auto, clear . egen condmean_price = mean(price) if mpg==30 . egen condmean_weight = mean(weight) if mpg==30 . qui probit foreign mpg weight price . mfx, at(mpg=30 price=`condmean_price' weight=`condmean_weight')

Many thanks and best regards, Christoph Eva Poen wrote:

Christoph, I haven't had a closer look, but I think there is a very simple solution for your problem: you can simply use an if condition with -mfx-. Here is an example using the auto data: **** sysuse auto probit foreign mpg rep78 weight * marginal effects at conditional means of mpg and weight if rep78==3: mfx compute if rep78==3 * check if the last column really contains conditional means: sum mpg weight if e(sample) & rep78==3 **** I quickly checked Martin's solution, and it comes to the same results. Hope this helps, Eva 2009/3/15 Christoph Carl Basten <cc.basten@googlemail.com>:Hi, when estimating the marginal effects (using e.g. "mfx") after a Probit regression, I'd like to set one value (age) to a representative value, say 50 years, and have all other variables at the /conditional/ mean for those aged 50. From what I understand, if I specify only "mfx, predict at(age=50), Stata will set all other variables to the /population/ means, so the only way to have them set at the means conditional on age=50 would be to compute all these conditional means by hand and then specifying them manually in the atlist. But is there any option to tell Stata that I want age=50 and e.th. else at the conditional means? Thanks for your consideration and best regards, Christoph* * 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/

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

**Follow-Ups**:**Re: st: "mfx, predict at(...)" evaluated at CONDITIONAL means?***From:*"Martin Weiss" <Martin.Weiss1@gmx.de>

**References**:**st: "mfx, predict at(...)" evaluated at CONDITIONAL means?***From:*Christoph Carl Basten <cc.basten@googlemail.com>

**Re: st: "mfx, predict at(...)" evaluated at CONDITIONAL means?***From:*Eva Poen <eva.poen@gmail.com>

- Prev by Date:
**Re: st: Panel with minimum observations** - Next by Date:
**Re: st: Panel with minimum observations** - Previous by thread:
**Re: st: "mfx, predict at(...)" evaluated at CONDITIONAL means?** - Next by thread:
**Re: st: "mfx, predict at(...)" evaluated at CONDITIONAL means?** - Index(es):

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