Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: conditions based on stored results after model estimation in forvalues loop


From   Abdul Adam <[email protected]>
To   [email protected]
Subject   st: conditions based on stored results after model estimation in forvalues loop
Date   Thu, 21 Nov 2013 11:37:25 +0100

Dear Stata Community
I have run a model and the plan was to use the stored coefficients in
a forvalues loop like this:

forvalues i=1/5 {
forvalues j=1/5 {
nlcom e`i'`j': capphi`i'_mean*(((_b[/g`i'`j'])-
(_b[/b`i']*w`j'_mean))/(w`i'_mean*(1-(_b[/lag`i']))))
}
}

The problem I am facing is because of symmetry restrictions, g`i'`j' =
g`j'`i', since these should be equal only  g`i'`j' are included in the
model, and hence in the stored coefficient matrix. for instance there
is g12 in the stored results, but not g21. When I run the loop, it is
OK, until it reaches g21, after which it stops and shows:

equation g21 not found
r(111);


This is because there is no g21 included in the model, BUT since
g21=g12, that is not a problem. The problem is: I could not find a way
to tell Stata, that when it sees _b[/g21] it should instead use
_b[/g12].

Therefore, I would appreciate if anyone could help me figure out how
to convince Stata that when it sees _b[/g`j'`i'] AND it cannot find
this coefficient, then it should replace it with _b[/g`i'`j'].

Kind Regards
Abdul Adam
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index