📄 list.hlp
字号:
you do not specify the variables, all numeric variables in the {it:varlist}
following {cmd:list} are used.
{phang}
{opt labvar(varname)} is for use with {opt mean}[{cmd:()}],
{opt sum}[{cmd:()}], and {opt N}[{cmd:()}]. {cmd:list} displays {opt Mean},
{opt Sum}, or {opt N} where the observation number would usually appear to
indicate the end of the table--where a row represents the calculated mean,
sum, or number of observations.
{pmore}
{opt labvar(varname)} changes that. Instead, {opt Mean}, {opt Sum}, or
{opt N} is displayed where the value for {it:varname} would be displayed. For
instance, you might type
{cmd}. list group costs profits, sum(costs profits) labvar(group)
{txt}
{c TLC}{hline 7}{c -}{hline 7}{c -}{hline 9}{c TRC}
{c |} {res}group costs profits {txt}{c |}
{c LT}{hline 7}{c -}{hline 7}{c -}{hline 9}{c RT}
1. {c |} {res} 1 47 5 {txt}{c |}
2. {c |} {res} 2 123 10 {txt}{c |}
3. {c |} {res} 3 22 2 {txt}{c |}
{c LT}{hline 7}{c -}{hline 7}{c -}{hline 9}{c RT}
{c |} Sum {res} 192 17 {txt}{c |}
{c BLC}{hline 7}{c -}{hline 7}{c -}{hline 9}{c BRC}
{pmore}
and then also specify the {opt noobs} option to suppress the observation
numbers.
{dlgtab:Advanced}
{phang}
{opt constant} and {opth constant(varlist)} specify that variables that do not
vary observation by observation be separated out and listed only once.
{pmore}
{opt constant} specifies that {cmd:list} determine for itself which
variables are constant.
{pmore}
{opth constant(varlist)} allows you to specify which of the constant variables
you want listed separately. {cmd:list} verifies that the variables you
specify really are constant and issues an error message if they are not.
{pmore}
Note, {opt constant} and {opt constant()} respect {opt if} {it:exp} and
{opt in} {it:range}. If you type
{pmore2}
{cmd:. list if group==3}
{pmore}
variable {opt x} might be constant in the selected observations, even though
the variable varies in the entire dataset.
{phang}
{opt notrim} affects how string variables are listed. The default is to trim
strings at the width implied by the widest possible column given your screen
width (or {opt linesize()}, if you specified that). {opt notrim} specifies
that strings not be trimmed. {opt notrim} implies {opt clean} (see above)
and, in fact, is exactly equivalent to the {opt clean} option, so specifying
either makes no difference.
{phang}
{opt absolute} affects output only when {cmd:list} is prefixed with {opt by}
{it:varlist}{cmd::}. Observation numbers are displayed, but the overall
observation numbers are used rather than the observation numbers within each
by group. For example, if the first group had four observations and the
second had two, by default, the observations would be numbered 1, 2, 3, 4 and
1, 2. If {opt absolute} is specified, the observations will be numbered 1, 2,
3, 4 and 5, 6.
{phang}
{opt nodotz} is a programmer's option that specifies that numerical values
equal to {cmd:.z} be listed as a field of blanks rather than {cmd:.z}.
{phang}
{opt subvarname} is a programmer's option. If a variable has the
{help char:characteristic} {it:var}{cmd:[varname]} set, then the contents of
that characteristic will be used in place of the variable's name in the
headers.
{phang}{marker linesize()}
{opt linesize(#)} specifies the width of the page to be used for determining
whether table or display format should be used and for formatting the
resulting table. Specifying a value of {opt linesize()} that is wider than
your screen width can produce truly ugly output on the screen, but that output
can nevertheless be useful if you are logging output and plan to print the log
later on a wide printer.
{title:Syntax for clist}
{p 8 17 2}
{opt cl:ist} [{varlist}] {ifin} [{it:clist_options}]{p_end}
{synoptset 20}{...}
{synopthdr :clist_options}
{synoptline}
{synopt :[{cmdab:no:}]{opt d:isplay}}format into display or tabular
{opt nondisplay} format{p_end}
{synopt :{opt noh:eader}}omit variable or observation number header
information{p_end}
{synopt :{opt nol:abel}}display numeric codes; default displays label
values{p_end}
{synopt :{opt noo:bs}}suppress printing of observation numbers{p_end}
{synopt :{opt do:ublespace}}insert a blank line between each observation when
in nondisplay mode; has no effect in display mode{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}{opt by} may be used with {cmd:clist}. See {help by}.{p_end}
{p 4 6 2}{it:varlist} may contain time-series operators. See
{help tsvarlist}.
{title:Description of clist}
{pstd}
{cmd:clist} is similar to {cmd:list, clean}; {cmd:clist} is the {cmd:list}
command that appeared in Stata before Stata 8, options and all. {cmd:list}
continues to be the preferred command. {cmd:clist} is provided for those
instances when the old style of output is desired.
{title:Options for clist}
{phang}
[{opt no}]{opt display} forces the format into {opt display} or
tabular ({opt nodisplay}) format. If you do not specify one of these two
options, Stata chooses the one it believes would be most readable.
{phang}
{opt noheader} omits variable or observation number header information. The
blank line and variable names at the top of the listing are omitted when in
{opt nondisplay} mode. The observation number header and one blank line are
omitted for each observation when in {opt display} mode.
{phang}
{opt nolabel} specifies that numeric codes be displayed rather than label
values.
{phang}
{opt noobs} suppresses printing of the observation numbers.
{phang}
{opt doublespace} produces a blank line between each observation in the
listing when in {opt nondisplay} mode; it has no effect in {opt display} mode.
{title:Remarks}
{pstd}
{cmd:list} respects linesize. That is, if you resize the Results window (in
windowed versions of Stata) before running {cmd:list}, it will take advantage
of the available horizontal space. Stata for Unix(console) users can instead
use the {helpb linesize:set linesize} command to take advantage of this
feature.
{pstd}
{cmd:list} may not display all the large string. You have 2 choices:
1) you can specify the {cmd:clean} option, which makes a different, less
attractive listing, or 2) you can change your linesize, as discussed
{help list##linesize():above}.
{pstd}
{cmd:list} has two output formats, known as table and display. The table
format is suitable for listing a few variables, whereas the display
format is suitable for listing an unlimited number of variables. Stata
chooses automatically between the two formats, or you may specify the
{opt table} or {opt display} options. The table format looks
like this:
{cmd}. list make-rep78 in 1/4, table
{txt}
{c TLC}{hline 15}{c -}{hline 7}{c -}{hline 5}{c -}{hline 7}{c TRC}
{c |} {res}make price mpg rep78 {txt}{c |}
{c LT}{hline 15}{c -}{hline 7}{c -}{hline 5}{c -}{hline 7}{c RT}
1. {c |} {res}AMC Concord 4,099 22 3 {txt}{c |}
2. {c |} {res}AMC Pacer 4,749 17 3 {txt}{c |}
3. {c |} {res}AMC Spirit 3,799 22 . {txt}{c |}
4. {c |} {res}Buick Century 4,816 20 3 {txt}{c |}
{c BLC}{hline 15}{c -}{hline 7}{c -}{hline 5}{c -}{hline 7}{c BRC}
{pstd}
The display format looks like this:
{cmd}. list in 1/2, display
{txt}{c TLC}{hline 13}{c TT}{hline 7}{c TT}{hline 5}{c TT}{hline 8}{c TT}{hline 11}{c TT}{hline 8}{c TRC}
1. {c |} make {c |} price {c |} mpg {c |} rep78 {c |} headroom {c |} trunk {c |}
{c |} {res}AMC Concord {txt}{c |} {res}4,099 {txt}{c |} {res} 22 {txt}{c |} {res} 3 {txt}{c |} {res} 2.5 {txt}{c |} {res} 11 {txt}{c |}
{c LT}{hline 8}{c TT}{hline 4}{c BT}{hline 3}{c TT}{hline 3}{c BT}{hline 2}{c TT}{hline 2}{c BT}{hline 7}{c TT}{c BT}{hline 9}{c TT}{hline 1}{c BT}{hline 8}{c RT}
{c |} weight {c |} length {c |} turn {c |} displa~t {c |} gear_r~o {c |} foreign {c |}
{c |} {res} 2,930 {txt}{c |} {res} 186 {txt}{c |} {res} 40 {txt}{c |} {res} 121 {txt}{c |} {res} 3.58 {txt}{c |} {res}Domestic {txt}{c |}
{c BLC}{hline 8}{c BT}{hline 8}{c BT}{hline 6}{c BT}{hline 10}{c BT}{hline 10}{c BT}{hline 10}{c BRC}
{c TLC}{hline 13}{c TT}{hline 7}{c TT}{hline 5}{c TT}{hline 8}{c TT}{hline 11}{c TT}{hline 8}{c TRC}
2. {c |} make {c |} price {c |} mpg {c |} rep78 {c |} headroom {c |} trunk {c |}
{c |} {res}AMC Pacer {txt}{c |} {res}4,749 {txt}{c |} {res} 17 {txt}{c |} {res} 3 {txt}{c |} {res} 3.0 {txt}{c |} {res} 11 {txt}{c |}
{c LT}{hline 8}{c TT}{hline 4}{c BT}{hline 3}{c TT}{hline 3}{c BT}{hline 2}{c TT}{hline 2}{c BT}{hline 7}{c TT}{c BT}{hline 9}{c TT}{hline 1}{c BT}{hline 8}{c RT}
{c |} weight {c |} length {c |} turn {c |} displa~t {c |} gear_r~o {c |} foreign {c |}
{c |} {res} 3,350 {txt}{c |} {res} 173 {txt}{c |} {res} 40 {txt}{c |} {res} 258 {txt}{c |} {res} 2.53 {txt}{c |} {res}Domestic {txt}{c |}
{c BLC}{hline 8}{c BT}{hline 8}{c BT}{hline 6}{c BT}{hline 10}{c BT}{hline 10}{c BT}{hline 10}{c BRC}
{title:Examples}
{phang}{cmd:. list}{p_end}
{phang}{cmd:. list in 1/10}{p_end}
{phang}{cmd:. list mpg weight}{p_end}
{phang}{cmd:. list mpg weight in 1/20}{p_end}
{phang}{cmd:. list if mpg>20}{p_end}
{phang}{cmd:. list mpg weight if mpg>20}{p_end}
{phang}{cmd:. list mpg weight if mpg>20 in 1/10}
{phang}{cmd:. by rep78, sort: list, constant}
{title:Also see}
{psee}
Manual: {bf:[D] list}
{psee}
Online: {helpb display}, {helpb edit}, {helpb tabdisp}, {helpb table}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -