Stata tip 99: Taking extra care with encode

Research output: Contribution to journalArticle

1 Citation (Scopus)

Abstract

Encode (see [D] encode) has long been one of Stata's basic data-management commands. encode maps the distinct strings of a string variable to an integer-valued numeric variable for which the strings become value labels. Unless you specify a preexisting set of value labels through its label() option, encode uses the alphanumeric order of distinct string values present in the dataset to determine numeric values 1, 2, 3, and so on. Thus if "a", "b", and "d" were the distinct values of a variable, svar, in one dataset, then typing.

Original languageEnglish (US)
Pages (from-to)321-322
Number of pages2
JournalStata Journal
Volume11
Issue number2
StatePublished - 2011

Fingerprint

Strings
Numerics
Distinct
Alphanumeric
Data Management
Integer

ASJC Scopus subject areas

  • Mathematics (miscellaneous)

Cite this

Stata tip 99 : Taking extra care with encode. / Schechter, Clyde B.

In: Stata Journal, Vol. 11, No. 2, 2011, p. 321-322.

Research output: Contribution to journalArticle

@article{4120dcce055a429d91ade31671ca2399,
title = "Stata tip 99: Taking extra care with encode",
abstract = "Encode (see [D] encode) has long been one of Stata's basic data-management commands. encode maps the distinct strings of a string variable to an integer-valued numeric variable for which the strings become value labels. Unless you specify a preexisting set of value labels through its label() option, encode uses the alphanumeric order of distinct string values present in the dataset to determine numeric values 1, 2, 3, and so on. Thus if {"}a{"}, {"}b{"}, and {"}d{"} were the distinct values of a variable, svar, in one dataset, then typing.",
author = "Schechter, {Clyde B.}",
year = "2011",
language = "English (US)",
volume = "11",
pages = "321--322",
journal = "Stata Journal",
issn = "1536-867X",
publisher = "DPC Nederland",
number = "2",

}

TY - JOUR

T1 - Stata tip 99

T2 - Taking extra care with encode

AU - Schechter, Clyde B.

PY - 2011

Y1 - 2011

N2 - Encode (see [D] encode) has long been one of Stata's basic data-management commands. encode maps the distinct strings of a string variable to an integer-valued numeric variable for which the strings become value labels. Unless you specify a preexisting set of value labels through its label() option, encode uses the alphanumeric order of distinct string values present in the dataset to determine numeric values 1, 2, 3, and so on. Thus if "a", "b", and "d" were the distinct values of a variable, svar, in one dataset, then typing.

AB - Encode (see [D] encode) has long been one of Stata's basic data-management commands. encode maps the distinct strings of a string variable to an integer-valued numeric variable for which the strings become value labels. Unless you specify a preexisting set of value labels through its label() option, encode uses the alphanumeric order of distinct string values present in the dataset to determine numeric values 1, 2, 3, and so on. Thus if "a", "b", and "d" were the distinct values of a variable, svar, in one dataset, then typing.

UR - http://www.scopus.com/inward/record.url?scp=79960778345&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=79960778345&partnerID=8YFLogxK

M3 - Article

AN - SCOPUS:79960778345

VL - 11

SP - 321

EP - 322

JO - Stata Journal

JF - Stata Journal

SN - 1536-867X

IS - 2

ER -