{smcl} {* 2sep2009}{...} {cmd: help elemlist} {hline} {title:Title} {pstd}{cmd:element lists (generalized varlists)} {title:Description} {pstd}An {it:elemlist} is a superset of a Stata {varlist}. You can just treat it as a {varlist} and go. Or, read on for the details. The main distinction is that the {it:elemlist} allows more, and more flexible, ways to specify ranges. {pstd}Secondarily, an {it:elemlist} can include {bf:modifiers}, described below, and is used in some places to select things other than variables. {pstd}Abbreviations and wildcards ({cmd:*}, {cmd:?}, and {cmd:~}) work as in a {varlist}. {title:Ranges} {phang}>>> For the following examples, first {stata sysuse elemlist.dta}. The dataset contains the variables: {bf:a b ba c x y ya yb z}. {pstd}Ranges can be specified in two distinct ways. First, similarly to a {varlist}, as all items between two endpoints. For example: {pmore}{stata tlist a-z} {pstd}However, the endpoints can be listed in either order: {pmore}{stata tlist z-a} {pstd}And the indivdual terms can include wildcards. When a wildcard is included, the most extreme member(s) of the specfied set are used as the endpoint(s): {pmore}{stata tlist b*-y?} {pstd}The second way to specify a range is as {bf:extensions} around one or more anchor items. The syntax would be: {pmore}{it:anchor}[{it:ext1}][{it:ext2}] {pstd}where {it:anchor} can include wildcards, and {it:ext1} and {it:ext2} are of the form {pmore}{{cmd:<}|{cmd:>}}{it:#} {pstd}where {it:#} indicates how many elements before ({cmd:<}) and/or after ({cmd:>}) the {it:anchor} to include. For example: {p2colset 9 25 25 2} {p2col:{stata tlist c>1}}specifies {cmd:c} and the variable after {cmd:c}. {p2col:{stata tlist x>2<2}}specifies all variables within 2 of {cmd:x}. {p2col:{stata tlist a>3>6}}specifies the variables from 3 to 6 after {cmd:a}. {p2col:{stata tlist *b>1}}specfies all variables ending with {cmd:b}, and for each of those, the following variable. {title:Modifiers} {pstd}Some commands will allow an {it:elemlist} to include specific {bf:modifiers}. In general, a {bf:modifier} is just a dot ({cmd:.}) followed (perhaps) by some text, which goes at the end of any term. For example: {pmore}{cmd:a.mod1}{p_end} {pmore}{cmd:b*.mod2}{p_end} {pmore}{cmd:a-z.}{p_end} {pmore}{cmd:c>1<1.mod4}{p_end} {pstd}The modifier affects how all the items specified in that term will be treated by the current command. For example, {phang2}{cmd:. bivar z b*.cat} would treat all variables starting with {cmd:b} as categorical variables. {phang2}{cmd:. t a y-z.} would collapse all non-missing values of variables {cmd:y} through {cmd:z}. {pstd}The allowable modifiers, as well as their effects, are specific to each command.