|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: RE: Using GMM with Moment-Evaluator Program
Thank you Prof. It worked!
----- Original Message -----
From: Nick Cox <[email protected]>
Date: Tuesday, February 16, 2010 6:42 pm
Subject: st: RE: RE: Using GMM with Moment-Evaluator Program
To: [email protected]
> The point is that without the ` ' indicating a local macro,
> Stata looks
> for a variable with the name (or abbreviation) varlist, but
> can't find
> it. Indeed, that's precisely what it told you.
>
> Nick
> [email protected]
>
> Nick Cox
>
> Your claim is incorrect.
>
> replace varlist
>
> should be
>
> replace `varlist'
>
> In addition,
>
> if
>
> should be
>
> [if]
>
> although that's not biting you.
>
> Nick
> [email protected]
>
> odongo kodongo
>
> I am trying to run the following program, which in all respects, is
> similar
> to the illustration given in the "Help GMM" of Stata 11/SE.
>
> program tryagain
> version 11
> syntax varlist if, at(name) rhsvar(varlist) lhsvar(varlist)
> quietly {
> tempvar xb
> generate double `xb' = 0 `if'
> local i = 1
> foreach var of varlist `rhsvar' {
> replace `xb' = `xb' +
> `at'[1,`i']*`var' `if' // coefficients
> local `++i'
> }
> replace `xb' = `xb' + `at'[1,`i']
> `if' // constant
> term
> replace varlist = `lhsvar' - `xb'
> `if' // model's
> residuals
> }
> end
>
> When I run it, I get the following error messages:
>
> error calling tryagain at initial values
> variable varlist not found
> r(111);
>
> end of do-file
>
> r(111);
>
> Going through the archives, I realized that another user, Laszlo
> Sandor,had
> a more or less similar problem on October 29, 2009. However, the
> responses
> he received do not seem useful in getting me out of my predicament.
>
> Can someone help me discover the source of the error?
>
> *
> * 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/
This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorized signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.
|