*! version 1.1.0 06Oct2022

Title

lany -- list values of variables for all observations in subsets of
the data

Syntax

lany
[varlist]
if
, by(varlist)
[sort(varlist)
options]

options are all options allowed for list

Description

lany lists the values of variables for all observations in subsets defined
by the by() option when the if condition is true for at least one
observation in a subset. For example, we may have a panel dataset on educational
careers of individuals and some individuals report that they went from primary
school immediately to university. This seems unlikely, so you want to see the
entire educational history of all persons who went to university after primary
education to see what is going on.

Options

by(varlist) Specifies the subsets, e.g. in a panel dataset this would be the
person identifier.

sort(varlist) specifies the sorting order within the subset, e.g. in a panel
dataset this would be the wave.

Other options from list are allowed. In particular sepby() can be
helpful.

Examples

Some persons in this dataset were married in one wave and never married in the
following wave, which cannot be true. We may want to see the entire marital status
history of these individuals.

. webuse nlswork

. lany idcode year msp nev_mar if nev_mar == 1 & msp[_n-1] == 1, by(idcode) sort(year) sepby(idcode)