Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: Easy N-equation GMM syntax

 From Gulsum Akarsu To "statalist@hsphsun2.harvard.edu" Subject Re: st: Easy N-equation GMM syntax Date Mon, 18 Feb 2013 04:05:22 -0800 (PST)

```Hi,

For OLS estimation, to repeat the estimation for all the countries one by one, I have used the following loop;

forvalues i = 1(1)29 {
display "OLS regression for group " `i'
regress y x1 x2 x3 x4 if countdum==`i'
}

But, first you need to generate a variable (here, countdum) that takes value 1 for the first country, 2 for the second country,...and so on.
Maybe, you can also use such a loop.

Regards,

----- Original Message -----
From: "Whelan, Paul" <paul.whelan07@imperial.ac.uk>
To: "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Cc:
Sent: Friday, February 15, 2013 3:49 PM
Subject: st: Easy N-equation GMM syntax

Hi,

I would like to estimate N linear equations in a GMM framework in order
to test the significance of some subset of parameters across equations. i.e.,
on a country by country basis individually I would do:

by country: ivreg2 Y X1 X2, bw(12) kernel(bartlett) robust

If N = 2, I would create individual Y's and X's for each N=1,2 and do :

gmm (eq1: Y_1 - {alpha01} - {beta11}*X11 - {beta12}*X12}), ///
(eq2: Y_2 - {alpha02} - {beta21}*X21 - {beta22}*X22}), ///
instruments(eq1: X11 X12) ///
instruments(eq2: X21 X22) ///

However, if N = 20 ... what is the efficient way of doing this ?

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

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