*! version 1.0.0 25sept2018

closedesc -- Describe other variables close to a variable

Syntax

closedesc varname
, [options]

n(#) number of variables before and/or after the focal variable, the default is 3

forward only display variables after the focal variable, the default is forward and backward

backward only display variables before the focal variable, the default is forward and backward

Description

closedesc describes variables close to a variable. Often datasets order
their variables by topic, so if you found a relevant variable in a dataset, it often
helps to also look at the variables around it. Similar to when you find a book
in a library, it often pays to look at the other books on the same shelf.

Examples

Setup

. sysuse nlsw88

Find three variables before and after union

. closedesc union

Find three variables before union

. closedesc union, backward

Find five variable after union (except that in the dataset there are
only four variables after union)

. closedesc union, forward n(5)

Stored results

closedesc stores the following in r():

Macros

r(varlist) the varlist of found variables