Bookmark and Share

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, is already up and running.

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

Re: st: gmm with two equations and one parameter

From   Wu Zhang <>
Subject   Re: st: gmm with two equations and one parameter
Date   Tue, 7 Jun 2011 18:00:42 -0700 (PDT)

I follow gmm help like "";; In my moment 
evaluator program, I do not specify names of parameter, just use  at[1,1], like:

program gmm_ivreg

version 11

syntax varlist [if] , at(name) rhs(varlist) depvar(varlist)

tempvar m
quietly gen double `m' = 0 `if'
local i 1
foreach var of varlist `rhs' {
quietly replace `m' = `m' + `var'*`at'[1,`i'] `if'
local `++i'
quietly replace `m' = `m' + `at'[1,`i'] `if'    // constant

quietly replace `varlist' = `depvar' - `m' `if'


Could you find something wrong if I put two alike programs for equation 1 and 2 


----- Original Message ----
From: Brian P. Poi <>
Sent: Tue, June 7, 2011 8:24:40 PM
Subject: Re: st: gmm with two equations and one parameter

On 06/07/2011 02:55 PM, Wu Zhang wrote:
> Hi, folks,
>     I am using 'gmm' in stata11 for two equations and one parameters; 
> the two equations are just first and second moments.
>      I am pretty sure I get the moment evaluator programs correct since they 
> separately; but when I put the equations together, I get the error message 'no
> parameter for equation 1'
>    Could some stata geeks make some comments?

Without seeing *exactly* what you typed, it's difficult to tell what 
went wrong.

Having said that, you get the error message "no parameters in equation 
#" if you specify a moment equation that does not have any parameters in 
it.  Perhaps you forgot to surround the name of your parameter in braces 

    -- Brian Poi
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index