Nick and Roger,
I tried both, and obviously missed something important in Nicks solution
which might well be something simple... My problem is solved as Rogers
solution works fine, but Nick, if you can have another look at your
solution I would appreciate it, as it seems to be a nice solution too
See here my commands and Stata's reply's:
. renvars _Iherkomst_* \ morocco somalia turkey suriname antilles
ceeurope asia africa latamerica other
\ invalid name
r(198);
So, what is the \ supposed to be? after reading -help renvars- I thought
it might have to be replaced by a comma, which resulted in...
. renvars _Iherkomst_*, morocco somalia turkey suriname antilles
ceeurope asia africa latamerica other
morocco invalid
r(198);
I think this is getting closer to the real problem, morocco is the
label, attached to the value 1 of origin, so _Iorigin_1 should be
renamed in _Iori_morocco or something similar, but (I guess) morocco was
'lost' earlier, namely when specifying -xi: ... i.origin- so I can
imagine Stata doesn't understand morocco, but I do not know how to solve
this.
Thank you both
Nick Cox wrote:
>
> Roger Newson on using -rename- under the aegis of -for-:
> >
> > One simple possibility is to use the -rename- command; see
> > the manual under -[R] rename-. Annelies might type
> >
> > for X in numlist 1(1)10) \ Y in any morocco somalia britain
> > holland usa
> > belgium china ecuador venezuela uzbekistan:rename
> > _Iorigin_X _Iori_Y
> >
> > This uses the -for- command to do a lot of repeats; see
> > -help for- or the
> > manuals under -[R] for-.
>
> It may be of interest to compare this with the -renvars-
> syntax recommended in my earlier posting.
>
> renvars _Iorigin_* \ morocco somalia britain holland usa
> belgium china ecuador venezuela uzbekistan
>
> renvars morocco-uzbek, pref(_I_ori_)
>
> Swings and roundabouts, as we say hereabouts.
>
> Nick
> [email protected]
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
--
A.M. Vos
dept. of Public Health
Erasmus MC
University Medical Center Rotterdam
P.O. Box 1738
3000 DR Rotterdam
The Netherlands
Tel: +31 (10) 4087502
Fax: +31 (10) 4089449
email: [email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/