 Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Re: Adding the marginal effects at individual values of

 From "Solomon Tesfu" To Subject Re: st: Re: Adding the marginal effects at individual values of Date Mon, 22 Feb 2010 21:46:30 -0500

```Thanks a lot Kit, Maarten and Richard for your help. Maarten, I see your point and I'll take that into account while interpreting the results.

Solomon

>>> Kit Baum <baum@bc.edu> 02/22/10 8:55 PM >>>
<>

set more off
clear all
use "http://www.indiana.edu/~jslsoc/stata/spex_data/ordwarm2.dta";, clear
logit  warmlt2 age ed prst, nolog
// for a continuous variable that takes on discrete values,
// evaluate the average marginal effect at each such value
margins, dydx(ed) at(ed=(0/20))
mat ameed = r(b)'
mat li ameed

g ed2 = ed*10
logit  warmlt2 age ed2 prst, nolog
margins, dydx(ed2) at(ed=(0(10)200))
mat ameed2 = 10 * r(b)'
mat li ameed2

mat diff = (ameed - ameed2)
mat li diff

Remember that the probit model is linear in the latent (index) variable I = X b. The nonlinearity arises when you evaluate the Normal CDF.  Just as in regression, multiplying X by k gives you b* = b / k.

On Feb 22, 2010, at 8:26 PM, Solomon Tesfu wrote:

> I'm sorry about this but I'm not sure why the MEs calculated at -60, -59, -58,...,58, 59, 60 should be  related to those at -6.0,  -5.9, -5.8,..., 5.8, 5.9, 6.0 in a heavily non-linear model like probit . Are you suggesting that they are equivalent or proportional or...?
>
> Thanks again,
>
> Solomon
>
>>>> Christopher Baum <baum@bc.edu> 02/22/10 1:33 PM >>>
> As I said in an earlier message, you can do this on a fine grid.
> Multiply the variable of interest by 10 and it will range from -60 to
> +60, and you can step through those 120 integers and calculate AMEs
> for each of them, corresponding to the original variable evaluated at
> -6.0, -5.9, -5.8, ...
>
> I suggest making integer-valued 'buckets' out of this to make exact
> comparisons hassle-free.
>
> Kit Baum   |   Boston College Economics and DIW Berlin   |   http://ideas.repec.org/e/pba1.html
> An Introduction to Stata Programming   |   http://www.stata-press.com/books/isp.html
> An Introduction to Modern Econometrics Using Stata   |   http://www.stata-press.com/books/imeus.html
>
> On Feb 22, 2010, at 1:09 PM, Solomon Tesfu wrote:
>
>> Thanks again for your helpful suggestions . When I said the AME does
>> not show the variations in the ME at various levels of the regressor
>> I was refering to the AME calculated using the entire set of
>> observations. Yes, I can see the pattern in the AME by calculating
>> it for successively increasing intervals of the observed values of
>> the regressor. But my undertanding of the syntax you suggested was
>> that it calculates the MEs at only integer points (not the AMEs for
>> intervals of values) and adds them to the data as an additional
>> variable. The observed values of my variable of interest range
>> between -6 and 6 and the sample size is 2400. If I round off all the
>> observed values to the nearest integers and calculate the MEs only
>> at integer points that will still be informative but will hide some
>> details. Anyway, I think I have sufficient inputs from you guys and
>> I'll work on it.
>>
>> Solomon
>>
>>>>> Kit Baum <baum@bc.edu> 02/22/10 7:27 AM >>>
>> On Feb 22, 2010, at 2:33 AM, Solomon wrote:
>>
>>> Thanks again Kit and Richard, for your ideas. I understand that I
>>> cannot talk about precision of the estimates  at each point of
>>> observation but once I get the estimates I can plot them against
>>> the values of the variable and look at the pattern. This is
>>> important because I have a reason to believe that the marginal
>>> effects  will be different at high and low values of the regressor
>>> and the AME or the marginal effect at mean do not help me to verify
>>> this possibility.
>>
>> I don't see, then, how calculating AMEs at various points in the
>> regressor space would not 'verift this possibility'. If you take the
>> continuous variable you have and 'bin' it into ranges---which can be
>> as many as you can handle, given matsize---you can calculate the
>> AMEs at very-very-low, very-low, low, low+, low++, low+++, etc.
>> values of that regressor. Depending on your sample size and the
>> capacity of Stata (e.g., Stata/SE or Stata/MP can handle larger
>> matrices) you could calculate AMEs on a very fine grid of values of
>> the regressor, and 'look at the pattern'. Why does this not answer
>> the question you'd like to pose to the data?
>>
>> If AMEs differ across levels of income, I don't need to use an
>> income of \$54,321 to verify that. An income of \$55,000 would work,
>> as long as its AME is clearly distinct from that of income = \$5,000.
>>
>> Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
>>                             An Introduction to Stata Programming
>> |   http://www.stata-press.com/books/isp.html
>>  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html
>>
>>
>> *
>> *   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/
>

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html

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