# Re: st: mfx

 From "Arne Risa Hole" To statalist@hsphsun2.harvard.edu Subject Re: st: mfx Date Sat, 19 Jul 2008 12:43:29 +0100

```Joao,

What the code below does is plotting the marginal effect of the mpg
variable evaluated at different values, holding the price variable
constant at its mean. The x in the code represents the mpg variable -
see -help twoway function-.

Perhaps this is clearer:

sysuse auto
probit foreign price mpg
mfx
sum price
local mean_price = r(mean)
#delimit ;
twoway (function y = _b[mpg]*normden(_b[price]*`mean_price'+
_b[mpg]*x+_b[_cons]), range(mpg) ytitle(Marginal effect)
xtitle(Miles per gallon)) ;
#delimit cr

Arne

2008/7/19 Joao Ricardo F. Lima <jricardofl@gmail.com>:
> Dear,
>
> sorry the simple question. I am curious why I have to use "x" instead
> mpg (mean) in the twoway graph (..._b[mpg]*x+_b...)? Or better, what
> Stata understand when I type x in this command?
>
> Thanks a lot,
>
> Joao Ricardo
>
> 2008/7/18 Arne Risa Hole <arnehole@gmail.com>:
>> Hi Chiara,
>>
>>
>> sysuse auto
>> probit foreign price mpg
>> mfx
>> sum price
>> local mean_price = r(mean)
>> #delimit ;
>> twoway (function y = _b[mpg]*normden(_b[price]*`mean_price'+
>> _b[mpg]*x+_b[_cons]), range(mpg)) ;
>> #delimit cr
>>
>> This plots the marginal effect of the mpg variable over its range
>> following a probit regression. The logic is the same with -biprobit-
>> but the formula for the marginal effect will of course be a little
>> more intricate in that case.
>>
>> Arne
>>
>> 2008/7/18 Chiara Mussida <cmussida@gmail.com>:
>>> Dear All,nuous variab
>>> is there a way to "plot" the mfx of a continuous variable (after a
>>> biprobit) to infer its behaviour over the complete range of values and
>>> not only for the mean of the independent variables (which is the
>>> default)?
>>>
>>> Thanks
>>>
>>> --
>>> Chiara Mussida
>>> PhD candidate
>>> Doctoral school of Economic Policy
>>> Catholic University, piacenza (Italy)
>>> *
>>> *   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/
>>
>
>
>
> --
> -------------------------------
> Joao Ricardo Lima
> Professor
> UFPB-CCA-DCFS
> +553138923914
> -------------------------------
> *
> *   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
• From: "Joao Ricardo F. Lima" <jricardofl@gmail.com>
• References:
• st: mfx
• From: "Chiara Mussida" <cmussida@gmail.com>
• Re: st: mfx
• From: "Arne Risa Hole" <arnehole@gmail.com>
• Re: st: mfx
• From: "Joao Ricardo F. Lima" <jricardofl@gmail.com>