Thanks yet again to Kit Baum, a new version of the -sencode- package is
now available for download from SSC. In Stata, use the -ssc- command to
do this, or -adoupdate- if you already have an old version of -sencode-.
The -sencode- package is a "super" version of -encode-, and is described
as below on my website. The new version adds a -mforst- suboption for
the -gsort()- option. It also has a .sthlp on-line help file to replace
the old .hlp on-line help file.
Best wishes
Roger
--
Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/
Opinions expressed are those of the author, not of the institution.
------------------------------------------------------------------------------------
package sencode from http://www.imperial.ac.uk/nhli/r.newson/stata10
------------------------------------------------------------------------------------
TITLE
sencode: Encode a string variable non-alphanumerically into a
numeric variable
DESCRIPTION/AUTHOR(S)
sencode is an extended version of encode. It takes, as input, a
string
variable, and generates, as output, a numeric variable, with
value labels
corresponding to values of the string variable. The output
numeric variable
may replace the input string variable or be generated as a new
variable.
sencode orders the numeric values corresponding to string values
in the
sequential order of appearance in the input string variable in
the data set,
or in another order specified by the user, instead of ordering
them in
alphanumeric order of the string value, as encode does. The
mapping from
numeric code values to string labels may be one-to-one (coded in
order of
first appearance of the string value) or many-to-one (coded in each
observation by the position of that observation in the data set,
or in the