Stata tip 99: Taking extra care with encode

1Citations
Citations of this article
7Readers
Mendeley users who have this article in their library.

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. © 2011 StataCorp LP.

Cited by Powered by Scopus

Speaking stata: Seven steps for vexatious string variables

0Citations
N/AReaders
Get full text

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Cite

CITATION STYLE

APA

Schechter, C. (2011). Stata tip 99: Taking extra care with encode. Stata Journal, 11(2), 321–322. https://doi.org/10.1177/1536867x1101100213

Readers' Seniority

Tooltip

Lecturer / Post doc 3

43%

Professor / Associate Prof. 2

29%

PhD / Post grad / Masters / Doc 2

29%

Readers' Discipline

Tooltip

Medicine and Dentistry 3

43%

Economics, Econometrics and Finance 3

43%

Business, Management and Accounting 1

14%

Save time finding and organizing research with Mendeley

Sign up for free