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   Fri, 22 Mar 2013 13:44:32 +0000

Thanks as always to Kit Baum, a new version of the -sdecode- package is now available for download from SSC. In Stata, use the -ssc- package 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 allows string variables (already decoded) in the -varlist-. This can save a bit of typing if we are combining a mixture of numeric and string variables in 1 column, as in a column of a table combining estimates, confidence limits and P-value stars.

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: 19march2013
      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