[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Extended macro problem
At 00:17 01/06/04 -0700, Kaleb wrote (in reply to Fred):
Or Fred could have written the malfunctioning line as
You're going to groan yourself when you see the error. Everything's fine,
but you're assuming the name of the label values is the same name as the
categorical variable. In the case of sex, it works out, but edcat's label
is edcode2 and what the code basically does is:
local edcatlab0 : label edcat 0
when what you really want is:
local edcatlab0 : label edcode2 0
Just add a line that grabs the correct label value name before this and
you should be good.
local `catvar'lab`num': label (`catvar') `num'
(note the parentheses), which refers to the label of the variable stored in
the macro -catvar-. See -[P] macro- for details.
Or, alternatively, Fred might like to use the -factext- package,
downloadable from my website. (A fully up to date version should be on SSC
as soon as Kit gets back to Boston.) The -factext- package inputs the
-label- variable in a -parmby- output and re-creates the categorical
factors, sometimes with help from the -descsave- package, which is also on
SSC. The categorical factors can then be used in plots and tables.
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: