Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: New version of -sdecode- on SSC

From   Roger Newson <>
To   "" <>
Subject   st: New version of -sdecode- on SSC
Date   Tue, 8 Jun 2010 19:46:37 +0100

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

The -sdecode- package is a "super" version of -decode-, and is described as below on my website. The new version fixes a rarely-encountered and very confusing bug, which previously caused problems if the encoded variable had value labels and the decoded variable took up more memory than was available. Under these circumstances, -sdecode- would get its decoded values using the display format of the encoded variable. This is fortunately fixed in the new version.

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

      Author: Roger Newson
      Distribution-Date: 07june2010
      Stata-Version: 11

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

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index