Differences between revisions 1 and 14 (spanning 13 versions)
Revision 1 as of 2020-01-29 19:47:10
Size: 238
Comment:
Revision 14 as of 2023-06-07 18:50:35
Size: 925
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Metadata = = Stata Metadata =
Line 3: Line 3:
Data about data. Stata offers human-readable variable names, variable labels, variable printing formats, and value labels.

Stata stores variable labels and value labels in a separate database. Many built-in commands seamlessly pull in metadata from that database, but there are notable exceptions.

<<TableOfContents>>

----



== Labels ==

Variable and value labels are defined using the '''`label`''' command.

{{{
label variable foo "yes or no?"
label define yesno 1 "Yes" 0 "No"
label values foo yesno
}}}

See [[Stata/Label|here]] for more options.

Numeric values can be quickly prepended to value labels using the '''`numlabel`''' command.

{{{
numlabel foo, add mask("#. ")
}}}

Stata Metadata

Stata offers human-readable variable names, variable labels, variable printing formats, and value labels.

Stata stores variable labels and value labels in a separate database. Many built-in commands seamlessly pull in metadata from that database, but there are notable exceptions.


Labels

Variable and value labels are defined using the label command.

label variable foo "yes or no?"
label define yesno 1 "Yes" 0 "No"
label values foo yesno

See here for more options.

Numeric values can be quickly prepended to value labels using the numlabel command.

numlabel foo, add mask("#. ")


Quick Tips

Stata has a number of interactive tools for examining metadata.

di _N    // number of cases
di c(k)  // number of variables


CategoryRicottone

Stata/Metadata (last edited 2025-10-24 15:58:53 by DominicRicottone)