Virata manual

label

Attaches readable text to a column, or to the codes inside it.

What we have

  • label variable for a description
  • label define and label values for the words behind the codes
  • label list to see what is defined
  • labels read from a .dta and labels made by encode

Coming later

  • label language, for more than one set of labels at a time

How you write it

label variable var "text"   |   label define name 1 "a" 2 "b"   |   label values var name

Square brackets mean optional. A vertical bar means choose one.

What it does

Two separate jobs that share a word.

label list shows what you have defined.

Try it

Every example below was run after sysuse vira.sample02, clear.

. label variable mpce "Monthly spend"
The same thing in pandas and in R

R

# no R form for `label` yet -- see docs/r-equivalents.md
. label list
sector:
           1 Rural
           2 Urban
sex:
           1 Male
           2 Female
The same thing in pandas and in R

R

# no R form for `label` yet -- see docs/r-equivalents.md

Nearby

generate replace egen recode rename order