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

# Re: st: -nlcom-, delta method, and the derivative

 From [email protected] (Roberto G. Gutierrez, StataCorp) To [email protected] Subject Re: st: -nlcom-, delta method, and the derivative Date Sun, 23 Jan 2011 10:55:32 -0600

```Kristian Karlson <[email protected]> writes:

> I am using -nlcom- to get the standard error of a complex transformation of
> a regression coefficient of interest. -nlcom- applies the delta method to
> get the standard error. I have also done manual calculations of the standard
> error. However, I obtain different results than those produced by -nlcom-. A
> Monte Carlo study moreover suggests that the SE produced by -nlcom- is much
> better than my manual calculation. I would like to inspect the differences,
> because I suspect the differences to exist in the derivatives.

> Is it possible for me to obtain the derivative calculated by -nlcom-? I
> haven't been able to find any information on this. In the documentation, I
> would like to see the G in GVG'.

Not directly from -nlcom-, but you can get the equivalent from -testnl-, which
is called by -nlcom- anyway.

. sysuse auto, clear
. regress mpg foreign
. nlcom (_b[foreign])^2
. testnl (_b[foreign])^2 = 0

-testnl- returns the derivative matrix in r(G):

. return list
. mat list r(G)

the second element of which (the derivative of the expression wrt -foreign-,
the second coefficient of e(b)) will coincide with

. di 2*_b[foreign]

--Bobby
[email protected]
*
*   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/
```