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: foreach for interaction term


From   daniel klein <klein.daniel.81@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: foreach for interaction term
Date   Tue, 24 May 2011 16:41:46 +0200

Oliver is assuming that the local `foreign' (now `x') contains
something, but I guess (one of the) problem(s) is that it does not
contain anything at all.

There are minor issues I would like to address first.

1. When looping over any_list, you have to use -in- not -of- (see help foreach).
2. The local name must not be given in -foreach lname-, not it's
content (see help foreach).
3. The use of  wildcards like (*ger) inside the loop will not do what
you probably expect. How is Stata supposed to calculate `x'_ims *
usager belger chinbrd ...?

It is hard to give better advice, but I guess you need to loop over
two lists (of country names)?

Best
Daniel
*
*   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