[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: more informative names of dummy vars
At 11:13 10/12/02 +0100, Annelies Vos wrote:
One simple possibility is to use the -rename- command; see the manual under
-[R] rename-. Annelies might type
I'm using: -xi: poisson patient i.origin- and so on.
Origin refers to country of origin of the patients and is coded 1,2,..10
and each value is labeled like "Morocco", "Somalia" etc.
Now, when I perform -poisson- (or any other command using -xi-) I get
_Iorigin_1, _Iorigin_2 etc. Instead, I would like to get something like:
_Imorocco, _Isomalia etc. or _Iori_moroc, _Iori_somal etc. that would
make the outcomes readable...
Does anyone know whether it is possible to name the dummies depending on
the labels of the values of the variable they refer to?
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
poisson patient _Iori*
This uses the -for- command to do a lot of repeats; see -help for- or the
manuals under -[R] for-.
A slightly more advanced way might involve the use of the -parmest-,
-descsave- and -factext- packages. A tutorial on the use of these is
available at the Stata User Meetings website at
However, the simple way will do what Annelies wants.
I hope this helps.
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Opinions expressed are those of the author, not the institution.
* For searches and help try: