help exampleobs Sean Higgins

Title

exampleobs -- Prints example observations and optionally stores them in local macro

Syntax

exampleobs [varlist] [if] [in] [, options]

Income concepts
n(real) Number of observations to display (default is 10)

label Display value labels rather than values

[no]header Display or do not display header (i.e., variable names); default is to display unless only one variable specified

local(macname) Insert the list of values in the local macro macname

Description

exampleobs displays n (randomly selected) example variables from the data set,
where n is specified by
n(real) and has a default of 10. For variables with value labels, the label option
can be used to list value labels rather than values. Specifying sorted will
display the example observations of the data set after sorting it by varlist.
To not display the variable name header, specify noheader; the default is to display
the variable names unless varlist only contains one variable (to display the header if varlist
contains one variable, specify header). To save the values printed by exampleobs in
the local macro macname, specify local(macname).

Examples

. sysuse auto

. exampleobs price

. exampleobs price, local("example_prices")

. di "`example_prices'"

. exampleobs price, header

. exampleobs price foreign, label

. exampleobs price make, noheader

Author

Sean Higgins, Tulane University, shiggins@tulane.edu