Size: 238
Comment:
|
← Revision 15 as of 2023-06-07 18:54:07 ⇥
Size: 649
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 exposes a rich API for querying internal '''metadata'''. <<TableOfContents>> |
Line 9: | Line 11: |
== Quick Tips == | == Labels == |
Line 11: | Line 13: |
Stata has a number of interactive tools for examining metadata. | Variable and value labels are defined using the '''`label`''' command. |
Line 14: | Line 16: |
di _N // number of cases di c(k) // number of variables |
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("#. ") }}} ---- == Descriptives == {{{ display _N // number of cases display c(k) // number of variables |
Stata Metadata
Stata exposes a rich API for querying internal metadata.
Contents
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("#. ")
Descriptives
display _N // number of cases display c(k) // number of variables