Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: New version of -sdecode- on SSC

From   "Roger B. Newson" <>
To   "" <>
Subject   st: New version of -sdecode- on SSC
Date   Mon, 22 Apr 2013 11:08:30 +0100

Thanks once again to Kit Baum, a new version of -sdecode- 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 -sdecode-.

The -sdecode- package is described as below on my website. In the new version, the -msdecode- module now performs any substitutions specified by the -xmlsub- option in string input variables, as well as in numeric input variables. (It does not perform them in the prefixes and suffixes specified by the -prefix()- and -suffix()- options, so these options have to be supplied with any XML substitutions already done.)

Best wishes


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
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

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

package sdecode from

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

      sdecode ("super decode") creates an output string variable with
      values from the input numeric variable varname, using labels if
      present and formats otherwise.  The output string variable may either
      replace the input numeric variable or be generated as a new variable
      named newvar.  Unlike decode, sdecode creates an output string
      variable containing the values of the input variable as output by the
      tabulate command and other Stata output, instead of decoding all
      unlabelled input values to missing.  sdecode is especially useful if
      a numeric variable has value labels for some values but not for
      others.  msdecode is a multivariate version of sdecode, which inputs
      a list of numeric or string variables and (optionally) a list of
      delimiters, and creates a single string variable, containing the
      concatenated values of all the input variables, decoded if necessary
      and separated by the delimiters if provided.

      Author: Roger Newson
      Distribution-Date: 19april2013
      Stata-Version: 11.0

INSTALLATION FILES                                  (click here to install)
(click here to return to the previous screen)
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index