Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: New -sencode- and -sdecode- packages on SSC


From   Roger Newson <[email protected]>
To   [email protected]
Subject   st: New -sencode- and -sdecode- packages on SSC
Date   Tue, 10 Feb 2004 20:48:49 +0000

Fellow Statalisters

Thanks to Kit Baum, there is now a new version of the -sencode- package, and a new package -sdecode-, available for download on SSC. In Stata, type -ssc desc sencode- or -ssc desc sdecode- to find out more.

-sencode- and -sdecode- are "super" versions of -encode- and -decode-, respectively, and are described as below on my website. Both packages now offer the user the choice of a -replace- option (which causes the output variable to replace the input variable) or a -generate()- option (which causes the output variable to be generated as a new variable). These options are similar to the options of the same name in the official Stata 8 packages -destring- and -tostring-, which also convert string variables to numeric and vice versa, respectively.

Best wishes

Roger

------------------------------------------------------------------------------------
package sencode from http://www.kcl-phs.org.uk/rogernewson/stata7
------------------------------------------------------------------------------------

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
user-specified ordering).

Author: Roger Newson
Distribution-Date: 09february2003
Stata-Version: 7

INSTALLATION FILES (click here to install)
sencode.ado
sencode.hlp
------------------------------------------------------------------------------------


------------------------------------------------------------------------------------
package sdecode from http://www.kcl-phs.org.uk/rogernewson/stata7
------------------------------------------------------------------------------------

TITLE
sdecode: Decode a numeric variable to string, formatting unlabelled values

DESCRIPTION/AUTHOR(S)
sdecode is an extended version of decode. It takes, as input, a numeric
variable, and generates, as output, a string variable, with values
corresponding to value labels of the numeric variable for labelled values,
and (optionally) formatted values of the numeric variable for unlabelled
values. The output string values therefore appear as the numeric input
values appear in output from the tabulate command. The output string
variable may replace the input numeric variable or be generated as a new
variable.

Author: Roger Newson
Distribution-Date: 10february2003
Stata-Version: 7

INSTALLATION FILES (click here to install)
sdecode.ado
sdecode.hlp
------------------------------------------------------------------------------------

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

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
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

*
* 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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index