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


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

Re: st: Moment evaluator programs with K equations


From   odongo kodongo <odongo.kodongo@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Moment evaluator programs with K equations
Date   Wed, 17 Feb 2010 17:03:34 +0200

Thanks Austin. I understand the parameter vector part of your explanation
now. However, I thought the `depvars' is a macro that contains the entire
list: "kenemr moremr and zaremr", just like its counterpart indvar may
contain variables A B and C. So, how am I supposed to provide the list of
left hand side variables?

On Wed, Feb 17, 2010 at 4:50 PM, Austin Nichols <austinnichols@gmail.com>wrote:

> Christopher Kodongo <Christopher.Kodongo@students.wits.ac.za>:
> But what is probably causing the error message comes later:
> replace `varlist' = `depvars' - `xb' `if'
> has `depvars' evaluating to three "words" (kenemr moremr zaremr),
> which makes no sense in Stata syntax, or as a subtraction problem.
>
> On Wed, Feb 17, 2010 at 9:48 AM, Austin Nichols <austinnichols@gmail.com>
> wrote:
> > Christopher Kodongo <Christopher.Kodongo@students.wits.ac.za>:
> > Probably several things are fundamentally wrong, but what jumps out at
> > me is that the parameter vector cannot be k by i, only 1 by i.
> > Did you send your message in HTML or plain text?  Only the latter is
> allowed.
> >
> > On Wed, Feb 17, 2010 at 9:43 AM, Christopher Kodongo
> > <Christopher.Kodongo@students.wits.ac.za> wrote:
> >>
> >> Dear statalisters
> >>
> >> Something appears to be fundamentally wrong with the following program.
> Trouble is - I can't spot it. Can you?
> >>
> >> program tryagain2, eclass
> >> version 11
> >> syntax varlist [if], at(name) depvars(varlist) indvars(varlist)
> >> quietly {
> >>     tempvar xb
> >>     generate double `xb' = 0 `if'
> >>     local k = 1
> >>     local i = 1
> >>     foreach var of varlist `depvars' {
> >>         foreach var of varlist `indvars' {
> >>             replace `xb' = `xb' + `at'[`k',`i']*`var' `if'
> >>             local `++i'
> >>         }
> >>         local `++k'
> >>     }
> >>     replace `xb' = `xb' + `at'[`k',`i'] `if'
> >>     replace `varlist' = `depvars' - `xb' `if'
> >> }
> >> end
> >>
> >> gmm tryagain2, nequations(3) parameters(wldemr usaemr _cons) ///
> >>     depvars(kenemr moremr zaremr) indvars(wldemr usaemr) ///
> >>     instruments(nigemr empemr zaremr) wmatrix(robust) vce(hac bartlett
> 2) igmm
> >>
> >> The output when I run it: INVALID MOREMR. (moremr is one of my dependent
> variables).
> >> THANK YOU.
> >>
> >
>
> *
> *   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/
>
*
*   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/


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