Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
Murat Genc <murat.genc@otago.ac.nz> |

To |
"'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: Standard errors of certain quantities after estimating a system of equations |

Date |
Thu, 7 Mar 2013 09:48:29 +0000 |

Dear Statalist, I've estimated a system of 24 equations and I am calculating some quantities using the estimated coefficients. The formula for the quantities I calculate involves some scalars (which are actually average values of some variables that enter the estimated equations) and the estimated coefficients. My goal is to obtain the standard errors of these quantities. So, I use the predictnl comment. This works fine, but it takes a long time. (I have 24*24 quantities, and it takes about 20 hours.) The set of commands I use is forvalue i=1/4 { forvalue j=1/4 { if `i'==`j'{ nlcom e`i'_`j': -1+(1/w`i'bar)*((pdfp`i'bar*coeflnp`j'eq`i'*(w`i'hatbar-[w`i']pdfp`i'*pdfp`i'bar)/cdfp`i'bar)+cdfp`i'bar*([w`i']shlnp`j'`i'-[w`i']lfp`i'*w`j'bar)-[w`i']pdfp`i'*pdfp`i'bar*coeflnp`j'eq`i'*pr`i'bar),post } else { nlcom e`i'_`j': (1/w`i'bar)*((pdfp`i'bar*coeflnp`j'eq`i'*(w`i'hatbar-[w`i']pdfp`i'*pdfp`i'bar)/cdfp`i'bar)+cdfp`i'bar*([w`i']shlnp`j'`i'-[w`i']lfp`i'*w`j'bar)-[w`i']pdfp`i'*pdfp`i'bar*coeflnp`j'eq`i'*pr`i'bar),post } } } [w`i'] refers to the estimated equation. My question is whether there is a better way of doing this so that it won't take such a long time. I saw the question about "Using Delta Method with Estimated Marginal Effects from a Tobit Model" yesterday. The solution suggested looked very neat, and I tried to do something similar but it didn't work. The solution suggested by Maarteen there used the margins command in combination with nlcom. Based on that I tried the following margins, dydx(*) predict(equation(w1)) post nlcom e1_2: -1+(1/w1bar)*((pdfp1bar*coeflnp2eq1*(w1hatbar-[w1]pdfp1*pdfp1bar)/cdfp1bar)+cdfp1bar*([w1]shlnp21-[w1]lfp1*w2bar)-[w1]pdfp1*pdfp1bar*coeflnp2eq1*pr1bar) to do the calculation for one case. But when I try it I get an error message that says "option nlcom not allowed." I'll appreciate any suggestion that will make the calculations faster. Murat * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: RE: Standard errors of certain quantities after estimating a system of equations***From:*Rebecca Pope <rebecca.a.pope@gmail.com>

**References**:**st: Using Delta Method with Estimated Marginal Effects from a Tobit Model***From:*Selahattin Selsah Pasali <selsahpasali@gmail.com>

**Re: st: Using Delta Method with Estimated Marginal Effects from a Tobit Model***From:*Maarten Buis <maartenlbuis@gmail.com>

- Prev by Date:
**Re: st: A layman question on model building** - Next by Date:
**Re: st: spreg gs2sls** - Previous by thread:
**Re: st: Using Delta Method with Estimated Marginal Effects from a Tobit Model** - Next by thread:
**Re: st: RE: Standard errors of certain quantities after estimating a system of equations** - Index(es):