*! version 2.11.0 08jun2017

Title

local_inlist -- Construct inlist() expressions

Syntax

local_inlist
varname
val1 val2 ...
[, labels]

labels treat the values as labels, which will then be automatically
transformed to numbers

Description

local_inlist constructs a string of the form inlist(variable, val, val, ...)
and stores it in the local inlist

Examples

. sysuse auto

. gen _brand = word(make, 1)

. encode _brand, gen(brand)

. local_inlist turn 40 41 42 43

. keep if `inlist'

. local_inlist brand Fiat BMW Toyota Datsun

. tab brand if `inlist'