help tail Sean Higgins

Title

tail -- Prints the tail observations (last observations in data set)

Syntax

tail [varlist] [if] [in] [, options]

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

label Display value labels rather than values

unique Only display unique values

sorted Sort in ascending order of varlist

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

Description

tail displays the last n observations in the data set, where n is specified by
n(real) and has a default of 10. It was designed to mimic the tail function in R.
For variables with value labels, the label option
can be used to list value labels rather than values. To only display unique values of varlist, specify
unique (e.g. if the last three values are 9, 10, 10 and n(2) and unique are
specified, the values displayed will be 9, 10 instead of 10, 10). Specifying sorted will
display the tail 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).

Examples

. sysuse auto

. tail price

. tail price, n(2) header

. tail price make, unique

. tail price foreign, unique sorted label

. tail price foreign, unique sorted noheader

Author

Sean Higgins, Tulane University, shiggins@tulane.edu